diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1d1d3407..befb3a98 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -18,6 +18,11 @@ jobs: with: arguments: check + - name: Upload Coverage Report + uses: codecov/codecov-action@v1 + with: + file: ./build/reports/jacoco/test/jacocoTestReport.xml + integration-test: runs-on: ubuntu-latest # Docker Hub image that `container-job` executes in. diff --git a/README.adoc b/README.adoc index 9c74a4ec..cf28a383 100644 --- a/README.adoc +++ b/README.adoc @@ -5,6 +5,7 @@ ifdef::env-github[] endif::[] image:https://github.com/emeraldpay/dshackle/workflows/Tests/badge.svg["Unit Tests"] +image:https://codecov.io/gh/emeraldpay/dshakle/branch/master/graph/badge.svg["Coverage",link="https://codecov.io/gh/emeraldpay/dshakle"] image:https://img.shields.io/docker/pulls/emeraldpay/dshackle?style=flat-square["Docker",link="https://hub.docker.com/r/emeraldpay/dshackle"] image:https://img.shields.io/github/license/emeraldpay/dshackle.svg?style=flat-square&maxAge=2592000["License",link="https://github.com/emeraldpay/dshackle/blob/master/LICENSE"] image:https://badges.gitter.im/emeraldpay/community.svg[link="https://gitter.im/emeraldpay/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge"] diff --git a/build.gradle b/build.gradle index a86c2902..99f1c8e4 100644 --- a/build.gradle +++ b/build.gradle @@ -19,6 +19,7 @@ plugins { id 'groovy' id 'idea' id 'application' + id 'jacoco' id 'org.jetbrains.kotlin.jvm' version '1.3.70' id "com.google.cloud.tools.jib" version "1.3.0" @@ -126,6 +127,7 @@ test { jvmArgs '-ea' testLogging.showStandardStreams = false testLogging.exceptionFormat = 'full' + finalizedBy jacocoTestReport } application { @@ -232,4 +234,20 @@ gradle.buildFinished { } println "" } +} + +jacocoTestReport { + dependsOn test + reports { + xml.enabled true + html.enabled true + } + afterEvaluate { + classDirectories.setFrom(files(classDirectories.files.collect { + fileTree(dir: it, exclude: 'io/emeraldpay/dshackle/proto/**') + })) + } +} +jacoco { + toolVersion = "0.8.5" } \ No newline at end of file