Skip to content

Commit 6746cbd

Browse files
committed
ci: only save cache on main
1 parent d08ce6e commit 6746cbd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
with:
4646
add-job-id-key: "false"
4747
shared-key: "base"
48+
save-if: ${{ github.ref_name == 'main' }}
4849
# Fetch dependencies in a separate step to clearly show how long each part
4950
# of the testing takes
5051
- name: cargo fetch --locked
@@ -85,6 +86,7 @@ jobs:
8586
# * difftests depends on `spirv-builder` with no features, which excludes `rustc_codegen_spirv` entirely.
8687
# The individual difftest crates depend on it and run the spirv compile, never the test runner itself.
8788
- name: prep cache for other jobs
89+
if: github.ref_name == 'main'
8890
run: |
8991
cargo build -p compiletests --release --no-default-features --features "use-installed-tools"
9092
cargo build -p difftests --release --no-default-features --features "use-installed-tools"
@@ -112,6 +114,7 @@ jobs:
112114
with:
113115
add-job-id-key: "false"
114116
shared-key: "android"
117+
save-if: ${{ github.ref_name == 'main' }}
115118
- name: cargo fetch --locked
116119
run: cargo fetch --locked --target ${{ matrix.target }}
117120

0 commit comments

Comments
 (0)