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

GitHub Action

Python Coverage

v1

Python Coverage

umbrella

Python Coverage

Publish coverage report to a PR & enforce coverage on new & modified files

Installation

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

              

- name: Python Coverage

uses: orgoro/coverage@v1

Learn more about this action in orgoro/coverage

Choose a version

Python Cov: Python Coverage Reporter GitHub Action

🐍 parse and publish coverage xml to a PR, enforce coverage rate on new & modified files

Usage

Create a new workflow .yml file in the .github/workflows/ directory.

You can create a coverage report using $ pytest --cov-report xml:path/to/coverage.xml

Minimal Configuration

name: 'coverage'
on:
    pull_request:
        branches:
            - master
            - main
jobs:
    coverage:
        runs-on: ubuntu-latest
        steps:
          - name: Python Cov 
            uses: orgoro/coverage/v1
            with:
                coverageFile: path/to/coverage.xml
                token: ${{ secrets.GITHUB_TOKEN }}

PR Message

message

Inputs

Input Optional Description Example
coverageFile path to python .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