瀏覽代碼

ci: speed up cargo install by enabling cache (#1279)

Sukka 11 月之前
父節點
當前提交
babcb00621
共有 2 個文件被更改,包括 13 次插入2 次删除
  1. 7 1
      .github/workflows/alpha.yml
  2. 6 1
      .github/workflows/release.yml

+ 7 - 1
.github/workflows/alpha.yml

@@ -46,9 +46,15 @@ jobs:
         uses: Swatinem/rust-cache@v2
         with:
           workspaces: src-tauri
+          cache-all-crates: true
+          cache-on-failure: true
 
       - name: Install Tauri CLI
-        run: cargo install --git https://github.com/tauri-apps/tauri --branch 1.x tauri-cli
+        uses: baptiste0928/cargo-install@v3
+        with:
+          crate: tauri-cli
+          git: https://github.com/tauri-apps/tauri
+          branch: 1.x # `branch` and `commit` are also supported
 
       - name: Install Node
         uses: actions/setup-node@v4

+ 6 - 1
.github/workflows/release.yml

@@ -39,9 +39,14 @@ jobs:
         uses: Swatinem/rust-cache@v2
         with:
           workspaces: src-tauri
+          cache-all-crates: true
 
       - name: Install Tauri CLI
-        run: cargo install --git https://github.com/tauri-apps/tauri --branch 1.x tauri-cli
+        uses: baptiste0928/cargo-install@v3
+        with:
+          crate: tauri-cli
+          git: https://github.com/tauri-apps/tauri
+          branch: 1.x # `branch` and `commit` are also supported
 
       - name: Install Node
         uses: actions/setup-node@v4