Skip to content

Commit

Permalink
Switch to using cargo llvm-cov for code coverage assessment
Browse files Browse the repository at this point in the history
Our code coverage collection runs have repeatedly failed because of a
what appears to be a bug in the actions-rs/tarpaulin implementation.
This action, it turns out, has actually been (soft?) deprecated [0].
Attempting to switch to installing cargo-tarpauling directly takes ages,
and we already know that we would rather avoid handling caching in
GitHub Actions, because of their API mess.
However, it appears as if cargo llvm-cov may be usable by now, and is
generally said to provide more accurate coverage information. Thus, with
this change we switch over to using it for collection of code coverage.
Note that cargo-tarpaulin also seems to support using LLVM coverage as a
backend, but it still suffers from the aforementioned issues.

[0] actions-rs/tarpaulin#6
  • Loading branch information
d-e-s-o committed Nov 26, 2022
1 parent 3e92097 commit 503ba29
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions-rs/tarpaulin@v0.1
with:
version: latest
args: --exclude-files=src/api/v2/de.rs
out-type: Xml
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Test and gather coverage
run: cargo llvm-cov --lcov --output-path lcov.info --ignore-filename-regex=src/api/v2/de.rs
env:
APCA_API_KEY_ID: ${{ secrets.APCA_API_KEY_ID }}
APCA_API_SECRET_KEY: ${{ secrets.APCA_API_SECRET_KEY }}
- name: Upload code coverage results
uses: codecov/codecov-action@v3
with:
files: cobertura.xml
files: lcov.info
clippy:
name: Lint with clippy
runs-on: ubuntu-latest
Expand Down

0 comments on commit 503ba29

Please sign in to comment.