From 24030e30628f1bda5213b0b2e346de2dc28957f0 Mon Sep 17 00:00:00 2001 From: KotlinIsland Date: Sat, 24 Sep 2022 15:50:47 +1000 Subject: [PATCH] Switch from jacoco to kotlinx-Kover --- .github/workflows/build.yml | 19 +++++++++---------- build.gradle.kts | 15 +++++++-------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38a3f446..44944e79 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,7 +86,7 @@ jobs: # Run tests - name: Run Tests - run: ./gradlew test jacocoTestReport --info + run: ./gradlew check # Collect Tests Result of failed tests - name: Collect Tests Result @@ -96,6 +96,13 @@ jobs: name: tests-result path: ${{ github.workspace }}/build/reports/tests + # Upload Kover report to CodeCov + - name: Upload Code Coverage Report + uses: codecov/codecov-action@v3 + with: + files: ${{ github.workspace }}/build/reports/kover/xml/report.xml + fail_ci_if_error: true + # Cache Plugin Verifier IDEs - name: Setup Plugin Verifier IDEs Cache uses: actions/cache@v3 @@ -151,14 +158,6 @@ jobs: cp CHANGELOG.md docs mkdocs build --verbose --clean --strict - - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v3.1.0 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./build/reports/jacoco/test/jacocoTestReport.xml - flags: unittests - fail_ci_if_error: true - # Prepare a draft release for GitHub Releases page for the manual verification # If accepted and published, release workflow would be triggered releaseDraft: @@ -194,4 +193,4 @@ jobs: --notes "$(cat << 'EOM' ${{ needs.build.outputs.changelog }} EOM - )" \ No newline at end of file + )" diff --git a/build.gradle.kts b/build.gradle.kts index 2f0c303e..199e780c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,7 +11,8 @@ plugins { id("org.jetbrains.changelog") version "1.3.1" // Gradle Qodana Plugin id("org.jetbrains.qodana") version "0.1.13" - jacoco + // Gradle Kover Plugin + id("org.jetbrains.kotlinx.kover") version "0.6.0" } group = properties("pluginGroup") @@ -53,6 +54,11 @@ qodana { showReport.set(System.getenv("QODANA_SHOW_REPORT")?.toBoolean() ?: false) } +// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration +kover.xmlReport { + onCheck.set(true) +} + tasks { wrapper { gradleVersion = properties("gradleVersion") @@ -84,13 +90,6 @@ tasks { }) } - jacocoTestReport { - reports { - xml.required.set(true) - html.required.set(true) - } - } - // Configure UI tests plugin // Read more: https://github.com/JetBrains/intellij-ui-test-robot runIdeForUiTests {