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

Kotlin kover #86

Merged
merged 10 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 17 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
Expand All @@ -11,6 +9,10 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: read
pull-requests: write

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
Expand All @@ -28,5 +30,16 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew build
- name: Run tests and generate coverage report
run: ./gradlew koverXmlReport

- name: Add coverage report to PR
id: kover
uses: mi-kas/kover-report@v1
with:
path: ${{ github.workspace }}/build/reports/kover/report.xml
title: Code Coverage
update-comment: true
min-coverage-overall: 50
min-coverage-changed-files: 55
coverage-counter-type: LINE
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.jetbrains.kotlin.jvm") version "2.0.20"
id("org.jetbrains.intellij.platform") version "2.0.1"
id("org.jetbrains.kotlinx.kover") version "0.9.0-RC"
}

// Use same version and group for the jar and the plugin
Expand Down Expand Up @@ -44,6 +45,7 @@ dependencies {

tasks.test {
useJUnitPlatform()
finalizedBy(tasks.koverHtmlReport) // report is always generated after tests run
}

tasks.withType<KotlinCompile> {
Expand Down
Loading