If you think to make an open source project, Travis CI is a good choice for the continuous integration. It is well known and documented. Moreover, there is no charge for open source projects :). With the continuous integration, you can check easily whether your build is broken or not after you submit a commit or merge a pull request. This is a good and I think having a test coverage is much better. It can show that you care about the code quality well for others. Coveralls supports a test coverage history and statistics. This is also free for open source projects. So, using both is a wonderful combination for open source projects.

The way to integrate both depends on your project tools. I’m using Gradle actively in these days so I’ve checked how to do it with Gradle. Gradle has plugins which are reusable pieces of build logic. I find this plugin, coveralls-gradle-plugin.

With this plugin, it is quite easy to integrate. You need add that plugin and set xml.enabled as true which is needed for Coveralls.

build.gradle

plugins {
    id 'jacoco'
    id 'com.github.kt3k.coveralls' version '2.6.3'
}

jacocoTestReport {
    reports {
        xml.enabled = true // coveralls plugin depends on xml format report
        html.enabled = true
    }
}

Then, set below to call jacocoTestport and coveralls tasks in Travis.

.travis.yml

after_success:
- ./gradlew test jacocoTestReport coveralls

That’s it. Once Travis runs, you can see new build request in Coveralls.

When you add your repository into Coveralls, you can see something about repo_token. I think this is not clear enough. You don’t need to do anything if your project is an open source project. Everything will work well in Travis. However, If you run the coveralls task in your local machine instead of Travis, set an environment variable like this.

export COVERALLS_REPO_TOKEN=<REPO_TOKEN>

References