Skip to content

Commit

Permalink
Use llvm-cov for coverage reports
Browse files Browse the repository at this point in the history
  • Loading branch information
msk committed May 22, 2024
1 parent 44ef967 commit 9b90798
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,13 @@ jobs:
with:
toolchain: ${{ matrix.rust }}
- uses: actions/checkout@v4
- name: Install Tarpaulin
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
run: cargo install cargo-tarpaulin
- name: Run tests on macOS
if: matrix.os == 'macOS-latest'
run: |
cargo test --verbose --features "serialization"
- name: Run tests
if: matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest'
run: cargo test --verbose --features "intel-mkl-static, serialization"
- name: Generate coverage report
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
run: cargo tarpaulin --out Xml --features "intel-mkl-static, serialization"
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
uses: codecov/codecov-action@v3

check:
runs-on: ubuntu-latest
Expand All @@ -45,3 +36,23 @@ jobs:
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy -- -D warnings -W clippy::pedantic

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: lcov.info
fail_ci_if_error: true

0 comments on commit 9b90798

Please sign in to comment.