Skip to content

Commit

Permalink
GH-21 Configure jacocoTestCoverageVerification task
Browse files Browse the repository at this point in the history
  • Loading branch information
dzikoysk committed Feb 6, 2023
1 parent 07edb33 commit 23837bb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Build with Gradle
run: ./gradlew build test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
Expand Down
28 changes: 28 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,34 @@ subprojects {
xml.required.set(true)
html.required.set(true)
}

executionData(fileTree(project.buildDir).include("jacoco/*.exec"))
finalizedBy("jacocoTestCoverageVerification")
}

tasks.jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = "0.0".toBigDecimal()
}
}
rule {
enabled = true
element = "CLASS"
limit {
counter = "BRANCH"
value = "COVEREDRATIO"
minimum = "0.0".toBigDecimal()
}
limit {
counter = "LINE"
value = "COVEREDRATIO"
minimum = "0.0".toBigDecimal()
}
excludes = listOf()
}
}
}
}

Expand Down

0 comments on commit 23837bb

Please sign in to comment.