Skip to content

ahjephson/cobertura-action

 
 

Repository files navigation

Cobertura action

GitHub Action which parse a XML cobertura report and display the metrics in a GitHub Pull Request.

Many coverage tools can be configured to output cobertura reports:

Note that this action can only run on pull requests being opened from the same repository. This action will not currently work for pull requests from forks -- like is common in open source projects -- because the token for forked pull request workflows does not have write permissions. Hopefully GitHub will have a solution for this in the future.

How it looks like

alt text

Inputs

repo_token Required

The GITHUB_TOKEN. See details.

path

The to the cobertura report. Defaults to coverage.xml.

skip_covered

If files with 100% coverage should be ignored. Defaults to true.

minimum_coverage

The minimum allowed coverage percentage as an integer.

show_line

Show line rate as specific column.

show_branch

Show branch rate as specific column.

show_class_names

Show class names instead of file names.

only_changed_files

Only show coverage for changed files.

Example usage

on:
  pull_request:
    types: [opened]
    branches:
      - master
jobs:
  coverage:
    runs-on: ubuntu-latest
    steps:
      - uses: 5monkeys/cobertura-action@master
        with:
          path: src/test.xml
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          minimum_coverage: 75

About

GitHub Action to report cobertura coverage

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%