Skip to content

Commit f6ad14f

Browse files
committed
ci: remove rust-cache to fix sccache 0% hit rate
Remove Swatinem/rust-cache from CI workflow to avoid conflict with sccache. Using both caching mechanisms caused 0% cache hit rate because rust-cache was already caching all compiled artifacts, leaving nothing for sccache to cache. Changes: - Removed rust-cache from test, clippy, and build jobs - Added CARGO_INCREMENTAL=0 for better sccache performance - Now using only sccache for CI caching Expected improvement: - sccache cache hit rate should increase from 0% to 40-60% - Build times should remain fast due to sccache GitHub Actions cache
1 parent c7d57c8 commit f6ad14f

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
env:
1515
CARGO_TERM_COLOR: always
1616
RUST_BACKTRACE: 1
17+
CARGO_INCREMENTAL: 0 # Disable incremental compilation for better sccache performance
1718

1819
jobs:
1920
test:
@@ -41,12 +42,6 @@ jobs:
4142
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
4243
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
4344
44-
- name: Cache Cargo dependencies
45-
uses: Swatinem/rust-cache@v2
46-
with:
47-
shared-key: test-${{ matrix.os }}
48-
save-if: ${{ github.event_name == 'push' }}
49-
5045
- name: Install cargo-nextest
5146
uses: taiki-e/install-action@nextest
5247

@@ -93,12 +88,6 @@ jobs:
9388
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
9489
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
9590
96-
- name: Cache Cargo dependencies
97-
uses: Swatinem/rust-cache@v2
98-
with:
99-
shared-key: clippy
100-
save-if: ${{ github.event_name == 'push' }}
101-
10291
- name: Run clippy
10392
run: cargo clippy --all-targets --all-features -- -D warnings
10493

@@ -138,12 +127,6 @@ jobs:
138127
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
139128
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
140129
141-
- name: Cache Cargo dependencies
142-
uses: Swatinem/rust-cache@v2
143-
with:
144-
shared-key: build-${{ matrix.os }}
145-
save-if: ${{ github.event_name == 'push' }}
146-
147130
- name: Build release
148131
run: cargo build --release --verbose
149132

0 commit comments

Comments
 (0)