Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check-circle

GitHub Action

jacoco-reporter

v2.3

jacoco-reporter

check-circle

jacoco-reporter

Publishes JaCoCo format Coverage Report in GitHub Actions as Checksuite and enforces Code Coverage Quality Gate.

Installation

Copy and paste the following snippet into your .yml file.

              

- name: jacoco-reporter

uses: PavanMudigonda/[email protected]

Learn more about this action in PavanMudigonda/jacoco-reporter

Choose a version

JaCoCo Code Coverage Reporter

GitHub Action to Publish JaCoCo Format Code Coverage XML and attach it to the Workflow Run as a Check Run. You can even set threshold coverage percentage and fail the action.

Note:- The scope of this project is limited to Report and Quality Gate. Any ideas are welcome.

If you like my Github Action, please STAR ⭐ it.

Samples

This Action allows you to specify your JaCoCo Code Coverage XML Path, and then generate a markdown report from the test results and then it attaches it to the Workflow Run as a Check Run. You can even set threshold coverage percentage and fail the action.

Here's a quick example of how to use this action in your own GitHub Workflows.

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: JaCoCo Code Coverage Report
        id: jacoco_reporter
        uses: PavanMudigonda/[email protected]
        with:
          coverage_results_path: jacoco-report/test.xml
          coverage_report_name: Code Coverage Report
          coverage_report_title: JaCoCo
          github_token: ${{ secrets.GITHUB_TOKEN }}
          skip_check_run: false
          minimum_coverage: 80
          fail_below_threshold: true

Inputs

This Action defines the following formal inputs.

Name Req Description
coverage_results_path true Path to the JaCoCo Code Coverage XML format file which will be used to generate a report.
coverage_report_name false The name of the code coverage report object that will be attached to the Workflow Run. Defaults to the name COVERAGE_RESULTS_<datetime> where <datetime> is in the form yyyyMMdd_hhmmss.
coverage_report_title false The title of the code coverage report that will be embedded in the report itself, which defaults to the same as the coverage_report_name input.
github_token true Input the GITHUB TOKEN Or Personal Access Token you would like to use. Recommended to use GitHub auto generated token ${{ secrets.GITHUB_TOKEN }}
minimum_coverage false Input the minimum code coverage recommended.
fail_below_threshold false Set True to fail the action and False to let it pass.

Sample Screenshot

Sample2

PowerShell GitHub Action

This Action is implemented as a PowerShell GitHub Action.