Generate and upload code coverage report.

This commit is contained in:
Scott Frederick
2018-01-26 15:53:18 -06:00
parent 6da0a32b49
commit da45eb3f6a
2 changed files with 28 additions and 1 deletions

View File

@@ -39,4 +39,7 @@ jobs:
key: v1-dependencies-{{ checksum "build.gradle" }}
# run tests!
- run: ./gradlew test
- run: ./gradlew codeCoverageReport
# upload test results
- run: bash <(curl -s https://codecov.io/bash)

View File

@@ -45,6 +45,7 @@ allprojects {
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "jacoco"
apply plugin: "maven"
apply plugin: "propdeps"
apply plugin: "propdeps-maven"
@@ -54,6 +55,10 @@ allprojects {
apply from: "${rootProject.projectDir}/publish-maven.gradle"
repositories {
mavenCentral()
}
if (project.hasProperty("platformVersion")) {
apply plugin: "spring-io"
@@ -176,6 +181,25 @@ configure(rootProject) {
}
}
task codeCoverageReport(type: JacocoReport) {
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
subprojects.each {
sourceSets it.sourceSets.main
}
reports {
xml.enabled true
xml.destination "${buildDir}/reports/jacoco/report.xml"
html.enabled false
csv.enabled false
}
}
codeCoverageReport.dependsOn {
subprojects*.test
}
task wrapper(type: Wrapper) {
gradleVersion = "4.3.1"
}