diff --git a/.circleci/config.yml b/.circleci/config.yml index d2fb25a6..0e40dba8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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) diff --git a/build.gradle b/build.gradle index 7ca36707..0c893eb1 100644 --- a/build.gradle +++ b/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" }