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

Need help to understand how to use CodeCoverageSumarry for a badge #228

Open
Erwan-BR opened this issue Oct 20, 2023 · 2 comments
Open

Need help to understand how to use CodeCoverageSumarry for a badge #228

Erwan-BR opened this issue Oct 20, 2023 · 2 comments

Comments

@Erwan-BR
Copy link

Hello,

First of all I'm sorry if I'm not in the right place to ask the question, I don't know where to do it more efficiently.

I'd like to know how I can make it so that when a merge request is accepted, a badge is automatically created with the information that codeCoverage generates.

Here's the link to the yml file I'm using for my project:

Link of my yam

And I noticed (not on this repo, but on another with the same yml), that I do have the bot that generates this comment:

image

I'd really like the badge to automatically appear on the second line of my README.md file when the merge is accepted!

Thanks in advance :)

@ricardoboss
Copy link

ricardoboss commented Dec 14, 2023

A possible solution for this is as follows:

  1. Create an action that runs when a PR is merged, in that you:
  2. Generate the new coverage data
  3. Modify your README using a script
  4. Commit and push the changes

This action currently doesn't support reading the coverage data in GitHub Actions (but I opened a PR to implement this: #233). This means you currently need to include the whole table from above in your README.

Some actions that can help you implement this:

  • Generate a PR comment: thollander/actions-comment-pull-request@v2
  • Add, commit and push changes: EndBug/add-and-commit@v9

Edit: I published a fork of this action that provides the coverage data for GitHub actions to use. You can see how I use it here: https://github.com/ricardoboss/STEP/blob/main/.github/workflows/report.yml

Copy link

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 30 days.

@github-actions github-actions bot added stale and removed stale labels Mar 14, 2024
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

No branches or pull requests

2 participants