Skip to content

Commit 6c5cad9

Browse files
perf(ci): cache cargo-tarpaulin binary to speed up Rust tests
Installing cargo-tarpaulin takes ~2+ minutes each run. By caching ~/.cargo/bin/ and checking if the binary exists, we skip reinstallation on subsequent runs. Expected improvement: ~2m savings on cache hits (from 4m5s -> ~2m)
1 parent d22a8cc commit 6c5cad9

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,18 @@ jobs:
146146
uses: Swatinem/rust-cache@v2
147147
with:
148148
workspaces: src-tauri
149+
# Cache cargo binaries (including cargo-tarpaulin)
150+
cache-directories: |
151+
~/.cargo/bin/
149152
150153
- name: Install cargo-tarpaulin
151-
run: cargo install cargo-tarpaulin
154+
run: |
155+
# Only install if not already cached
156+
if ! command -v cargo-tarpaulin &> /dev/null; then
157+
cargo install cargo-tarpaulin
158+
else
159+
echo "cargo-tarpaulin already installed (cached)"
160+
fi
152161
153162
- name: Run Rust tests with coverage
154163
working-directory: ./src-tauri

0 commit comments

Comments
 (0)