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

coverage.py badge

v1.6

coverage.py badge

check-circle

coverage.py badge

Generate a coverage.py badge

Installation

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

              

- name: coverage.py badge

uses: tj-actions/coverage-badge-py@v1.6

Learn more about this action in tj-actions/coverage-badge-py

Choose a version

CI Update release version.

coverage-badge-py

Generate coverage.py badge like this coverage badge without uploading results to a 3rd party site.

Usage:

...
    steps:
      - uses: actions/checkout@v2
      - name: Coverage Badge
        uses: tj-actions/coverage-badge-py@v1.2

NOTE: ⚠️

  • It's important that you run this action from the directory where the .coverage data file is located.

Inputs

Input type required default description
output string true coverage.svg The output path for
the generated coverage badge.
overwrite string true 'true' Boolean string used to
determine wheter to overwrite
an existing badge.

Example

...
    steps:
      - uses: actions/checkout@v2
        with: 
          fetch-depth: 0
      - name: Coverage Badge
        uses: tj-actions/coverage-badge-py@v1.2
      - name: Verify Changed files
        uses: tj-actions/verify-changed-files@v6
        id: changed_files
        with:
          files: coverage.svg

      - name: Commit files
        if: steps.changed_files.outputs.files_changed == 'true'
        run: |
          git config --local user.email "github-actions[bot]@users.noreply.github.com"
          git config --local user.name "github-actions[bot]"
          git add coverage.svg
          git commit -m "Updated coverage.svg"

      - name: Push changes
        if: steps.changed_files.outputs.files_changed == 'true'
        uses: ad-m/github-push-action@master
        with:
          github_token: ${{ secrets.github_token }}
          branch: ${{ github.ref }}

Credits

This package was created with Cookiecutter.

Report Bugs

Report bugs at https://github.com/tj-actions/coverage-badge-py/issues.

If you are reporting a bug, please include:

  • Your operating system name and version.
  • Any details about your workflow that might be helpful in troubleshooting.
  • Detailed steps to reproduce the bug.