A GitHub action that adds a comment on PR that has the code coverage report
Note that this action will not execute any tests, it reads lcov coverage report generated by your test runner.
Total Coverage | 39.86% |
---|
Coverage Report
File | Branches | Funcs | Lines | |
---|---|---|---|---|
src | ||||
index.js | 17.48% | 49.29% | 28.51% | |
src/lib | ||||
file1.js | 74.19% | 49.30% | 35.82% | |
file2.js | 43.17% | 20.48% | 8.47% | |
file3.js | 85.71% | 88.89% | 83.19% | |
src/components | ||||
main.js | 62.64% | 68.39% | 20.73% | |
src/services | ||||
service1.js | 30.74% | 51.84% | 6.93% |
Github token used for posting the comment. To use the key provided by the GitHub
action runner, use ${{ secrets.GITHUB_TOKEN }}
.
The location of the lcov file to read the coverage report from. Defaults to
./coverage/lcov.info
.
The location of the lcov file resulting from running the tests in the base branch. When this is set a diff of the coverage percentages is shown.
name: 'PR Code Coverage Report Action'
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
task-check:
runs-on: ubuntu-latest
steps:
- uses: venkatsarvesh/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
The initial code is based on ziishaned/jest-reporter-action.
MIT