Skip to content

Commit

Permalink
build: add test coverage reporting
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <[email protected]>
  • Loading branch information
fbricon committed Mar 26, 2024
1 parent 67324b3 commit 3cda8ef
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,11 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: tests-result
path: ${{ github.workspace }}/build/reports/tests
path: ${{ github.workspace }}/build/reports/tests

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: redhat-developer/lsp4ij
files: ${{ github.workspace }}/build/reports/kover/report.xml
10 changes: 10 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ plugins {
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
alias(libs.plugins.changelog) // Gradle Changelog Plugin
alias(libs.plugins.testLogger) // Nice test logs
alias(libs.plugins.kover) // Gradle Kover Plugin
jacoco // Code coverage
}

Expand Down Expand Up @@ -145,6 +146,15 @@ tasks.register<Test>("integrationTest") {
mustRunAfter(tasks["test"])
}

// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
koverReport {
defaults {
xml {
onCheck = true
}
}
}

tasks {
wrapper {
gradleVersion = properties("gradleVersion").get()
Expand Down
5 changes: 3 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ testlogger = "3.2.0"
kotlin = "1.9.10"
changelog = "2.2.0"
gradleIntelliJPlugin = "1.16.1"

kover = "0.7.6"

[libraries]
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
Expand All @@ -16,4 +16,5 @@ annotations = { group = "org.jetbrains", name = "annotations", version.ref = "an
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
gradleIntelliJPlugin = { id = "org.jetbrains.intellij", version.ref = "gradleIntelliJPlugin" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
testLogger = { id = "com.adarshr.test-logger", version.ref = "testlogger" }
testLogger = { id = "com.adarshr.test-logger", version.ref = "testlogger" }
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }

0 comments on commit 3cda8ef

Please sign in to comment.