Skip to content

Commit

Permalink
#147 add kover verification in CI machine
Browse files Browse the repository at this point in the history
  • Loading branch information
javadjafari1 committed Apr 11, 2024
1 parent 0b5de60 commit 852177e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build_on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
- name: Run All Unit Tests
run: ./gradlew :app:testCafeBazaarDebugUnitTest

- name: Verify tests With Kover
run: ./gradlew :app:koverVerifyCafeBazaarDebug

- name: Run Detekt
run: ./gradlew detekt

Expand Down
40 changes: 40 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import kotlinx.kover.gradle.plugin.dsl.AggregationType
import kotlinx.kover.gradle.plugin.dsl.MetricType
import org.jetbrains.kotlin.konan.properties.Properties

plugins {
Expand Down Expand Up @@ -278,6 +280,44 @@ kover {
useJacoco(libs.versions.jacoco.get())
}

koverReport {
androidReports("cafeBazaarDebug") {
verify {
onCheck = true
rule {
isEnabled = true
bound {
minValue = 90
aggregation = AggregationType.COVERED_PERCENTAGE
metric = MetricType.LINE
}
}
rule {
isEnabled = true
bound {
minValue = 97
aggregation = AggregationType.COVERED_PERCENTAGE
metric = MetricType.INSTRUCTION
}
}
rule {
isEnabled = true
bound {
minValue = 94
aggregation = AggregationType.COVERED_PERCENTAGE
metric = MetricType.BRANCH
}
}
}
}

filters {
includes {
classes("*ViewModel")
}
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
Expand Down

0 comments on commit 852177e

Please sign in to comment.