Badges in your project’s readme can be a great way to give viewers a quick high-level look at some of your project’s key stats.
You can display the code coverage percentage for your project directly on your project’s readme page with Projektor.
The Markdown code to display the badge is available in a couple places in Projektor. Click on the copy icon to copy the Markdown code to your clipboard to paste into your project’s readme.
On a test report page:
And on the coverage page for the repository:
Then paste the copied Markdown code into your project’s Markdown readme file.
Projektor uses the coverage from most recent mainline branch when displaying the code coverage badge so it only includes reviewed / merged code instead of code from pull request branches.
By default, Projektor considers “main” and “master” as mainline branches, but that can be configured
if a specific repo uses different branch(es) for the mainline branch (such as “develop”).
See the gitMainBranchNames
config param in the Gradle plugin or Node script docs.
You can also display a badge showing whether the latest test run is passing or failing directly on your project’s readme page.
And you can copy the Markdown code to your clipboard for the test run badge in two places in Projektor. Click on the copy icon to copy the Markdown code to your clipboard to paste into your project’s readme.
On a test report page:
And on the test duration timeline page for the repository:
Then paste the copied Markdown code into your project’s Markdown readme file.