Skip to content

Commit 6423036

Browse files
committed
Only save cache if running on main
1 parent 0768cf8 commit 6423036

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

.github/workflows/ci.yaml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ jobs:
4848
- uses: dtolnay/rust-toolchain@stable
4949
with:
5050
components: clippy
51-
- uses: Swatinem/rust-cache@v2
51+
52+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
53+
with:
54+
save-if: ${{ github.ref == 'refs/heads/main' }}
5255

5356
- name: Install macOS dependencies
5457
uses: ./.github/actions/install-macos-deps
@@ -131,9 +134,10 @@ jobs:
131134
with:
132135
persist-credentials: false
133136

134-
- uses: Swatinem/rust-cache@v2
137+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
135138
with:
136139
prefix-key: v0-rust-${{ join(matrix.targets, '-') }}
140+
save-if: ${{ github.ref == 'refs/heads/main' }}
137141

138142
- name: Install dependencies
139143
uses: ./.github/actions/install-linux-deps
@@ -284,7 +288,9 @@ jobs:
284288

285289
- uses: dtolnay/rust-toolchain@stable
286290

287-
- uses: Swatinem/rust-cache@v2
291+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
292+
with:
293+
save-if: ${{ github.ref == 'refs/heads/main' }}
288294

289295
- uses: actions/setup-python@v6.2.0
290296
with:
@@ -440,7 +446,9 @@ jobs:
440446
toolchain: ${{ env.NIGHTLY_CHANNEL }}
441447
components: miri
442448

443-
- uses: Swatinem/rust-cache@v2
449+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
450+
with:
451+
save-if: ${{ github.ref == 'refs/heads/main' }}
444452

445453
- name: Run tests under miri
446454
run: cargo +${{ env.NIGHTLY_CHANNEL }} miri test -p rustpython-vm -- miri_test
@@ -461,7 +469,10 @@ jobs:
461469

462470
- uses: dtolnay/rust-toolchain@stable
463471

464-
- uses: Swatinem/rust-cache@v2
472+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
473+
with:
474+
save-if: ${{ github.ref == 'refs/heads/main' }}
475+
465476
- name: install wasm-pack
466477
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
467478
- name: install geckodriver
@@ -529,7 +540,10 @@ jobs:
529540
with:
530541
target: wasm32-wasip1
531542

532-
- uses: Swatinem/rust-cache@v2
543+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
544+
with:
545+
save-if: ${{ github.ref == 'refs/heads/main' }}
546+
533547
- name: Setup Wasmer
534548
uses: wasmerio/setup-wasmer@v3
535549

0 commit comments

Comments
 (0)