Skip to content

Commit

Permalink
Add code coverage to CI
Browse files Browse the repository at this point in the history
Following rust-bitcoin's example, run code coverage in CI with cargo
llvm-cov and upload the results to Coveralls.
  • Loading branch information
spacebear21 committed Nov 11, 2024
1 parent f762fe6 commit a97f177
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,21 @@ jobs:
run: rustup component add clippy --toolchain nightly-x86_64-unknown-linux-gnu
- name: "Run linting"
run: bash contrib/lint.sh

Coverage:
name: Code coverage
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Install toolchain"
# https://github.com/dtolnay/rust-toolchain
uses: dtolnay/rust-toolchain@stable
- name: "Install cargo-llvm-cov"
uses: taiki-e/install-action@cargo-llvm-cov
- name: "Generate code coverage for tests"
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: "Upload report to coveralls"
uses: coverallsapp/github-action@v2

0 comments on commit a97f177

Please sign in to comment.