Skip to content
umbrella

GitHub Action

Clover to ShieldsIO endpoint JSON

v1.0.2 Latest version

Clover to ShieldsIO endpoint JSON

umbrella

Clover to ShieldsIO endpoint JSON

Generates a ShieldsIO endpoint compatible JSON file containing the code coverage from a clover.xml

Installation

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

              

- name: Clover to ShieldsIO endpoint JSON

uses: steffendietz/clover-to-shieldsio-json-action@v1.0.2

Learn more about this action in steffendietz/clover-to-shieldsio-json-action

Choose a version

Clover to ShieldsIO JSON Action

This action uses the metrics of a clover.xml to calculate a code-coverage percentage and generates a JSON file for ShieldsIOs enpdoint badges.

The resulting JSON file could be deployed to a custom server or probably to GitHub Pages using the Deploy to GitHub Pages action.

The badge generated based on the resulting JSON file could look something like this:

Example Badge

Example usage

- name: "Coverage processing"
  uses: steffendietz/clover-to-shieldsio-json-action@v1.0
  with:
    path-to-clover: "clover.xml"
    path-to-json: "build/shieldsio-coverage.json"
    style: "flat-square"

Inputs

path-to-clover

required

Relative path from repository root to clover.xml. Defaults to: clover.xml

path-to-json

required

Relative path from repository root where ShieldsIO endpoint JSON is created. Defaults to: shieldsio.json

label-text

The left text of the badge; empty to omit left side. Defaults to: coverage

style

The badge style. Defaults to: flat

bad-threshold

Below this coverage percent, the color will be bad-color. Defaults to: 50

average-threshold

Below this coverage percent, the color will be average-color. Defaults to: 75

above-average-threshold

Below this coverage percent, the color will be above-average-color. Defaults to: 95

bad-color

The color used for bad code coverage. Defaults to: red

average-color

The color used for average code coverage. Defaults to: yellow

above-average-color

The color used for above average code coverage. Defaults to: green

good-color

The color used for good code coverage. Defaults to: brightgreen