Skip to content

Commit

Permalink
Add coverage support (fixes #5)
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Jan 19, 2024
1 parent 3698853 commit f074b70
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/actions-rs/grcov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
output-type: lcov
output-file: ./lcov.info
29 changes: 22 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,31 @@ jobs:
- { rust: stable }
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Build
run: cargo build
- name: Test
run: cargo test
# if: ${{ contains(matrix.features, 'coverage') }}
# uses: codecov/codecov-action@v3
# with:
# fail_ci_if_error: true
# gcov: true

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- name: Test
run: cargo test
env:
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: Collect coverage
uses: actions-rs/[email protected]
- name: Submit coverage
uses: codecov/codecov-action@v4-beta
with:
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit f074b70

Please sign in to comment.