Skip to content

Commit 63ab2b6

Browse files
author
maxonfjvipon
committed
ci: restore coverage via Kover 0.9.9 + Codecov
The compileKotlinTask crash was an old Kover-vs-Kotlin-2.x bug fixed in 0.9.9 (what Dependabot's #6 offered); Kover's IntelliJ agent matches coverage by class name, so it records real data where JaCoCo reported 0%. Add the kover onCheck XML report, the coverage workflow uploading build/reports/kover, and the codecov badge. Matches how TeXiFy-IDEA does it on the same platform 2.18.1.
1 parent b7b4a93 commit 63ab2b6

4 files changed

Lines changed: 47 additions & 2 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 Max Trunnikov
2+
# SPDX-License-Identifier: MIT
3+
---
4+
name: coverage
5+
'on':
6+
push:
7+
branches:
8+
- master
9+
pull_request:
10+
permissions:
11+
contents: read
12+
concurrency:
13+
group: coverage-${{ github.ref }}
14+
cancel-in-progress: true
15+
jobs:
16+
coverage:
17+
runs-on: ubuntu-24.04
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-java@v4
21+
with:
22+
distribution: temurin
23+
java-version: 21
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: 22
27+
- uses: gradle/actions/setup-gradle@v4
28+
- run: ./gradlew koverXmlReport --stacktrace
29+
- uses: codecov/codecov-action@v5
30+
with:
31+
token: ${{ secrets.CODECOV_TOKEN }}
32+
files: build/reports/kover/report.xml

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ Requires **JDK 21** and **Node.js**. The Gradle wrapper pins everything else.
2020
[xslint-lsp](https://github.com/xslint/xslint-lsp); logic belongs upstream,
2121
not here.
2222
- Every source file carries an SPDX header — run `reuse lint` to check.
23-
- Open a pull request; CI (build, detekt, plugin verifier, REUSE, and the
24-
meta-linters) must be green before it merges.
23+
- Open a pull request; CI (build, coverage, detekt, plugin verifier, REUSE,
24+
and the meta-linters) must be green before it merges.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
[![build](https://github.com/xslint/xslint-jetbrains/actions/workflows/build.yml/badge.svg)](https://github.com/xslint/xslint-jetbrains/actions/workflows/build.yml)
66
[![verify](https://github.com/xslint/xslint-jetbrains/actions/workflows/verify.yml/badge.svg)](https://github.com/xslint/xslint-jetbrains/actions/workflows/verify.yml)
7+
[![codecov](https://codecov.io/gh/xslint/xslint-jetbrains/branch/master/graph/badge.svg)](https://codecov.io/gh/xslint/xslint-jetbrains)
78
[![PDD status](http://www.0pdd.com/svg?name=xslint/xslint-jetbrains)](http://www.0pdd.com/p?name=xslint/xslint-jetbrains)
89
[![Hits-of-Code](https://hitsofcode.com/github/xslint/xslint-jetbrains)](https://hitsofcode.com/view/github/xslint/xslint-jetbrains)
910
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/xslint/xslint-jetbrains/blob/master/LICENSE.txt)
@@ -48,6 +49,7 @@ reuse the same engine.
4849
./gradlew buildPlugin # build the distributable .zip (build/distributions)
4950
./gradlew runIde # launch a sandbox IDE with the plugin loaded
5051
./gradlew test # unit tests
52+
./gradlew koverXmlReport # coverage report (build/reports/kover)
5153
./gradlew detekt # Kotlin static analysis
5254
./gradlew verifyPlugin # the JetBrains Plugin Verifier
5355
```

build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ plugins {
77
id("org.jetbrains.kotlin.jvm") version "2.4.10"
88
id("org.jetbrains.intellij.platform") version "2.18.1"
99
id("io.gitlab.arturbosch.detekt") version "1.23.8"
10+
id("org.jetbrains.kotlinx.kover") version "0.9.9"
1011
}
1112

1213
group = providers.gradleProperty("pluginGroup").get()
@@ -64,6 +65,16 @@ detekt {
6465
buildUponDefaultConfig = true
6566
}
6667

68+
kover {
69+
reports {
70+
total {
71+
xml {
72+
onCheck = true
73+
}
74+
}
75+
}
76+
}
77+
6778
// Fetch the xslint-lsp Node server and bundle it into the plugin distribution,
6879
// so the runtime finds it at <pluginPath>/xslint-lsp/node_modules/xslint-lsp.
6980
val xslintLspDir = layout.buildDirectory.dir("xslint-lsp")

0 commit comments

Comments
 (0)