Step into our coding showcase series, where you can elevate your projects, exhibit your coding prowess, and collaborate with like-minded developers.
Talk about features implemented based on user feedback and delve into user-centric development.
Follow the DEVteam for more discussions and online camaraderie!
Top comments (1)
The jacoco-badge-generator GitHub Action was originally just what its name implies: a GitHub Action that parses a JaCoCo coverage report and generates coverage badges.
But based on user submitted feature requests, it can be used for pull request coverage checks to: validate that coverage is above a minimum target percentage, and also to validate that coverage hasn't decreased.
Another user submitted feature request is generating coverage badges for multi-module projects.
Here is more info via the project's webpage and GitHub repository:
jacoco-badge-generator - Coverage badges, and pull request coverage checks, from JaCoCo reports in GitHub Actions
The jacoco-badge-generator GitHub Action parses a jacoco.csv from a JaCoCo coverage report, computes C0 and C1 coverage percentages from JaCoCo's Instructions and Branches counters, and generates badges for one or both of these (configurable with action inputs) to provide an easy to read visual summary of the code coverage of your test cases. The jacoco-badge-generator can also optionally be used as part of a pull-request check, failing workflows if coverage below a threshold or if it decreased.
cicirello / jacoco-badge-generator
Coverage badges, and pull request coverage checks, from JaCoCo reports in GitHub Actions
jacoco-badge-generator
Check out all of our GitHub Actions: actions.cicirello.org/
About
The jacoco-badge-generator can be used in one of two ways: as a GitHub Action or as a command-line utility (e.g., such as part of a local build script). The jacoco-badge-generator parses a
jacoco.csv
from a JaCoCo coverage report, computes coverage percentages from JaCoCo's Instructions and Branches counters, and generates badges for one or both of these (user configurable) to provide an easy to read visual summary of the code coverage of your test cases. The default behavior directly generates the badges internally with no external calls, but the action also provides an option to instead generate Shields JSON endpoints. It supports both the basic case of a singlejacoco.csv
, as well as multi-module projects in which case the action can produce coverage badges from the combination ofβ¦I have several DEV posts about it as well in a series that overview its functionality along with example GitHub workflows explaining how to use it in various scenarios. Here's the first in that series:
JaCoCo coverage badges, PR coverage checks, and PR coverage comments, from GitHub Actions
Vincent A. Cicirello γ» Nov 29 '21