Skip to content

Commit

Permalink
Setup Kover as test coverage tool (#2793)
Browse files Browse the repository at this point in the history
Signed-off-by: MarkMarkyMarkus <[email protected]>
Co-authored-by: Alejandro Serrano <[email protected]>
Co-authored-by: Simon Vergauwen <[email protected]>
  • Loading branch information
3 people authored Dec 9, 2022
1 parent a8e9b73 commit 93f0731
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,22 @@ jobs:
with:
arguments: check

- name: Create code coverage report
if: "! github.event.pull_request.head.repo.fork "
uses: gradle/gradle-build-action@v2
with:
arguments: koverMergedReport

- name: Add coverage report to PR
if: "! github.event.pull_request.head.repo.fork "
id: kover
uses: mi-kas/kover-report@v1
with:
path: build/reports/kover/merged/xml/report.xml
token: ${{ secrets.GITHUB_TOKEN }}
title: Kover Report
update-comment: true

- name: Upload reports
if: failure()
uses: actions/upload-artifact@v3
Expand Down
2 changes: 2 additions & 0 deletions arrow-libs/gradle/test-coverage.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@
// dependsOn test // tests are required to run before generating the report
// mustRunAfter test
//}

apply plugin: 'kover'
19 changes: 19 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ plugins {
alias(libs.plugins.dokka)
alias(libs.plugins.animalSniffer) apply false
alias(libs.plugins.kotest.multiplatform) apply false
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.binaryCompatibilityValidator)
alias(libs.plugins.arrowGradleConfig.nexus)
Expand All @@ -44,6 +45,24 @@ configure<kotlinx.knit.KnitPluginExtension> {
}
}

koverMerged {
enable()
filters {
projects {
excludes.addAll(
listOf(
":arrow-annotations",
":arrow-core-test",
":arrow-fx-coroutines-test",
":arrow-optics-test",
":arrow-site",
":arrow-stack"
)
)
}
}
}

allprojects {
group = property("projects.group").toString()
}
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jUnitJupiter = "5.8.2"
jUnitVintage = "5.8.2"
kotest = "5.5.4"
kotestGradle = "5.5.4"
kover = "0.6.0"
kotlin = "1.7.22"
kotlinBinaryCompatibilityValidator = "0.12.1"
kotlinCompileTesting = "1.4.9"
Expand Down Expand Up @@ -63,5 +64,6 @@ kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-binaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlinBinaryCompatibilityValidator" }
kotlinx-knit = { id = "org.jetbrains.kotlinx.knit", version.ref = "knit" }
kotlinx-kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "kspVersion" }

0 comments on commit 93f0731

Please sign in to comment.