Skip to content

Commit f3faee8

Browse files
committed
Add Kover(age) check
- Integrate Kover plugin for code coverage analysis - Run Kover tasks on CI - Publish Html report - Update actions/checkout@v5
1 parent c455974 commit f3faee8

File tree

3 files changed

+34
-4
lines changed

3 files changed

+34
-4
lines changed

.github/workflows/validate-pr.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: macos-latest
1515
name: Validate PR
1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v5
1818

1919
- name: Set up JDK 21
2020
uses: actions/setup-java@v5
@@ -26,14 +26,16 @@ jobs:
2626
uses: gradle/actions/setup-gradle@v4
2727

2828
- name: Clean Build with Gradle
29-
run: ./gradlew clean build
29+
run: ./gradlew clean ktlintCheck build koverVerify koverLog koverHtmlReport
3030

31-
- name: Upload JUnit test results
31+
- name: Upload Reports
3232
if: always()
3333
uses: actions/upload-artifact@v4
3434
with:
3535
name: junit-results
36-
path: '**/build/test-results/test/*.xml'
36+
path: |
37+
**/build/test-results/test/*.xml
38+
build/reports
3739
3840
- name: Disable Auto-Merge on Fail
3941
if: failure()

build.gradle.kts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,38 @@
11
plugins {
22
alias(libs.plugins.ktlint)
3+
alias(libs.plugins.kover)
34
}
45

56
allprojects {
67
group = "io.modelcontextprotocol"
78
version = "0.6.0"
89
}
910

11+
dependencies {
12+
kover(project(":kotlin-sdk-core"))
13+
kover(project(":kotlin-sdk-client"))
14+
kover(project(":kotlin-sdk-server"))
15+
kover(project(":kotlin-sdk-test"))
16+
}
17+
1018
subprojects {
1119
apply(plugin = "org.jlleitschuh.gradle.ktlint")
20+
apply(plugin = "org.jetbrains.kotlinx.kover")
21+
}
22+
23+
kover {
24+
reports {
25+
filters {
26+
includes.classes("io.modelcontextprotocol.kotlin.sdk.*")
27+
}
28+
total {
29+
log {
30+
}
31+
verify {
32+
rule {
33+
minBound(60)
34+
}
35+
}
36+
}
37+
}
1238
}

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ kotlin = "2.2.0"
44
dokka = "2.0.0"
55
atomicfu = "0.29.0"
66
ktlint = "13.0.0"
7+
kover = "0.9.1"
78

89
# libraries version
910
serialization = "1.9.0"
@@ -59,6 +60,7 @@ ktor-serialization-kotlinx-json = { group = "io.ktor", name = "ktor-serializatio
5960
[plugins]
6061
kotlinx-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binaryCompatibilityValidatorPlugin" }
6162
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
63+
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
6264

6365
# Samples
6466
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }

0 commit comments

Comments
 (0)