diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 2997052..729fb31 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -28,3 +28,13 @@ jobs: - name: Check with Gradle run: ./gradlew -p ${{ inputs.projectDir }} clean check + + - name: Generate Coverage report + if: ${{ inputs.projectDir == '.' }} + run: ./gradlew -p ${{ inputs.projectDir }} koverXmlReport + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + if: ${{ inputs.projectDir == '.' }} + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/build.gradle.kts b/build.gradle.kts index eba7116..c80384b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,6 +4,7 @@ plugins { alias(libs.plugins.kotlin.serialization) alias(libs.plugins.kotest.multiplatform) alias(libs.plugins.detekt) + alias(libs.plugins.kover) `maven-publish` } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5fc5c48..ca19d4c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -29,3 +29,4 @@ kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } kotest-multiplatform = { id = "io.kotest.multiplatform", version.ref = "kotest" } detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt"} +kover = { id = "org.jetbrains.kotlinx.kover", version = "0.7.5" }