Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xtask: Add action to generate a code coverage report #1423

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nicholasbishop
Copy link
Contributor

This uses llvm-cov (https://github.com/taiki-e/cargo-llvm-cov) to create a simple HTML code coverage report.

For now this only includes coverage from host tests, but in the future we can use https://github.com/Amanieu/minicov to include coverage from VM tests as well.

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See the Rewriting History guide for help.
  • Update the changelog (if necessary)

Copy link
Contributor

@phip1611 phip1611 left a comment

Choose a reason for hiding this comment

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

LGTM! Do we want to add an CI step and upload the html file as job artifact?

@nicholasbishop
Copy link
Contributor Author

nicholasbishop commented Oct 7, 2024

I was thinking of using one of the free-for-open-source platforms such as codecov.io or coveralls.io. I've used both, for example https://app.codecov.io/gh/nicholasbishop/ext4-view-rs and https://coveralls.io/github/google/sbat-rs.

I've occasionally looked at doing some within-github-actions implementation that just stores the HTML files, but I've never found a particulary straightforward and easy way to do that, whereas uploading to one of the above websites is quite simple.

This uses llvm-cov (https://github.com/taiki-e/cargo-llvm-cov) to create a
simple HTML code coverage report.

For now this only includes coverage from host tests, but in the future we can
use https://github.com/Amanieu/minicov to include coverage from VM tests as
well.
This will be used to provide raw coverage data for the CI job.
@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@nicholasbishop
Copy link
Contributor Author

Added a couple commits: add a --lcov switch to generate a raw report, and add a CI job to upload to code coverage (see for example https://app.codecov.io/github/rust-osdev/uefi-rs/pull/1423/blob/uefi/src/data_types/chars.rs#L64)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants