Skip to content

Commit a2149e4

Browse files
committed
fix(ci): separate cache keys for release and debug builds
- Build job uses 'platform-release' cache (release artifacts) - Test and Clippy jobs use 'platform-debug' cache (debug artifacts) - Both test and clippy now save cache (cache-on-failure: true) - This prevents full recompilation since debug/release don't share artifacts
1 parent 1b5463b commit a2149e4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
uses: Swatinem/rust-cache@v2
3636
with:
3737
cache-on-failure: true
38-
shared-key: "platform-build"
38+
shared-key: "platform-release"
3939

4040
- name: Build
4141
run: cargo build --release
@@ -65,8 +65,8 @@ jobs:
6565
- name: Cache cargo
6666
uses: Swatinem/rust-cache@v2
6767
with:
68-
shared-key: "platform-build"
69-
save-if: false
68+
cache-on-failure: true
69+
shared-key: "platform-debug"
7070

7171
- name: Run tests with coverage
7272
run: cargo llvm-cov --workspace --json --output-path coverage.json
@@ -112,8 +112,8 @@ jobs:
112112
- name: Cache cargo
113113
uses: Swatinem/rust-cache@v2
114114
with:
115-
shared-key: "platform-build"
116-
save-if: false
115+
cache-on-failure: true
116+
shared-key: "platform-debug"
117117

118118
- name: Run clippy
119119
run: cargo clippy --all-targets --workspace -- -W clippy::all
@@ -191,7 +191,7 @@ jobs:
191191
- name: Cache cargo
192192
uses: Swatinem/rust-cache@v2
193193
with:
194-
shared-key: "platform-build"
194+
shared-key: "platform-release"
195195
save-if: false
196196

197197
- name: Build release binaries

0 commit comments

Comments
 (0)