Skip to content

Commit

Permalink
test: add coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyscot committed Jan 16, 2025
1 parent 43cfbd3 commit abac087
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
Expand All @@ -102,7 +103,17 @@ jobs:
run: scripts/install-ubuntu-packages
# Checks begin here!
- run: cargo fmt --all --check
- run: cargo test --locked
#- run: cargo test --locked # replaced by cargo llvm-cov to run with coverage tests
- run: cargo clippy --locked --all-targets
- run: cargo build --locked --all-targets
- run: cargo doc --no-deps --locked
- name: unit tests with coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info --locked
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
path: lcov.info
- name: Send to coveralls
uses: coverallsapp/github-action@v2.3.4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ If you're thinking of contributing something non-trivial, it might be best to ra
* Changes should normally be based on the `dev` branch. _(Exception: hotfixes may be branched against `main`.)_
* PRs must pass the full set of CI checks (see below). No exceptions.
* Unit tests are encouraged, particularly those which fail before and pass after a fix.
* The CI workflow runs code coverage analysis.
* Refactoring for its own sake is OK if driven by a feature or bugfix.
* Clean commit histories are preferred, but don't be discouraged if you don't know how to do this. git can be a tricky tool.
* Commit messages should follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
Expand All @@ -32,6 +33,7 @@ If you're thinking of contributing something non-trivial, it might be best to ra
| Unit tests pass | `cargo test` |
| Lints | `cargo clippy --all-targets` | This is a reasonably pedantic set of lints, which I make no apologies for |
| Docs build | `cargo doc --no-deps` |
| Code coverage | `./scripts/coverage`, then examine `target/coverage/html` |


[issue]: https://github.com/crazyscot/qcp/issues/new/choose
Expand Down

0 comments on commit abac087

Please sign in to comment.