Skip to content

Commit 14bc231

Browse files
committed
fix(ci): properly use cargo cache across jobs
- Remove destructive cleanup step that deleted cached artifacts - Add shared-key 'platform-build' to share cache between jobs - Build job saves cache, other jobs read from it This should significantly speed up CI by reusing compiled dependencies.
1 parent 007b920 commit 14bc231

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

.github/workflows/ci.yml

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

3940
- name: Build
4041
run: cargo build --release
4142

42-
- name: Cleanup before cache
43-
run: |
44-
rm -rf target/release/.fingerprint target/release/build target/release/deps target/release/examples target/release/incremental
45-
find target -name "*.d" -delete
46-
df -h
47-
4843
test:
4944
name: Test
5045
runs-on: ubuntu-latest
@@ -70,7 +65,7 @@ jobs:
7065
- name: Cache cargo
7166
uses: Swatinem/rust-cache@v2
7267
with:
73-
cache-on-failure: true
68+
shared-key: "platform-build"
7469
save-if: false
7570

7671
- name: Run tests with coverage
@@ -117,7 +112,7 @@ jobs:
117112
- name: Cache cargo
118113
uses: Swatinem/rust-cache@v2
119114
with:
120-
cache-on-failure: true
115+
shared-key: "platform-build"
121116
save-if: false
122117

123118
- name: Run clippy
@@ -196,6 +191,7 @@ jobs:
196191
- name: Cache cargo
197192
uses: Swatinem/rust-cache@v2
198193
with:
194+
shared-key: "platform-build"
199195
save-if: false
200196

201197
- name: Build release binaries

0 commit comments

Comments
 (0)