Skip to content

Commit

Permalink
Use cargo-llvm-cov rather than grcov. (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
qwandor authored Jan 17, 2024
1 parent e34bfa6 commit 7562b74
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,18 @@ jobs:

coverage:
runs-on: ubuntu-latest
env:
RUSTC_BOOTSTRAP: 1
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get install libdbus-1-dev
- name: Install grcov
run: curl -L https://github.com/mozilla/grcov/releases/download/v0.8.13/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar -jxf -
- name: Install llvm-tools
run: rustup component add llvm-tools-preview
- name: Build for coverage
run: cargo build --all-features
env:
RUSTFLAGS: "-Zinstrument-coverage"
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov
- name: Run tests with coverage
run: cargo test --all-features
env:
RUSTFLAGS: "-Zinstrument-coverage"
LLVM_PROFILE_FILE: "test-coverage-%p-%m.profraw"
- name: Convert coverage
run: ./grcov . -s . --binary-path target/debug/ -t lcov --branch --ignore-not-existing -o target/debug/lcov.info
run: cargo llvm-cov test --all-features --codecov --output-path codecov-report.json
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v3
with:
directory: ./target/debug
files: codecov-report.json
fail_ci_if_error: true

0 comments on commit 7562b74

Please sign in to comment.