Skip to content

Add code coverage to CI with Coveralls integration#385

Merged
spacebear21 merged 5 commits intopayjoin:masterfrom
spacebear21:code-coverage-ci
Nov 12, 2024
Merged

Add code coverage to CI with Coveralls integration#385
spacebear21 merged 5 commits intopayjoin:masterfrom
spacebear21:code-coverage-ci

Conversation

@spacebear21
Copy link
Collaborator

This brings the github actions up-to-date with latest versions and adds more descriptive names to the workflow steps.

It also swaps the ordering of rust-cache and the rust toolchain installation steps so that cache actually works.

Finally, a new CI step adds code coverage measurements using cargo-llvm and uploads the results to Coveralls.

Upgrade github checkout and rust-cache actions to latest versions and
add names to each step where missing. Also move rust-cache step to
happen after the toolchain is installed, as recommended by
https://github.com/Swatinem/rust-cache?tab=readme-ov-file#example-usage.
actions-rs is no longer maintained and rust-bitcoin
is using dtolnay/rust-toolchain in their CI.
Following rust-bitcoin's example, run code coverage in CI with cargo
llvm-cov and upload the results to Coveralls.
@spacebear21
Copy link
Collaborator Author

Coverage report for this PR can be found here: https://coveralls.io/jobs/155930549.

@spacebear21
Copy link
Collaborator Author

It may be useful to enable coveralls PR comments if we feel comfortable with giving their bot write access to the repo. FWIW rust-bitcoin does this.

@spacebear21 spacebear21 requested a review from DanGould November 11, 2024 23:42
Copy link
Contributor

@DanGould DanGould left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing this seems to be missing is the edit of the README to say

  • Coverage measurement

Did you check that cache hits are occurring as expected with this new form? I must admit I have never checked before.

@spacebear21
Copy link
Collaborator Author

Did you check that cache hits are occurring as expected with this new form? I must admit I have never checked before.

I did and they do! You can see that it restores the cache in the "Use Cache" step and that the dependencies are fresh instead of re-downloaded/re-compiled: https://github.com/payjoin/rust-payjoin/actions/runs/11791047279/job/32842477162?pr=385.

@spacebear21 spacebear21 merged commit 153e6ac into payjoin:master Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants