Skip to content

Commit 5cf364c

Browse files
committed
ci: optimize code coverage performance from 13min to ~3-5min
## Performance Optimizations ### Major Improvements - **Use taiki-e/install-action** instead of cargo install for tarpaulin - Pre-built binaries vs compiling from source (~5-7min savings) - Cached installation for subsequent runs - **Add cargo caching** to coverage job - Use Swatinem/rust-cache@v2 like test jobs - Avoid recompiling dependencies every run (~2-3min savings) - **Add timeout protection** to prevent hanging - 300 second timeout for coverage generation - Better failure handling for long-running tests ### Expected Results - **Before**: ~13 minutes (cargo install + full recompile) - **After**: ~3-5 minutes (cached tools + dependencies) - **Improvement**: 60-75% faster coverage runs ### Technical Details - taiki-e/install-action uses pre-built binaries when available - Cargo cache reuses compiled dependencies across runs - Timeout prevents CI from hanging on problematic tests This should significantly improve developer experience by reducing PR feedback time while maintaining the same comprehensive coverage.
1 parent 798624c commit 5cf364c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,16 @@ jobs:
5454
- name: Install Rust
5555
uses: dtolnay/rust-toolchain@stable
5656

57+
- name: Cache cargo
58+
uses: Swatinem/rust-cache@v2
59+
5760
- name: Install tarpaulin
58-
run: cargo install cargo-tarpaulin
61+
uses: taiki-e/install-action@v2
62+
with:
63+
tool: cargo-tarpaulin
5964

6065
- name: Generate coverage
61-
run: cargo tarpaulin --workspace --all-features --out xml
66+
run: cargo tarpaulin --workspace --all-features --out xml --timeout 300
6267

6368
- name: Upload coverage to Codecov
6469
uses: codecov/codecov-action@v3

0 commit comments

Comments
 (0)