Skip to content

Commit

Permalink
Integrate Kover (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
MGaetan89 authored Jan 26, 2024
1 parent 89ee9de commit 340bb20
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ jobs:
unit-test:
name: Unit Tests
runs-on: ubuntu-latest
permissions:
pull-requests: write
env:
USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -127,10 +129,22 @@ jobs:
- name: Run Unit Tests
run: >
./gradlew
:pillarbox-analytics:testDebugUnitTest
:pillarbox-core-business:testDebugUnitTest
:pillarbox-player:testDebugUnitTest
:pillarbox-ui:testDebugUnitTest
:pillarbox-analytics:koverXmlReportDebug
:pillarbox-core-business:koverXmlReportDebug
:pillarbox-player:koverXmlReportDebug
:pillarbox-ui:koverXmlReportDebug
- name: Report Code Coverage
if: ${{ github.event_name == 'pull_request' }}
uses: madrapps/[email protected]
with:
paths: ${{ github.workspace }}/**/build/reports/kover/**.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 0
min-coverage-changed-files: 0
update-comment: true
title: Code Coverage
pass-emoji: 🟢
fail-emoji: 🔴

android-tests:
name: Android Tests
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ plugins {
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.detekt)
alias(libs.plugins.dependency.analysis.gradle.plugin)
alias(libs.plugins.kotlinx.kover)
}

apply(plugin = "android-reporting")
Expand Down
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ comscore = "6.10.0"
dependency-analysis-gradle-plugin = "1.29.0"
detekt = "1.23.4"
guava = "31.1-android"
jacoco = "0.8.11"
json = "20231013"
junit = "4.13.2"
kotlin = "1.9.22"
kotlinx-coroutines = "1.7.3"
kotlinx-kover = "0.7.5"
kotlinx-serialization = "1.6.2"
ktor = "2.3.7"
mockk = "1.13.9"
Expand Down Expand Up @@ -126,3 +128,4 @@ dependency-analysis-gradle-plugin = { id = "com.autonomousapps.dependency-analys
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlinx-kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kotlinx-kover" }
5 changes: 5 additions & 0 deletions pillarbox-analytics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlinx.kover)
`maven-publish`
}

Expand Down Expand Up @@ -71,6 +72,10 @@ dependencies {
androidTestImplementation(libs.kotlinx.coroutines.test)
}

kover {
useJacoco(libs.versions.jacoco.get())
}

publishing {

publications {
Expand Down
5 changes: 5 additions & 0 deletions pillarbox-core-business/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.kotlinx.kover)
`maven-publish`
}

Expand Down Expand Up @@ -86,6 +87,10 @@ dependencies {
androidTestImplementation(libs.kotlinx.coroutines.test)
}

kover {
useJacoco(libs.versions.jacoco.get())
}

publishing {
publications {
register<MavenPublication>("gpr") {
Expand Down
5 changes: 5 additions & 0 deletions pillarbox-player/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlinx.kover)
`maven-publish`
}

Expand Down Expand Up @@ -95,6 +96,10 @@ dependencies {
androidTestImplementation(libs.mockk.dsl)
}

kover {
useJacoco(libs.versions.jacoco.get())
}

publishing {
publications {
register<MavenPublication>("gpr") {
Expand Down
5 changes: 5 additions & 0 deletions pillarbox-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlinx.kover)
`maven-publish`
}

Expand Down Expand Up @@ -75,6 +76,10 @@ dependencies {
debugImplementation(libs.androidx.compose.ui.tooling)
}

kover {
useJacoco(libs.versions.jacoco.get())
}

publishing {
publications {
register<MavenPublication>("gpr") {
Expand Down

0 comments on commit 340bb20

Please sign in to comment.