Skip to content

Commit

Permalink
Use cargo-llvm-cov rather than grcov. (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
qwandor committed Feb 5, 2024
1 parent 8db37c4 commit d2c6d64
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,14 @@ jobs:
RUSTC_BOOTSTRAP: 1
steps:
- uses: actions/checkout@v4
- name: Install grcov
run: curl -L https://github.com/mozilla/grcov/releases/download/v0.8.6/grcov-v0.8.6-x86_64-unknown-linux-gnu.tar.gz | tar zxf -
- 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 d2c6d64

Please sign in to comment.