A GitHub Action that reads Clover format code coverage files from your test suite and outputs a markdown summary. This summary can be posted as a Pull Request comment or included in Release Notes by other actions to give you an immediate insight into the health of your code without using a third-party site. Code Coverage Summary is designed for use with any test framework that outputs coverage in Clover XML format. The action has a build in feature to group coverage by package. This currently works with composer.json only.
Required
A path to the code coverage file to analyse. Also supports using glob patterns to match multiple files. If there are any spaces in a path or filename this value must be in quotes.
Code Coverage | |||||||
---|---|---|---|---|---|---|---|
Package | Lines | Functions | Classes | Health | |||
nxdummy | 96% | 26/27 | 83% | 5/6 | 93% | 31/33 | ✅ |
Summary | 96% | 26/27 | 83% | 5/6 | 93% | 31/33 | ✅ |
Code Coverage details
Code Coverage | |||||||
---|---|---|---|---|---|---|---|
Class | Lines | Functions | Classes | Health | |||
nxdummy | |||||||
Netlogix\Nxdummy\Exception\OptionNotFoundException | NaN% | 0/0 | NaN% | 0/0 | NaN% | 0/0 | ❌ |
Netlogix\Nxdummy\Options\MiddlewareOptions | 90% | 10/11 | 66% | 2/3 | 85% | 12/14 | ✅ |
Netlogix\Nxdummy\Utility\UriUtility | 100% | 16/16 | 100% | 3/3 | 100% | 19/19 | 🚀 |
Summary | 96% | 26/27 | 83% | 5/6 | 93% | 31/33 | ✅ |
name: Code Coverage Summary Report
uses: saschanowak/[email protected]
with:
filename: clover.xml
Add the following to your workflow to include the summary in the job summary:
name: 'Add Code Coverage to Job Summary'
run: |
cat code-coverage-summary.md >> $GITHUB_STEP_SUMMARY
cat code-coverage-details.md >> $GITHUB_STEP_SUMMARY
Add the following to your workflow to post the summary as a Pull Request comment:
name: 'Add Code Coverage Summary as PR Comment'
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-summary.md
Version numbers will be assigned according to the Semantic Versioning scheme. This means, given a version number MAJOR.MINOR.PATCH, we will increment the:
- MAJOR version when we make incompatible API changes
- MINOR version when we add functionality in a backwards compatible manner
- PATCH version when we make backwards compatible bug fixes
Please make sure the bug is not already reported by searching existing issues.
If you're unable to find an existing issue addressing the problem please open a new one. Be sure to include a title and clear description, as much relevant information as possible, a workflow sample and any logs demonstrating the problem.
Please open a new issue.
Discuss your idea first, so that your changes have a good chance of being merged in.
Submit your pull request against the main
branch.
Pull requests that include documentation and relevant updates to README.md are merged faster, because you won't have to wait for somebody else to complete your contribution.
Code Coverage Summary is available under the MIT license, see the LICENSE file for more info.