Skip to content

Code CovReport

Actions
Comments a pull request with the pytest code coverage badge and full report
v1.0.0
LatestPre-release
Star (7)

CovReport

A GitHub action that comments the test coverage report on the pull request.

Usage

To use this action, add the following to your workflow:

uses: itsparser/covreport@v1

You can also pass the following optional inputs to the action:

  • path: The path to the coverage report file.
  • title: The title of the comment.
  • threshold: The minimum coverage percentage.

Example

The following is an example of a workflow that uses the CovReport action:

name: Test Coverage

on:
  pull_request:
  types: [opened, reopened, synchronize, edited]

jobs:
  test:
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/checkout@v2
      - name: Install dependencies
        run: yarn install
      - name: Run tests
        run: yarn test
      - name: Comment test coverage
        uses: itsparser/covreport@v1
        env:
          path: coverage/lcov.info
          title: "Test Coverage"
          threshold: 80

This workflow will run the tests, generate a coverage report, and comment the information on the pull request. The comment will include the overall coverage percentage and the coverage percentage for each file.

Contributing Contributions are welcome! Please open an issue or a pull request if you have any improvement ideas.

License This project is licensed under the MIT License.

I hope this helps!

Code CovReport is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Comments a pull request with the pytest code coverage badge and full report
v1.0.0
LatestPre-release

Code CovReport is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.