Skip to content

Commit 2050667

Browse files
committed
Add Rust build cache to CI and restore cargo check job
Uses Swatinem/rust-cache@v2 in the Check, Test Suite, and Lints jobs. Setting cache-on-failure: false (the default) ensures that a failed build never writes a stale cache entry, which is how a missing import in #89 was able to pass CI despite being a compile error. Restores the cargo check job that was removed in the prior commit, since it gives a clearer signal for compile errors than a mixed test/lint failure.
1 parent d2679fa commit 2050667

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,32 @@ env:
1818
CARGO_TERM_COLOR: always
1919

2020
jobs:
21+
check:
22+
name: Check
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout sources
26+
uses: actions/checkout@v4
27+
28+
- name: Cache Rust build artifacts
29+
uses: Swatinem/rust-cache@v2
30+
with:
31+
cache-on-failure: false
32+
33+
- name: Run cargo check
34+
run: cargo check
2135
test:
2236
name: Test Suite
2337
runs-on: ubuntu-latest
2438
steps:
2539
- name: Checkout sources
2640
uses: actions/checkout@v4
2741

42+
- name: Cache Rust build artifacts
43+
uses: Swatinem/rust-cache@v2
44+
with:
45+
cache-on-failure: false
46+
2847
- name: Run cargo test with backtrace
2948
run: cargo test -- --nocapture
3049
env:
@@ -38,6 +57,11 @@ jobs:
3857
- name: Checkout sources
3958
uses: actions/checkout@v4
4059

60+
- name: Cache Rust build artifacts
61+
uses: Swatinem/rust-cache@v2
62+
with:
63+
cache-on-failure: false
64+
4165
- name: Run cargo fmt
4266
run: cargo fmt --all -- --check
4367

@@ -47,6 +71,7 @@ jobs:
4771
release:
4872
runs-on: macos-latest
4973
needs:
74+
- check
5075
- test
5176
- lints
5277
outputs:

0 commit comments

Comments
 (0)