Skip to content

Commit

Permalink
Upload test coverage to codecov. (#25)
Browse files Browse the repository at this point in the history
Upload test coverage to codecov.
  • Loading branch information
ouphi authored Aug 16, 2022
1 parent a5c4789 commit 977d358
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,17 @@ jobs:
timeout-minutes: 10
env:
INTEGRATION_TEST: true
JACOCO: "true"

- name: 'Publish Test Results'
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: "**/test-results/**/*.xml"

- name: CodeCov
uses: codecov/codecov-action@v3

- name: 'docker-compose logs'
run: docker-compose -f system-tests/tests/docker-compose.yml logs
if: always()
Expand Down
18 changes: 17 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ plugins {
`maven-publish`
id("org.gradle.crypto.checksum") version "1.4.0"
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
jacoco
}

repositories {
Expand Down Expand Up @@ -84,6 +85,8 @@ subprojects{
allprojects {
apply(plugin = "maven-publish")

apply(plugin = "java")

version = projectVersion
group = projectGroup

Expand Down Expand Up @@ -147,13 +150,26 @@ allprojects {
}
}

tasks.withType<Test> {
tasks.test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
}

if (System.getenv("JACOCO") == "true") {
apply(plugin = "jacoco")
tasks.test {
finalizedBy(tasks.jacocoTestReport)
}
tasks.jacocoTestReport {
reports {
// Generate XML report for codecov.io
xml.required.set(true)
}
}
}

// EdcRuntimeExtension uses this to determine the runtime classpath of the module to run.
tasks.register("printClasspath") {
doLast {
Expand Down

0 comments on commit 977d358

Please sign in to comment.