chore(ci): update Rust cache configuration in autobuild and lint-clippy workflows for improved efficiency

This commit is contained in:
Tunglies
2025-11-18 16:13:19 +08:00
parent 38980b1249
commit 7a81a673f3
2 changed files with 25 additions and 13 deletions

View File

@@ -156,10 +156,13 @@ jobs:
- name: Rust Cache - name: Rust Cache
uses: Swatinem/rust-cache@v2 uses: Swatinem/rust-cache@v2
with: with:
workspaces: src-tauri
cache-all-crates: true
save-if: ${{ github.ref == 'refs/heads/dev' }} save-if: ${{ github.ref == 'refs/heads/dev' }}
key: ${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**Cargo.lock') }} prefix-key: "v1-rust"
key: "rust-shared-stable-${{ matrix.os }}-${{ matrix.target }}"
workspaces: |
. -> target
cache-all-crates: false
cache-workspace-crates: true
- name: Install dependencies (ubuntu only) - name: Install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-22.04' if: matrix.os == 'ubuntu-22.04'
@@ -264,10 +267,13 @@ jobs:
- name: Rust Cache - name: Rust Cache
uses: Swatinem/rust-cache@v2 uses: Swatinem/rust-cache@v2
with: with:
workspaces: src-tauri
cache-all-crates: true
save-if: ${{ github.ref == 'refs/heads/dev' }} save-if: ${{ github.ref == 'refs/heads/dev' }}
key: ${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**Cargo.lock') }} prefix-key: "v1-rust"
key: "rust-shared-stable-${{ matrix.os }}-${{ matrix.target }}"
workspaces: |
. -> target
cache-all-crates: false
cache-workspace-crates: true
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4
@@ -411,10 +417,13 @@ jobs:
- name: Rust Cache - name: Rust Cache
uses: Swatinem/rust-cache@v2 uses: Swatinem/rust-cache@v2
with: with:
workspaces: src-tauri
cache-all-crates: true
save-if: ${{ github.ref == 'refs/heads/dev' }} save-if: ${{ github.ref == 'refs/heads/dev' }}
key: ${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**Cargo.lock') }} prefix-key: "v1-rust"
key: "rust-shared-stable-${{ matrix.os }}-${{ matrix.target }}"
workspaces: |
. -> target
cache-all-crates: false
cache-workspace-crates: true
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4

View File

@@ -58,10 +58,13 @@ jobs:
- name: Rust Cache - name: Rust Cache
uses: Swatinem/rust-cache@v2 uses: Swatinem/rust-cache@v2
with: with:
workspaces: src-tauri save-if: ${{ github.ref == 'refs/heads/dev' }}
cache-all-crates: true prefix-key: "v1-rust"
save-if: false key: "rust-shared-stable-${{ matrix.os }}-${{ matrix.target }}"
key: ${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**Cargo.lock') }} workspaces: |
. -> target
cache-all-crates: false
cache-workspace-crates: true
- name: Install dependencies (ubuntu only) - name: Install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-22.04' if: matrix.os == 'ubuntu-22.04'