Publish diff coverage report as PR comment, and create a coverage badge to display on the readme.
Overview
The GitHub Action: Coverage Diff is a powerful tool designed for developers who want to improve and maintain their code coverage metrics effectively. By analyzing the coverage summary report generated by popular coverage tools, it helps teams visualize the impact of their changes on code coverage directly within pull requests. This not only fosters accountability in code contributions but also allows developers to keep a close eye on the health of their codebase.
This action operates seamlessly in two modes: one for pull requests and another for the repository’s default branch. It provides a straightforward way to track coverage improvements or declines, and creates badges for easy display on the repository’s readme. For teams invested in continuous integration and delivery, integrating this action can enhance the overall development workflow.
Features
- PR Mode: Analyzes the json-summary report file for pull requests and generates a diff coverage report, publishing details as a comment on the PR.
- Default Branch Mode: Extracts global threshold data from the default branch (often master or main) to create a badge JSON file for tracking overall coverage.
- Badge Creation: Automatically generates a stable URL for the badge JSON file, allowing integration with shields.io to showcase coverage status.
- Automatic Comment Updates: If a previous coverage comment exists on a PR, it gets updated with new data, ensuring that reviewers always see the latest coverage insights.
- Integration Ready: Works with coverage report files generated by various coverage tools that are already integrated into the GitHub workflow.
- Easy Setup: Simple initialization process that requires the repository wiki to be set up at least once, making it user-friendly for teams.
- Community Involvement: Encourages feedback and contributions to continuously enhance the action, fostering an open-source community feel.