Generate and upload code coverage report.
This commit is contained in:
@@ -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)
|
||||
|
||||
24
build.gradle
24
build.gradle
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user