jacoco-badge-generator 2.11.0 Released

cicirello

Vincent A. Cicirello

Posted on September 17, 2023

jacoco-badge-generator 2.11.0 Released

TL;DR

I just released jacoco-badge-generator 2.11.0, which can be run as a GitHub Action or as a command-line utility as part of CI/CD workflows for Java projects, as well as for projects in other JVM languages such as Kotlin, to parse JaCoCo test coverage reports, generate instructions coverage and branches coverage badges for project READMEs, serve as pull-request checks (e.g., validate minimum coverage thresholds), among other functionality.

Changelog 2.11.0 - 2023-09-15

Added

  • Option to customize heading for GitHub Actions workflow job summary

Dependencies

  • Bump cicirello/pyaction from 4.22.0 to 4.23.0

Details of New Option

In addition to generating the coverage badges, and optionally performing the coverage PR checks, the jacoco-badge-generator GitHub Action also logs the coverage percentages to the GitHub workflow job summary page, which can be found on the Actions tab of your repository. Prior to this release, the heading of that logged output was simply JaCoCo Test Coverage Summary, and not customizable. In most cases, there is no need to customize this. However, for those running the action multiple times in the same workflow to generate coverage badges for multiple modules, that fixed heading made the workflow job summary difficult to read (e.g., output for all modules began with same heading).

This release adds an action input that can be used to customize the heading. For example, in the multi-module case, you can use the new option to use a different heading for each module. The new input is workflow-summary-heading, and can be used to change the heading from its default with something like: workflow-summary-heading: Module 1 JaCoCo Test Coverage Summary.

More Information

Please consider starring the jacoco-badge-generator's GitHub repository:

GitHub logo cicirello / jacoco-badge-generator

Coverage badges, and pull request coverage checks, from JaCoCo reports in GitHub Actions

jacoco-badge-generator

cicirello/jacoco-badge-generator - Coverage badges, and pull request coverage checks, from JaCoCo reports in GitHub Actions

Check out all of our GitHub Actions: https://actions.cicirello.org/

About

GitHub Actions GitHub release (latest by date) Count of Action Users
Command-Line Utility PyPI PyPI Downloads/month PyPI Downloads/week
Build Status build CodeQL
Security Snyk security score
Source Info License GitHub top language
Support GitHub Sponsors Liberapay Ko-Fi

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 single jacoco.csv, as well as multi-module projects in which case the action can produce coverage badges from the combination of…

For more information, see the project webpage and my earlier posts about the jacoco-badge-generator here on DEV:

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.

favicon actions.cicirello.org

Post with general information and example GitHub Action workflows:

Post about CLI mode:

Post with example multi-module workflows:

Where You Can Find Me

Follow me here on DEV and on GitHub:

Or visit my website:

Vincent A. Cicirello - Professor of Computer Science

Vincent A. Cicirello - Professor of Computer Science at Stockton University - is a researcher in artificial intelligence, evolutionary computation, swarm intelligence, and computational intelligence, with a Ph.D. in Robotics from Carnegie Mellon University. He is an ACM Senior Member, IEEE Senior Member, AAAI Life Member, EAI Distinguished Member, and SIAM Member.

favicon cicirello.org
💖 💪 🙅 🚩
cicirello
Vincent A. Cicirello

Posted on September 17, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related