Skip to content

Commit 1f3b6cd

Browse files
committed
chore: add test coverage
Signed-off-by: Anthony D. Mays <[email protected]>
1 parent 2f7edd9 commit 1f3b6cd

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.github/workflows/check_lesson_15_java_pr.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,10 @@ jobs:
2525
- name: Build Lesson 15 with Java
2626
working-directory: ./lesson_15/tdd
2727
run: ./gradlew check
28+
29+
- name: Add coverage to PR
30+
id: jacoco
31+
uses: madrapps/[email protected]
32+
with:
33+
paths: ./lesson_15/tdd/tdd_app/build/reports/jacoco/test/jacocoTestReport.xml
34+
token: ${{ secrets.GITHUB_TOKEN }}

lesson_15/tdd/tdd_app/build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ plugins {
22
// Apply the application plugin to add support for building a CLI application in Java.
33
application
44
eclipse
5+
jacoco
56
id("com.diffplug.spotless") version "6.25.0"
67
id("org.springframework.boot") version "3.2.2"
78
id("com.adarshr.test-logger") version "4.0.0"
@@ -38,6 +39,14 @@ application {
3839
tasks.named<Test>("test") {
3940
// Use JUnit Platform for unit tests.
4041
useJUnitPlatform()
42+
finalizedBy(tasks.jacocoTestReport)
43+
}
44+
45+
tasks.jacocoTestReport {
46+
dependsOn(tasks.test)
47+
reports {
48+
xml.required = true
49+
}
4150
}
4251

4352

0 commit comments

Comments
 (0)