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

  1. Go to https://coveralls.io/ and click SIGN IN. Then click GITHUB SIGN IN and enter your GitHub account details if needed.

  2. After logging in, you will be brought to the Your Repositories page. On the site’s navigation bar, click ADD REPOS.

  3. Find the switch for the forked repository.

    • If the organization is not shown, click GITHUB SETTINGS as shown below:

      GitHub settings

      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

      Grant Access

      or request access

      Request Access

      to Coveralls so that it can access your repository.

    • If your repository cannot be found, click SYNC REPOS.

      Sync repos

  4. Activate the switch.

    Activate the switch

  5. Click on DETAILS, and copy the TOKEN found on the next page.

    Coveralls token

  6. Go to your CircleCI Dashboard and click on the cog beside your repository.

    Project settings

  7. Select the Environment Variables tab.

    Environment variables

  8. Then, click on Add Variable found on the right side.

    Add variable

  9. In the dialog box, enter COVERALLS_REPO_TOKEN in the Name textbox, and paste your Coveralls token in the Value textbox. Then click on Add Variable.

    Add variable dialog

  10. 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]]
  11. You can now see the coverage report for your project after each CircleCI build by clicking on the Coverage Status badge.

    Coverage Report Summary

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:

  1. Click Settings.

  2. Uncheck the LEAVE COMMENTS? checkbox. Then click SAVE CHANGES.

    Disable comments