Skip to content

Commit

Permalink
ci: store HTML coverage report
Browse files Browse the repository at this point in the history
- use grcov over llvmcov for simplicity and ability to reuse results (?)
- upload as artifact and not to codecov.io
  • Loading branch information
ydirson committed Aug 21, 2023
1 parent 91021d4 commit e2f6d5e
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,20 @@ jobs:
- name: Build
run: cargo build --verbose

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --codecov --output-path cov.json

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: cov.json
fail_ci_if_error: true

- name: Run tests
run: cargo test --verbose
run: |
cargo clean
cargo test --verbose
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'

- name: Test coverage report
run: grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage/

- name: Upload test coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-html
path: ./target/debug/coverage/

0 comments on commit e2f6d5e

Please sign in to comment.