GitHub Action to assist the pull request with code coverage stats
- ✅ Code coverage comment for monorepo
- ✅ Code coverage comment for single repo
- ✅ Code coverage diff from base branch
The report is based on the lcov coverage report generated by your test runner.
Usage
Just add this action to one of your workflow files:
- name: Add coverage comment uses: ScaCap/code-coverage-assistant@v1
Action inputs
The possible inputs for this action are:
| Parameter | Description | Default |
|---|---|---|
github-token (Required) |
Github token used for posting the comment. To use the key provided by the GitHub action runner, use ${{ secrets.GITHUB_TOKEN }}. |
|
monorepo-base-path (Optional) |
The location of your monrepo packages path |
|
lcov-file (Optional) |
The location of the lcov file to read the coverage report. Needed only for single repos |
./coverage/lcov.info |
lcov-base (Optional) |
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. Needed only for single repos. |
Examples
Code coverage comment for monorepo
uses: ScaCap/code-coverage-assistant@v1 with: github-token: ${{ secrets.GITHUB_TOKEN }} monorepo-base-path: './packages'
Code coverage comment for single repo
uses: ScaCap/code-coverage-assistant@v1 with: github-token: ${{ secrets.GITHUB_TOKEN }} lcov-file: './app/coverage/lcov.info'
Code coverage comment with diff
⚠️ Note: This config expects a lcov-base.info coverage file for base branch in your .coverage dir
uses: ScaCap/code-coverage-assistant@v1 with: github-token: ${{ secrets.GITHUB_TOKEN }} monorepo-base-path: './packages'
Acknowledgements
The initial code is based on romeovs/lcov-reporter-action.
Thanks to:


