File tree Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Original file line number Diff line number Diff line change @@ -32,11 +32,17 @@ jobs:
32
32
- name : Check Build
33
33
run : ./gradlew clean build
34
34
35
- - name : Publish Test Results
36
- uses : EnricoMi/publish-unit-test-result-action@v2
37
- if : always()
35
+ - name : Run test
36
+ run : ./gradlew test
37
+
38
+ - name : Add coverage to PR
39
+ id : jacoco
40
+
38
41
with :
39
- files : |
40
- build/test-results/**/*.xml
41
- build/test-results/**/*.trx
42
- build/test-results/**/*.json
42
+ paths : ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
43
+ token : ${{ secrets.GITHUB_TOKEN }}
44
+ min-coverage-overall : 40
45
+ min-coverage-changed-files : 60
46
+ update-comment : true
47
+ pass-emoji : ' :green_circle:'
48
+ fail-emoji : ' :red_circle:'
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ plugins {
2
2
id ' java'
3
3
id ' org.springframework.boot' version ' 3.2.0'
4
4
id ' io.spring.dependency-management' version ' 1.1.4'
5
+ id ' jacoco'
5
6
}
6
7
7
8
group = ' com.stream'
@@ -11,6 +12,10 @@ java {
11
12
sourceCompatibility = ' 17'
12
13
}
13
14
15
+ jacoco {
16
+ toolVersion = " 0.8.9"
17
+ }
18
+
14
19
configurations {
15
20
compileOnly {
16
21
extendsFrom annotationProcessor
@@ -47,4 +52,14 @@ dependencies {
47
52
48
53
tasks. named(' test' ) {
49
54
useJUnitPlatform()
55
+ finalizedBy jacocoTestReport
56
+ }
57
+
58
+ jacocoTestReport {
59
+ dependsOn test // tests are required to run before generating the report
60
+ reports {
61
+ xml. required = true
62
+ html. required = false
63
+ csv. required = false
64
+ }
50
65
}
You can’t perform that action at this time.
0 commit comments