All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Bump cicirello/pyaction from 4.23.0 to 4.32.0, including upgrading Python to 3.12 within the Docker container of the action.
- Bump Python to 3.12 in CI/CD workflows when running unit tests.
- Matrix testing for Python versions 3.8 through 3.12 for unit tests.
- Matrix testing the CLI mode for Python versions 3.8 through 3.12.
- Option to customize heading for GitHub Actions workflow job summary
- Bump cicirello/pyaction from 4.22.0 to 4.23.0
- Option to suppress workflow job summary in GitHub Actions Mode (#126).
- Bump cicirello/pyaction from 4.19.0 to 4.22.0
- Support for glob patterns in GitHub Actions mode for specifying multiple JaCoCo reports for multi-module projects (note: CLI mode already supported this indirectly since the shell expands globs automatically).
- Bump cicirello/pyaction from 4.11.1 to 4.19.0, including upgrading Python within the Docker container to 3.11.
- Bump Python to 3.11 in CI/CD workflows.
- The replacement for GitHub Action's deprecated
set-output
is not available yet for all self-hosted users. This patch handles that by using the new$GITHUB_OUTPUT
environment file if it exists, and otherwise falling back toset-output
.
- Bump cicirello/pyaction from 4.11.0 to 4.11.1
- Generate and output a GitHub Actions workflow job summary with the coverage percentages.
- Replaced use of GitHub Action's deprecated
set-output
workflow command.
- Bump cicirello/pyaction from 4.6.0 to 4.11.0, which includes upgrading Python within the Docker container to 3.10.7.
- CLI Mode: Ability to run as a command-line utility outside of GitHub Actions, such as part of a local build script, etc.
- Refactored main control block to improve maintainability (#63).
- Refactored organization of source files (#64).
- Bumped base Docker image cicirello/pyaction from 4.1.0 to 4.6.0.
- Added workflow to automatically publish CLI utility to PyPI on new releases of GitHub Action to GitHub Marketplace.
- Suppressed Python's pycache on imports (fixes Issue #46).
- Option to specify custom labels for the left side of the badges controlled
by the new inputs
coverage-label
andbranches-label
.
- Left-side text width and position calculated rather than hard-coded to width of "coverage" and "branches".
- Changed Dockerfile to pull base image from GitHub Container Registry, assuming within GitHub Actions likely faster to pull from GitHub rather than Docker Hub.
- Repository reorganized to move Python source code to a new src directory.
- Option to generate a simple JSON summary report containing the coverage
and branches coverage values as double-precision floating-point values.
This may be useful as input to other tools. Additionally, if used in
combination with the existing
fail-on-coverage-decrease
and/orfail-on-branches-decrease
features, those checks will be more accurate. This new feature is controlled by a pair of new inputsgenerate-summary
andsummary-filename
. This feature is disabled by default.
- Visual improvements to right side of badges:
- Adjusted calculation of text lengths for right side of badges for improved character spacing.
- Badge width now also adjusted by the right side text lengths.
- Added an option to generate Shields.io JSON endpoints either in addition to,
or instead of, directly generating badges. For most users, the existing direct
generation of the badges is probably the preferred approach (e.g., probably
faster serving when loading README, and much simpler insertion of badge into
README). But for those who use one of Shields styles other than the default,
and who would like to be able to match the coverage badges to the style of
their project's other badges, then providing the ability to generate a
Shields JSON endpoint gives them the ability to do so. The new feature is
controlled by 4 new inputs:
generate-coverage-endpoint
,generate-branches-endpoint
,coverage-endpoint-filename
, andbranches-endpoint-filename
. All of these have default values and are optional. The current default behavior is retained, so by default the JSON endpoints are not generated.
- Customization of badge colors, using two new inputs (
colors
andintervals
). The defaults for the new inputs produce badges with the existing color scheme.
- Improved log messages related to the
fail-on-coverage-decrease
andfail-on-branches-decrease
inputs. - Non-functional changes: Refactoring to improve maintainability.
- Use major release tag when pulling base docker image (e.g., automatically get non-breaking changes to base image, such as bug fixes, etc without need to update Dockerfile).
- Improved documentation of
fail-on-coverage-decrease
andfail-if-coverage-less-than
inputs.
- A new optional input,
fail-if-coverage-less-than
, that enables failing the workflow run if coverage is below a user specified minimum. - A new optional input,
fail-if-branches-less-than
, that enables failing the workflow run if branches coverage is below a user specified minimum. - A new optional input,
fail-on-coverage-decrease
, that enables failing the workflow run if coverage decreased relative to previous run. - A new optional input,
fail-on-branches-decrease
, that enables failing the workflow run if branches coverage decreased relative to previous run.
- Introduced major release tag, and automated tag update upon release.
- Previously, if any jacoco.csv files passed to the action were missing
for any reason (e.g., typo in path or file name in workflow, or otherwise
not generated by previous step of workflow), the action would simply fail
resulting the the workflow run failing. Although in many cases this may be the
desirable behavior, the action now logs the names of any missing jacoco
report files to enable debugging what went wrong in a failed workflow run,
and there is now an input,
on-missing-report
, that allows for specifying the behavior of the action in this case (e.g., user of the action can decide whether the workflow run should fail in this case).
- Added support for multi-module projects: The
jacoco-badge-generator
is now able to generate coverage badges (both instructions and branches) for a multi-module project, computing the coverage percentages from a combination of the data from the separate coverage reports generated by JaCoCo for the sub-projects.
- Updated example workflows to utilize the updated release of actions/setup-java.
- Bumped base docker image to pyaction-lite, v3.13.5.
- Enabled CodeQL code scanning on all push/pull-request events.
- Changed the tag used to pull the base docker image from
latest
to the specific version number that is the latest. The reason for this change is to ensure that we have the opportunity to test against updates to the base image before such changes affect releases. Using thelatest
tag when pulling the base image runs the risk of a change in the base image breaking the action (although this risk is small).
- Fixed a bug related to permissions on the badges directory if it
didn't already exist prior to running the action. Bug only appeared to
exhibit itself if the
jacoco-badge-generator
was used in combination with version 3.6 or later of thepeter-evans/create-pull-request
action, and only if the badges directory didn't already exist. This bug is now resolved.
- If you are upgrading from an earlier version, and if
you were not using the
jacoco-badge-file
input (deprecated since v1.2.0) to change the default location and name of the badge file, then you can simply upgrade to v2.0.0 without need to make any other changes to your workflow file. - If you have been using the deprecated
jacoco-badge-file
input to change the default location and name of the badge file, then you will need to instead use thebadges-directory
and thecoverage-badge-filename
inputs.
- The documentation has been significantly revised to provide more detail on the JaCoCo coverage metrics that are supported by the jacoco-badge-generator.
- Removed the previously deprecated input
jacoco-badge-file
.
- Corrected division by zero error in the case when there are either no instructions (e.g., running tests on an initially empty class) or no branches (e.g., no if statements or switch statements, etc). In such cases, badge generator will now compute 100% coverage (e.g., if there aren't any instructions to cover, your tests must have covered all 0 of the instructions).
- Generation of a branches coverage badge (in addition to the existing overall coverage badge).
- Inputs for finer grained control over the behavior of the action (e.g., for controlling name and locations of generated badges, as well as for controlling which badges are generated). The default values for all of the new inputs are consistent with the behavior of the previous release.
- The
jacoco-badge-file
input is deprecated. In this release it still functions as in prior releases, but it will be removed in the next release. Users of the action should instead use the combination of the new inputsbadges-directory
andcoverage-badge-filename
. This change was made to simplify configuration of badge file names now that the action generates multiple badges.
- An additional action output for the percentage of branches covered. A future release will provide an option to generate an additional badge for this.
- The jacoco-badge-generator GitHub Action parses a
jacoco.csv
from a Jacoco coverage report, computes the coverage percentage, and generates a badge to provide an easy to read visual summary of the code coverage of your test cases. The badge that is generated is inspired by the style (including color palette) of the badges of Shields.io, however, the badge is entirely generated within the jacoco-badge-generator GitHub Action, with no external calls.