Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Kover as test coverage tool #2793

Merged
merged 23 commits into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@ jobs:
with:
arguments: check

- name: Create code coverage report
uses: gradle/gradle-build-action@v2
with:
arguments: koverMergedReport

- name: Add coverage report to PR
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" }