Skip to content

Commit

Permalink
Jacoco reports badge
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperStep committed Feb 28, 2024
1 parent 4b366a1 commit 2f505fe
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/assemble.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Build Gradle project
on:
push:
branches:
- '!master'
jobs:
build-gradle-project:
runs-on: ubuntu-latest
Expand All @@ -15,5 +13,14 @@ jobs:
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run Test Coverage
run: ./gradlew jacocoTestReport
- name: Generate JaCoCo Badge
uses: cicirello/jacoco-badge-generator@v2
with:
generate-branches-badge: true
jacoco-csv-file: build/reports/jacoco/test/jacocoTestReport.csv

- name: Run build with Gradle Wrapper
run: ./gradlew assemble
16 changes: 15 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id 'org.springframework.boot' version '3.2.2'
id 'io.spring.dependency-management' version '1.1.4'
id 'org.siouan.frontend-jdk17' version '8.0.0'
id 'jacoco'
}

ext {
Expand Down Expand Up @@ -79,4 +80,17 @@ tasks.named('test') {
testLogging {
events "passed"
}
}
}

test {
finalizedBy jacocoTestReport // report is always generated after tests run
}

jacocoTestReport {
dependsOn test
reports {
xml.required = false
html.required = false
csv.required = true
}
}

0 comments on commit 2f505fe

Please sign in to comment.