Skip to content

Commit

Permalink
test jacoco xml (#13)
Browse files Browse the repository at this point in the history
* test jacoco xml

* token is mandatory

* fix name

* another try

* enable debug mode + display coverage info

* try to fix path

* set update comment to true and disable debug
  • Loading branch information
nniclausse authored Sep 23, 2024
1 parent e1532de commit 7584925
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,25 @@ jobs:
- name: Gradle tests
run: ./gradlew test

- name: Run Coverage
run: ./gradlew jacocoTestReport

- name: Add coverage to PR
id: jacoco
uses: madrapps/[email protected]
with:
paths: |
**/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 40
min-coverage-changed-files: 60
update-comment: true

- name: Get the Coverage info
run: |
echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}"
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/linux@v2
if: always()
Expand Down
15 changes: 15 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
`java-library`
`maven-publish`
`jacoco`
id("org.gradlex.extra-java-module-info") version "1.8"
id("com.gradleup.shadow") version "8.3.1"
signing
Expand Down Expand Up @@ -70,11 +71,25 @@ tasks.withType<JavaCompile>() {
tasks.withType<Javadoc>() {
options.encoding = "UTF-8"
}

tasks {
shadowJar {
this.archiveClassifier = "jar-with-dependencies"
}
}

tasks.jacocoTestReport {
dependsOn(tasks.test)

reports {
xml.required.set(true)
}
}

tasks.test {
finalizedBy(tasks.jacocoTestReport)
}

extraJavaModuleInfo {
failOnMissingModuleInfo.set(false)
automaticModule("fr.com.hp.hpl.jena.rdf.arp:arp", "arp")
Expand Down

0 comments on commit 7584925

Please sign in to comment.