Skip to content

Commit c36472d

Browse files
committed
ci: only save cache on main
1 parent f7dc384 commit c36472d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
with:
4848
add-job-id-key: "false"
4949
shared-key: "base"
50+
save-if: ${{ github.ref_name == 'main' }}
5051
# Fetch dependencies in a separate step to clearly show how long each part
5152
# of the testing takes
5253
- name: cargo fetch --locked
@@ -87,6 +88,7 @@ jobs:
8788
# * difftests depends on `spirv-builder` with no features, which excludes `rustc_codegen_spirv` entirely.
8889
# The individual difftest crates depend on it and run the spirv compile, never the test runner itself.
8990
- name: prep cache for other jobs
91+
if: github.ref_name == 'main'
9092
run: |
9193
cargo build -p compiletests --release --no-default-features --features "use-installed-tools"
9294
cargo build -p difftests --release --no-default-features --features "use-installed-tools"
@@ -114,6 +116,7 @@ jobs:
114116
with:
115117
add-job-id-key: "false"
116118
shared-key: "android"
119+
save-if: ${{ github.ref_name == 'main' }}
117120
- name: cargo fetch --locked
118121
run: cargo fetch --locked --target ${{ matrix.target }}
119122

0 commit comments

Comments
 (0)