Skip to content

Commit 7562b74

Browse files
authored
Use cargo-llvm-cov rather than grcov. (#220)
1 parent e34bfa6 commit 7562b74

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

.github/workflows/rust.yml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,18 @@ jobs:
2828

2929
coverage:
3030
runs-on: ubuntu-latest
31-
env:
32-
RUSTC_BOOTSTRAP: 1
3331
steps:
3432
- uses: actions/checkout@v4
3533
- name: Install dependencies
3634
run: sudo apt-get install libdbus-1-dev
37-
- name: Install grcov
38-
run: curl -L https://github.com/mozilla/grcov/releases/download/v0.8.13/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar -jxf -
39-
- name: Install llvm-tools
40-
run: rustup component add llvm-tools-preview
41-
- name: Build for coverage
42-
run: cargo build --all-features
43-
env:
44-
RUSTFLAGS: "-Zinstrument-coverage"
35+
- name: Install cargo-llvm-cov
36+
uses: taiki-e/install-action@v2
37+
with:
38+
tool: cargo-llvm-cov
4539
- name: Run tests with coverage
46-
run: cargo test --all-features
47-
env:
48-
RUSTFLAGS: "-Zinstrument-coverage"
49-
LLVM_PROFILE_FILE: "test-coverage-%p-%m.profraw"
50-
- name: Convert coverage
51-
run: ./grcov . -s . --binary-path target/debug/ -t lcov --branch --ignore-not-existing -o target/debug/lcov.info
40+
run: cargo llvm-cov test --all-features --codecov --output-path codecov-report.json
5241
- name: Upload coverage to codecov.io
5342
uses: codecov/codecov-action@v3
5443
with:
55-
directory: ./target/debug
44+
files: codecov-report.json
5645
fail_ci_if_error: true

0 commit comments

Comments
 (0)