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

Generate and publish code coverage reports in the CI #750

Merged
merged 5 commits into from
Jun 5, 2024

Conversation

Dentosal
Copy link
Member

@Dentosal Dentosal commented Jun 5, 2024

Closes #745

This PR sets up code coverage reporting. It commits the report to a branch called codecov-pages, which contains a folder for each branch. Branch names are urlsafe-base64-encoded to avoid (security) bugs. Every time a PR workflow runs or the master receives new commits, a CI action pushes updated codecov report there.

The testing for this feature is done in https://github.com/Dentosal/test-repo, and ported here.

Possible improvements:

  • Clean up deleted branches automatically
  • Generate index.html that contains link to all branches
  • Replace my personal name and email from the commit message with something like org-owned bot

Repository setup

The configuration has to be done by someone who has permission to edit the repo settings: set deployment from codecov-pages branch, like this:
Screenshot of the settings page

@Dentosal Dentosal added the no changelog Skips the CI changelog check label Jun 5, 2024
@Dentosal Dentosal self-assigned this Jun 5, 2024
@Dentosal Dentosal force-pushed the dento/ci-codecov-reporting branch from d3cf6c5 to 8ac5109 Compare June 5, 2024 05:48
@Dentosal Dentosal marked this pull request as ready for review June 5, 2024 06:02
@Dentosal Dentosal requested a review from a team June 5, 2024 06:10
@xgreenx
Copy link
Collaborator

xgreenx commented Jun 5, 2024

Thank you, it works!=)
image

@Dentosal Dentosal added this pull request to the merge queue Jun 5, 2024
Merged via the queue into master with commit 735a302 Jun 5, 2024
39 checks passed
@Dentosal Dentosal deleted the dento/ci-codecov-reporting branch June 5, 2024 17:22
Dentosal added a commit to FuelLabs/fuel-core that referenced this pull request Jun 17, 2024
Fuel-core counterpart for FuelLabs/fuel-vm#750

This PR sets up code coverage reporting. It commits the report to [a
branch called
`codecov-pages`](https://github.com/FuelLabs/fuel-core/tree/codecov-pages),
which contains a folder for each branch. Branch names are
urlsafe-base64-encoded to avoid (security) bugs. Every time a PR
workflow runs or the `master` receives new commits, a CI action pushes
updated codecov report there.

## Repository setup

The configuration has to be done by someone who has permission to edit
[the repo
settings](https://github.com/FuelLabs/fuel-core/settings/pages): set
deployment from `codecov-pages` branch, like this:
<img width="510" alt="Screenshot of the settings page"
src="https://github.com/FuelLabs/fuel-vm/assets/2204863/e22d5c43-825d-4fd2-b5e1-0a2c3e826ce8">

---------

Co-authored-by: Mitchell Turner <james.mitchell.turner@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Skips the CI changelog check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add test coverage report
2 participants