Skip to content

Commit

Permalink
feat(infra): cargo-llvm-cov
Browse files Browse the repository at this point in the history
  • Loading branch information
a-wing committed Nov 23, 2024
1 parent 8684b90 commit 312fedd
Showing 1 changed file with 4 additions and 30 deletions.
34 changes: 4 additions & 30 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,10 @@ jobs:
run: |
ffmpeg -version
ffprobe -version
- name: Rust nightly
run: rustup default nightly
- name: Install grcov
run: cargo install grcov
- name: Run tests
run: cargo test --all --verbose
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: '-Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cdebug-assertions=off -Cprofile-generate=target/debug'

- name: Generate coverage data
run: |
grcov target/debug/ \
--branch \
--llvm \
--source-dir . \
--output-path lcov.info \
--ignore='/**' \
--ignore='C:/**' \
--ignore='../**' \
--ignore-not-existing \
--excl-line "#\\[derive\\(" \
--excl-br-line "#\\[derive\\(" \
--excl-start "#\\[cfg\\(test\\)\\]" \
--excl-br-start "#\\[cfg\\(test\\)\\]" \
--commit-sha ${{ github.sha }} \
--service-job-id ${{ github.job }} \
--service-name "GitHub Actions" \
--service-number ${{ github.run_id }}
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all --all-features --lcov --output-path lcov.info
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v4
with:
Expand Down

0 comments on commit 312fedd

Please sign in to comment.