fix: update caching keys in workflow files to use glob pattern for Cargo.lock

This commit is contained in:
Tunglies
2025-11-17 13:02:44 +08:00
parent d1a099b480
commit 35ae5cdba1
4 changed files with 6 additions and 10 deletions

View File

@@ -159,8 +159,7 @@ jobs:
workspaces: src-tauri workspaces: src-tauri
cache-all-crates: true cache-all-crates: true
save-if: ${{ github.ref == 'refs/heads/dev' }} save-if: ${{ github.ref == 'refs/heads/dev' }}
shared-key: autobuild-${{ runner.os }}-${{ matrix.target }} key: ${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**Cargo.lock') }}
key: ${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('src-tauri/Cargo.lock') }}
- name: Install dependencies (ubuntu only) - name: Install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-22.04' if: matrix.os == 'ubuntu-22.04'
@@ -268,8 +267,7 @@ jobs:
workspaces: src-tauri workspaces: src-tauri
cache-all-crates: true cache-all-crates: true
save-if: ${{ github.ref == 'refs/heads/dev' }} save-if: ${{ github.ref == 'refs/heads/dev' }}
shared-key: autobuild-${{ runner.os }}-${{ matrix.target }} key: ${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**Cargo.lock') }}
key: ${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('src-tauri/Cargo.lock') }}
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4
@@ -416,8 +414,7 @@ jobs:
workspaces: src-tauri workspaces: src-tauri
cache-all-crates: true cache-all-crates: true
save-if: ${{ github.ref == 'refs/heads/dev' }} save-if: ${{ github.ref == 'refs/heads/dev' }}
shared-key: autobuild-${{ runner.os }}-${{ matrix.target }} key: ${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**Cargo.lock') }}
key: ${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('src-tauri/Cargo.lock') }}
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4

View File

@@ -56,7 +56,7 @@ jobs:
echo "🔍 Finding last commit with Tauri-related changes..." echo "🔍 Finding last commit with Tauri-related changes..."
# Define patterns for Tauri-related files # Define patterns for Tauri-related files
TAURI_PATTERNS="src/ src-tauri/src src-tauri/Cargo.toml src-tauri/Cargo.lock src-tauri/tauri.*.conf.json src-tauri/build.rs src-tauri/capabilities" TAURI_PATTERNS="src/ src-tauri/src src-tauri/Cargo.toml Cargo.lock src-tauri/tauri.*.conf.json src-tauri/build.rs src-tauri/capabilities"
# Get the last commit that changed any of these patterns (excluding build artifacts) # Get the last commit that changed any of these patterns (excluding build artifacts)
LAST_TAURI_COMMIT="" LAST_TAURI_COMMIT=""

View File

@@ -83,7 +83,7 @@ jobs:
workspaces: src-tauri workspaces: src-tauri
save-if: false save-if: false
cache-all-crates: true cache-all-crates: true
shared-key: autobuild-shared key: ${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**Cargo.lock') }}
- name: Install dependencies (ubuntu only) - name: Install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-22.04' && github.event.inputs[matrix.input] == 'true' if: matrix.os == 'ubuntu-22.04' && github.event.inputs[matrix.input] == 'true'

View File

@@ -61,8 +61,7 @@ jobs:
workspaces: src-tauri workspaces: src-tauri
cache-all-crates: true cache-all-crates: true
save-if: false save-if: false
shared-key: autobuild-${{ runner.os }}-${{ matrix.target }} key: ${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**Cargo.lock') }}
key: ${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('src-tauri/Cargo.lock') }}
- name: Install dependencies (ubuntu only) - name: Install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-22.04' if: matrix.os == 'ubuntu-22.04'