Skip to content

Commit

Permalink
Fix tarpaulin caching on CI (#127)
Browse files Browse the repository at this point in the history
Properly cache `.crates.toml` and `.crates2.json` as recommended by the
cargo team here: rust-lang/cargo#11513. This
ensures installed cargo binaries are cached, and restored correctly.

Remove the `--force` flag from the tarpaulin install, to use the cached
version if available and speed up the coverage build.
  • Loading branch information
djeedai committed Jan 22, 2023
1 parent 33de328 commit 70d8c24
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ jobs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-build-all-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: actions-rs/toolchain@v1
Expand All @@ -95,7 +97,7 @@ jobs:
if: runner.os == 'linux'
- name: Install cargo-tarpaulin
run: |
RUST_BACKTRACE=1 cargo install --force --version 0.22.0 cargo-tarpaulin
RUST_BACKTRACE=1 cargo install --version 0.22.0 cargo-tarpaulin
- name: Generate code coverage
run: |
RUST_BACKTRACE=1 cargo tarpaulin --engine llvm --verbose --timeout 120 --out Lcov --workspace --all-features
Expand Down

0 comments on commit 70d8c24

Please sign in to comment.