Эх сурвалжийг харах

chore(cli): cherry pick #6603, fix webkit2gtk version

Lucas Nogueira 2 жил өмнө
parent
commit
f84fbe459f

+ 3 - 3
tooling/cli/src/info/env_system.rs

@@ -125,7 +125,7 @@ fn pkg_conf_version(package: &str) -> Option<String> {
   target_os = "netbsd"
 ))]
 fn webkit2gtk_ver() -> Option<String> {
-  pkg_conf_version("webkit2gtk-4.0")
+  pkg_conf_version("webkit2gtk-4.1")
 }
 #[cfg(any(
   target_os = "linux",
@@ -230,11 +230,11 @@ pub fn items() -> Vec<SectionItem> {
       || {
         Some(
           webkit2gtk_ver()
-            .map(|v| (format!("webkit2gtk-4.0: {v}"), Status::Success))
+            .map(|v| (format!("webkit2gtk-4.1: {v}"), Status::Success))
             .unwrap_or_else(|| {
               (
                 format!(
-                  "webkit2gtk-4.0: {}\nVisit {} to learn more about tauri prerequisites",
+                  "webkit2gtk-4.1: {}\nVisit {} to learn more about tauri prerequisites",
                   "not installed".red(),
                   "https://tauri.app/v1/guides/getting-started/prerequisites".cyan()
                 ),

+ 1 - 1
tooling/cli/templates/plugin/.github/workflows/audit.yml

@@ -22,7 +22,7 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v3
-      - uses: actions-rs/audit-check@v1
+      - uses: rustsec/audit-check@v1
         with:
           token: ${{ secrets.GITHUB_TOKEN }}
     permissions:

+ 9 - 11
tooling/cli/templates/plugin/.github/workflows/clippy.yml

@@ -18,20 +18,18 @@ jobs:
 
     steps:
       - uses: actions/checkout@v3
-      - name: install webkit2gtk
+
+      - name: Install dependencies
         run: |
           sudo apt-get update
           sudo apt-get install -y webkit2gtk-4.1
+
       - name: Install clippy with stable toolchain
-        uses: actions-rs/toolchain@v1
-        with:
-            profile: minimal
-            toolchain: stable
-            override: true
-            components: clippy
-      - uses: actions-rs/clippy-check@v1
+        uses: dtolnay/rust-toolchain@stable
         with:
-          token: ${{ secrets.GITHUB_TOKEN }}
-          args: --manifest-path=Cargo.toml --all-targets --all-features -- -D warnings
-          name: clippy
+          components: clippy
+
+      - uses: Swatinem/rust-cache@v2
+
+      - run: cargo clippy --manifest-path=Cargo.toml --all-targets --all-features -- -D warnings
 {{{{/raw}}}}

+ 9 - 11
tooling/cli/templates/plugin/.github/workflows/format.yml

@@ -17,16 +17,14 @@ jobs:
       fail-fast: false
 
     steps:
-    - uses: actions/checkout@v3
-    - name: Install rustfmt with stable toolchain
-      uses: actions-rs/toolchain@v1
-      with:
-          profile: minimal
-          toolchain: stable
-          override: true
+      - uses: actions/checkout@v3
+
+      - name: Install rustfmt with stable toolchain
+        uses: dtolnay/rust-toolchain@stable
+        with:
           components: rustfmt
-    - uses: actions-rs/cargo@v1
-      with:
-        command: fmt
-        args: --manifest-path=Cargo.toml --all -- --check
+
+      - uses: Swatinem/rust-cache@v2
+
+      - run: cargo fmt --manifest-path=Cargo.toml --all -- --check
 {{{{/raw}}}}

+ 43 - 0
tooling/cli/templates/plugin/.github/workflows/test.yml

@@ -0,0 +1,43 @@
+{{{{raw}}}}
+name: Test
+
+on:
+  push:
+    branches:
+      - main
+  pull_request:
+    branches:
+      - main
+      - dev
+    paths-ignore:
+      - 'webview-src/**'
+      - 'webview-dist/**'
+      - 'examples/**'
+
+jobs:
+  build-and-test:
+    runs-on: ${{ matrix.os }}
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [ubuntu-latest, macos-latest, windows-latest]
+
+    steps:
+      - uses: actions/checkout@v3
+
+      - name: Install stable toolchain
+        uses: dtolnay/rust-toolchain@stable
+        with:
+          components: clippy
+
+      - name: Install Linux dependencies
+        if: matrix.os == 'ubuntu-latest'
+        run: |
+          sudo apt-get update
+          sudo apt-get install -y webkit2gtk-4.1
+
+      - uses: Swatinem/rust-cache@v2
+
+      - name: Run tests
+        run: cargo test --manifest-path=Cargo.toml --release
+{{{{/raw}}}}