File tree 4 files changed +61
-59
lines changed
4 files changed +61
-59
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- name : 🧪 Image Server Tests on Pull Request
1
+ name : 🧪 Backend Tests on Pull Request
2
2
3
3
on :
4
4
pull_request :
@@ -27,14 +27,14 @@ jobs:
27
27
run : chmod +x gradlew
28
28
29
29
- name : 🧪 Spring Boot Test
30
- run : ./gradlew clean application:wypl-image: test
30
+ run : ./gradlew clean test
31
31
32
32
- name : Add coverage to PR
33
33
id : jacoco
34
34
35
35
with :
36
- title : 📄 Image Server Jacoco Coverage Report
37
- paths : ${{ github.workspace }}/**/wypl-image/ reports/jacoco/test/jacocoTestReport.xml
36
+ title : 📄 Jacoco Coverage Report
37
+ paths : ${{ github.workspace }}/**/reports/jacoco/test/jacocoTestReport.xml
38
38
token : ${{ secrets.GITHUB_TOKEN }}
39
39
min-coverage-overall : 80
40
40
min-coverage-changed-files : 80
Original file line number Diff line number Diff line change @@ -12,4 +12,60 @@ dependencies {
12
12
13
13
testImplementation(' org.springframework.boot:spring-boot-starter-test' )
14
14
testImplementation(' org.mockito:mockito-core' )
15
- }
15
+ }
16
+
17
+ /* Jacoco Start */
18
+ tasks. withType(JacocoReport ). configureEach {
19
+ reports {
20
+ html. required. set(true )
21
+ xml. required. set(true )
22
+ html. outputLocation. set(file(" reports/jacoco/index.xml" ))
23
+ xml. outputLocation. set(file(" reports/jacoco/test/jacocoTestReport.xml" ))
24
+ }
25
+
26
+ classDirectories. setFrom(
27
+ files(classDirectories. files. collect {
28
+ fileTree(it) {
29
+ exclude(
30
+ " **/*Application*" ,
31
+ " **/*Configuration*" ,
32
+ " **/*Request*" ,
33
+ " **/*Response*" ,
34
+ " **/common/**" ,
35
+ " **/config/**" ,
36
+ " **/data/**" ,
37
+ " **/exception/**" ,
38
+ " **/properties/**"
39
+ )
40
+ }
41
+ })
42
+ )
43
+ }
44
+
45
+ tasks. jacocoTestCoverageVerification {
46
+ violationRules {
47
+ rule {
48
+ enabled = true
49
+ element = ' CLASS'
50
+
51
+ limit {
52
+ counter = ' LINE'
53
+ value = ' COVEREDRATIO'
54
+ minimum = 0.80D
55
+ }
56
+
57
+ excludes = [
58
+ " **/*Application*" ,
59
+ " **/*Configuration*" ,
60
+ " **/*Request*" ,
61
+ " **/*Response*" ,
62
+ " **/common/**" ,
63
+ " **/config/**" ,
64
+ " **/data/**" ,
65
+ " **/exception/**" ,
66
+ " **/properties/**"
67
+ ]
68
+ }
69
+ }
70
+ }
71
+ /* Jacoco End */
You can’t perform that action at this time.
0 commit comments