Skip to content

Commit

Permalink
add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
flexatone committed Mar 17, 2024
1 parent 54a2a99 commit a2e0bae
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,56 @@ jobs:
- name: Run tests
run: cargo test --verbose

#-----------------------------------------------------------------------------
coverage:
name: Coverage
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Rust
run: |
rustup install --no-self-update nightly && rustup default nightly
rustup component add llvm-tools-preview
- name: Configure cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry
target/
key: coverage-${{ hashFiles('**/Cargo.lock') }}

- name: Conditionally install grcov
run: |
if ! command -v grcov &> /dev/null
then
cargo install grcov
fi
- name: Build
env:
RUSTFLAGS: -Cinstrument-coverage
run: cargo build

- name: Test
env:
LLVM_PROFILE_FILE: grcov-%p-%m.profraw
RUSTFLAGS: -Cinstrument-coverage
run: cargo test

- name: Generate coverage
run: |
grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing --excl-line cov-excl-line -o coverage.lcov
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: abf0edb1-8bfc-4fd7-97a7-cef513975eae
files: coverage.lcov
slug: flexatone/xensieve-py

#-----------------------------------------------------------------------------
sdist:
Expand Down

0 comments on commit a2e0bae

Please sign in to comment.