Download the PHP package brianhenryie/php-codecoverage-markdown without Composer
On this page you can find all versions of the php package brianhenryie/php-codecoverage-markdown. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download brianhenryie/php-codecoverage-markdown
More information about brianhenryie/php-codecoverage-markdown
Files in brianhenryie/php-codecoverage-markdown
Package php-codecoverage-markdown
Short Description Generate markdown coverage reports from PHPUnit code coverage data for GitHub PR comments
License MIT
Informations about the package php-codecoverage-markdown
PHP Code Coverage Markdown Report Printer
Generate Markdown coverage reports from PHPUnit code coverage data, for GitHub PR comments.
Features
- 📊 Convert PHPUnit
.covcoverage files to Markdown - 🔗 Link files to GitHub blob URLs
- 📝 Filter reports to specific files
- 🎨 Visual coverage bars using emojis (🟩🟧🟥⬜)
The Markdown report includes:
- Total coverage summary
- Per-file coverage details with:
- Lines coverage percentage
- Visual coverage bar
- Methods coverage
- Classes coverage
- Clickable source/HTML report links, set with
--base-url
Options
Primary input: coverage file in PHP format from phpunit/php-code-coverage:^9|^10|^11|^12, i.e. phpunit --coverage-php coveragephp.cov.
| Option | Short | Description |
|---|---|---|
--input-file |
-i |
Path to PHPUnit .cov coverage file (required) |
--output-file |
-o |
Output file path (default: stdout) |
--base-url |
-b |
Base URL for source file links (use %s as relative path placeholder) |
--covered-files |
-c |
Comma-separated list of files to include (i.e. the files in the PR) |
Limitation
GitHub Actions permissions limit new comments to users with write access to the repo. I.e. this works great for teams using private repos and works ok for PRs on public repos. There is a workaround at mshick/add-pr-comment-proxy which runs on Google Cloud.
Installation
Usage
CLI
Generate a Markdown report from a PHPUnit coverage file:
With GitHub links:
Filter to specific files:
GitHub Actions
Use this to post coverage reports as PR comments:
Programmatic
Status
- Ironically, this project's tests pass locally but fail in GitHub Actions! I'll tag 1.0 when I figure that out
- This should be spun into its own GitHub Action so it is not a dependency in a project
See Also
All versions of php-codecoverage-markdown with dependencies
phpunit/php-code-coverage Version ^9|^10|^11|^12
phpunit/php-text-template Version ^2.0|^3.0|^4.0
symfony/console Version ^5|^6|^7