Coveralls is a web service that tracks code coverage over time for GitHub projects. Coveralls requires CircleCI to be set up beforehand as CircleCI sends the coverage report from the latest build to Coveralls. If you have not set up CircleCI, see UsingCircleCI.adoc. Note that Coveralls also supports Travis CI and AppVeyor.
Setting up Coveralls
-
Go to https://coveralls.io/ and click
SIGN IN
. Then clickGITHUB SIGN IN
and enter your GitHub account details if needed. -
After logging in, you will be brought to the
Your Repositories
page. On the site’s navigation bar, click ADD REPOS. -
Find the switch for the forked repository.
-
If the organization is not shown, click
GITHUB SETTINGS
as shown below:This should bring you to a GitHub page that manages the access of third-party applications. Depending on whether you are the owner of the repository, you can either grant access
or request access
to Coveralls so that it can access your repository.
-
If your repository cannot be found, click
SYNC REPOS
.
-
-
Activate the switch.
-
Click on
DETAILS
, and copy theTOKEN
found on the next page. -
Go to your CircleCI Dashboard and click on the cog beside your repository.
-
Select the
Environment Variables
tab. -
Then, click on
Add Variable
found on the right side. -
In the dialog box, enter
COVERALLS_REPO_TOKEN
in theName
textbox, and paste your Coveralls token in theValue
textbox. Then click onAdd Variable
. -
Update the link of the
Coverage Status
badge at the top of your README.adoc to point to that of your own repo by replacing the<username>
with your GitHub username (or GitHub organization, if your repository belongs to one) and<repo>
with your repository name.https://coveralls.io/github/<username>/<repo>?branch=master[image:https://coveralls.io/repos/github/<username>/<repo>/badge.svg?branch=master[Coverage Status]]
-
For a more consistent styling, you can also use the badges from Shields.io.
https://coveralls.io/github/<username>/<repo>?branch=master[image:https://img.shields.io/coveralls/github/<username>/<repo>.svg[Coverage Status]]
-
-
You can now see the coverage report for your project after each CircleCI build by clicking on the
Coverage Status
badge.
Disabling Coveralls Automatic Comments on Pull Requests
Coveralls automatically comments on the coverage status of the pull requests in GitHub. If it’s a hindrance, you can disable it in the settings of your project in Coveralls:
-
Click
Settings
. -
Uncheck the
LEAVE COMMENTS?
checkbox. Then clickSAVE CHANGES
.