@@ -29,46 +29,51 @@ jobs:
2929 - name : Check Spotbugs
3030 run : ./mvnw spotbugs:check
3131
32- # 添加单元测试步骤
32+ # 执行所有模块的测试
3333 - name : Run Unit Tests
3434 run : ./mvnw -B test
3535
36- # 生成测试覆盖率报告
37- - name : Generate Test Coverage Report
38- run : ./mvnw -B jacoco:report
39-
40- - name : Build with Maven
41- run : ./mvnw -B clean package
42-
43- # 使用 actions/test-reporter 展示测试结果
36+ # 收集所有模块的测试报告
4437 - name : Publish Test Results
4538 uses : dorny/test-reporter@v1
4639 if : always()
4740 with :
4841 name : JUnit Tests (${{ matrix.java }})
49- path : target/surefire-reports/*.xml
42+ path : ' **/ target/surefire-reports/TEST- *.xml'
5043 reporter : java-junit
51- fail-on-error : true
44+ fail-on-error : false
5245
46+ - name : Build with Maven
47+ run : ./mvnw -B clean package
48+
49+ # 上传所有模块的测试结果
5350 - name : Upload Test Results
5451 if : always()
5552 uses : actions/upload-artifact@v4
5653 with :
5754 name : test-results-${{ matrix.java }}
58- path : target/surefire-reports/
55+ path : |
56+ **/target/surefire-reports/
57+ **/target/site/surefire-report.html
58+
59+ # 收集所有模块的覆盖率报告
60+ - name : Generate Test Coverage Report
61+ run : ./mvnw -B jacoco:report
5962
6063 - name : Upload Coverage Report
6164 if : matrix.java == '8'
6265 uses : actions/upload-artifact@v4
6366 with :
6467 name : coverage-report
65- path : target/site/jacoco/
68+ path : |
69+ **/target/site/jacoco/
70+ **/target/site/jacoco/jacoco.xml
6671
6772 - name : Report Coverage to Codecov
6873 if : matrix.java == '8'
6974 uses : codecov/codecov-action@v3
7075 with :
71- file : target/site/jacoco/jacoco.xml
76+ files : ' **/ target/site/jacoco/jacoco.xml'
7277
7378 dependency-check :
7479 runs-on : ubuntu-latest
9095 uses : actions/upload-artifact@v4
9196 with :
9297 name : dependency-check-report
93- path : target/dependency-check-report.html
98+ path : ' **/ target/dependency-check-report.html'
0 commit comments