From 1f10164940860fdaee7fdcb4a74352e6b3e598c4 Mon Sep 17 00:00:00 2001 From: Imre Kaszab Date: Tue, 22 Oct 2024 14:48:34 +0200 Subject: [PATCH] fix: update kover config --- .github/workflows/PR.yml | 2 +- build.gradle.kts | 51 ++++++++++++++++++++-------------------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/.github/workflows/PR.yml b/.github/workflows/PR.yml index 0eb48b4..5eb15f0 100644 --- a/.github/workflows/PR.yml +++ b/.github/workflows/PR.yml @@ -66,7 +66,7 @@ jobs: - name: Upload Kover Report if: steps.kover_report.outputs.kover_report_available == 'true' - uses: actions/upload-artifact@v4.4.3 + uses: actions/upload-artifact@v3.1.2 with: name: ${{ steps.kover_report.outputs.artifacts_name }} path: ${{ github.workspace }}/composeApp/build/reports/kover/reportDebug.xml diff --git a/build.gradle.kts b/build.gradle.kts index 54ea354..472d62c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -84,38 +84,37 @@ allprojects { jvmTarget = libs.versions.javaTargetCompatibility.get() } - if (koverIncludeList.any { project.name.contains(it) }) { - kover { - currentProject { - instrumentation { - excludedClasses.addAll(koverExcludeList) - } - sources { - excludeJava = true - } + kover { + currentProject { + instrumentation { + excludedClasses.addAll(koverExcludeList) + } + sources { + excludeJava = true } - reports { + } + reports { + filters { + excludes { classes(koverExcludeList) } + includes { classes(koverIncludeList) } + } + + total { filters { excludes { classes(koverExcludeList) } includes { classes(koverIncludeList) } } + verify { + rule("Minimum coverage verification error") { + disabled = false + groupBy = kotlinx.kover.gradle.plugin.dsl.GroupingEntityType.APPLICATION - total { - filters { - excludes { classes(koverExcludeList) } - includes { classes(koverIncludeList) } - } - verify { - rule("Minimum coverage verification error") { - disabled = false - groupBy = kotlinx.kover.gradle.plugin.dsl.GroupingEntityType.APPLICATION - - bound { - minValue.set(defaultRequiredMinimumCoverage) - maxValue.set(defaultRequiredMaximumCoverage) - coverageUnits.set(CoverageUnit.LINE) - aggregationForGroup = kotlinx.kover.gradle.plugin.dsl.AggregationType.COVERED_PERCENTAGE - } + bound { + minValue.set(defaultRequiredMinimumCoverage) + maxValue.set(defaultRequiredMaximumCoverage) + coverageUnits.set(CoverageUnit.LINE) + aggregationForGroup = + kotlinx.kover.gradle.plugin.dsl.AggregationType.COVERED_PERCENTAGE } } }