โ๏ธ parse and publish coverage xml to a PR, enforce coverage rate on new & modified files
Create a new workflow .yml
file in the .github/workflows/
directory.
You can create a coverage report using python:
- pytest
$ pytest --cov-report xml:path/to/coverage.xml
- coverage
$ coverage xml path/to/coverage.xml
name: 'coverage'
on:
pull_request:
branches:
- master
- main
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Get Cover
uses: orgoro/[email protected]
with:
coverageFile: path/to/coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
Input | Optional | Description | Example |
---|---|---|---|
coverageFile |
path to .xml coverage report | ./path/to/coverage.xml | |
token |
your github token | ๐คซ | |
thresholdAll |
โ | the minimal average line coverage | 0.8 |
thresholdNew |
โ | the minimal average new files line coverage | 0.9 |
thresholdModified |
โ | the minimal average modified files line coverage | 0.0 |
passIcon |
โ | the indicator to use for files that passed | ๐ข |
failIcon |
โ | the indicator to use for files that failed | ๐ด |