👨🔧 gradle plugin for coveralls
Send coverage data to coveralls.io.
Add the following lines to build.gradle:
plugins {
id 'net.saliman.cobertura' version '4.0.0'
id 'com.github.kt3k.coveralls' version '2.12.2'
}
cobertura.coverageFormats = ['html', 'xml'] // coveralls plugin depends on xml format report
And run coveralls
task after cobertura
task.
An example .travis.yml
looks like following:
language: java
jdk:
- oraclejdk11
after_success:
- ./gradlew cobertura coveralls
For groovy projects, add the following line to build.gradle:
cobertura.coverageSourceDirs = sourceSets.main.groovy.srcDirs
Add the following lines to build.gradle:
plugins {
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.12.2'
}
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}
An example .travis.yml
looks like following:
language: java
jdk:
- oraclejdk11
after_success:
- ./gradlew jacocoTestReport coveralls
Configuration Options
coveralls {
jacocoReportPath 'build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml'
}
Add the following lines to build.gradle:
plugins {
id "info.solidsoft.pitest" version '1.6.0'
id 'com.github.kt3k.coveralls' version '2.12.2'
}
pitest {
timestampedReports = false
outputFormats = ['XML']
}
An example .travis.yml
looks like following:
language: java
jdk:
- oraclejdk11
after_success:
- ./gradlew pitest coveralls
When using Travis-CI Pro, you must provide your Coveralls Pro repo token in the
COVERALLS_REPO_TOKEN
environment variable in .travis.yml
.
env:
global:
- COVERALLS_REPO_TOKEN=mySecRetRepoToken
You may also use a secure environment variable to hold COVERALLS_REPO_TOKEN
by
following the instructions on
docs.travis-ci.com.
env:
global:
- secure: <encrypted string here>
This plugin only handles one project per build. You need to merge coverage report before coveralls plugin take it.
See example: https://github.com/ben-manes/caffeine/blob/v2.6.2/build.gradle#L133
If you configure coveralls "task" (not the extension object), you need to write as the following:
tasks.coveralls {
dependsOn 'check'
}
The following CI services should automatically work:
If you need to customize something or support a different CI service, you can configure environment variables:
CI_NAME
CI_BUILD_NUMBER
CI_BUILD_URL
CI_BRANCH
CI_PULL_REQUEST
COVERALLS_REPO_TOKEN
travis-ci
travis-pro
circleci
jenkins
snapci
bitrise
If you have COVERALLS_REPO_TOKEN
set and you're using Travis-CI not
Travis-Pro, you need to set CI_NAME=travis-ci
.
You can set https proxy if needed. Environment variables to configure:
https.proxyHost
https.proxyPort
(default value is 443)MIT License ( Yoshiya Hinosawa )
coveralls
to
com.github.kt3k.coveralls
according to
the guidelines of gradle plugin. Please
see the examples below for details. (2014/07/21)coveralls
->
com.github.kt3k.coveralls
(#19)<source>
tag support.
(#1)