Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisited JaCoCo config #75

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,23 @@ jobs:
cache: gradle

- name: Run JaCoCo coverage
# test is finalizedBy jacocoTestReport
run: |
./gradlew clean test jacocoTestReport
./gradlew clean test

- name: Add JaCoCo coverage as a PR comment
id: jacoco
uses: madrapps/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
paths: ${{ github.workspace }}/build/reports/jacoco/**/jacocoTestReport.xml
paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
min-coverage-overall: 90
title: ' :robot: `Coverage Report`'
title: ' :robot: `JaCoCo Coverage Report` :robot: '
pass-emoji: ':green_circle:'
fail-emoji: ':red_circle:'
update-comment: true
min-coverage-changed-files: 60
debug-mode: true

- name: Get the JaCoCo coverage info
run: |
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ ext {
}

apply from: "$rootDir/conf/gradle/dependencies.gradle"
apply from: "$rootDir/conf/gradle/jacoco.gradle"
apply from: "$rootDir/conf/gradle/tests.gradle"
apply from: "$rootDir/conf/gradle/jar.gradle"
apply from: "$rootDir/conf/gradle/publish.gradle"
apply from: "$rootDir/conf/gradle/jacoco.gradle"

tasks.register('copyPreCommitHook', Copy) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
Expand Down
10 changes: 6 additions & 4 deletions conf/gradle/jacoco.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
def execData() {
return files(fileTree(layout.buildDirectory.get().asFile.absolutePath).include("jacoco/*.exec"))
return fileTree(layout.buildDirectory.file("jacoco/test.exec").get().asFile)
}

def static analysisExcludes() {
return [
"src/generated/**"
]
return []
}

ext {
Expand Down Expand Up @@ -46,3 +44,7 @@ jacocoTestCoverageVerification {
}
}
}

test {
finalizedBy jacocoTestReport
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ gsonVersion=2.8.9

googleJavaFormatVersion=0.9
googleJavaFormatToolVersion=1.22.0
jacocoVersion=0.8.11
jacocoVersion=0.8.12
coverageMinimum=0.8

#######################################################
Expand Down
Loading