1- name : CI
1+ name : CI (pull_request)
22
33on :
4- push :
5- branches : [ main, develop, 'feature/**' ]
64 pull_request :
75 branches : [ main, develop ]
86
@@ -36,33 +34,52 @@ jobs:
3634 - name : Build and test with Maven
3735 run : mvn -B clean verify -Pqa -Ddependency-check.skip=true
3836
39- - name : Upload test results
37+ # Upload XMLs ONLY once (Java 21) so the report doesn't double-count
38+ - name : Upload unit test XMLs (Java 21 only)
4039 uses : actions/upload-artifact@v4
41- if : always()
40+ if : always() && matrix.java == '21'
4241 with :
43- name : test-results-java-${{ matrix.java }}
42+ name : unit-xml
4443 path : |
45- **/target/surefire-reports/
46- **/target/failsafe -reports/
44+ **/target/surefire-reports/TEST-*.xml
45+ **/target/* -reports/TEST-*.xml
4746 retention-days : 7
4847
49- - name : Upload coverage report
48+ integration-tests :
49+ name : Integration & E2E Tests (Java ${{ matrix.java }})
50+ runs-on : ubuntu-latest
51+ needs : build
52+ strategy :
53+ fail-fast : false
54+ matrix :
55+ java : [ '17', '21' ]
56+
57+ steps :
58+ - name : Checkout repository
59+ uses : actions/checkout@v4
60+ with :
61+ fetch-depth : 1
62+
63+ - name : Set up JDK ${{ matrix.java }}
64+ uses : actions/setup-java@v4
65+ with :
66+ java-version : ${{ matrix.java }}
67+ distribution : ' temurin'
68+ cache : ' maven'
69+
70+ - name : Run integration tests
71+ run : mvn -B clean verify -Pit -Ddependency-check.skip=true
72+
73+ # Upload XMLs ONLY once (Java 21) so the report doesn't double-count
74+ - name : Upload IT test XMLs (Java 21 only)
5075 uses : actions/upload-artifact@v4
51- if : matrix.java == '21'
76+ if : always() && matrix.java == '21'
5277 with :
53- name : coverage-report
78+ name : it-xml
5479 path : |
55- **/target/site/jacoco/
56- **/target/jacoco.exec
80+ **/target/failsafe-reports/TEST-*.xml
5781 retention-days : 7
5882
59- - name : Publish Test Report
60- uses : mikepenz/action-junit-report@v4
61- if : always()
62- with :
63- report_paths : ' **/target/*-reports/TEST-*.xml'
64- check_name : Test Report (Java ${{ matrix.java }})
65-
6683 quality :
6784 name : Code Quality Analysis
6885 runs-on : ubuntu-latest
@@ -81,32 +98,14 @@ jobs:
8198 distribution : ' temurin'
8299 cache : ' maven'
83100
84- - name : Install artifacts for analysis
101+ - name : Install artifacts for analysis (skip tests)
85102 run : mvn -B -Ddependency-check.skip=true clean install -Pqa -DskipTests
86103
87104 - name : Run SpotBugs analysis
88105 run : mvn -B spotbugs:check -Pqa -Ddependency-check.skip=true
89- continue-on-error : true
90106
91107 - name : Run Checkstyle analysis
92108 run : mvn -B checkstyle:check -Pqa -Ddependency-check.skip=true
93- continue-on-error : true
94-
95- - name : Upload SpotBugs report
96- uses : actions/upload-artifact@v4
97- if : always()
98- with :
99- name : spotbugs-report
100- path : ' **/target/spotbugsXml.xml'
101- retention-days : 7
102-
103- - name : Upload Checkstyle report
104- uses : actions/upload-artifact@v4
105- if : always()
106- with :
107- name : checkstyle-report
108- path : ' **/target/checkstyle-result.xml'
109- retention-days : 7
110109
111110 dependency-check :
112111 name : OWASP Dependency Check
@@ -136,13 +135,41 @@ jobs:
136135
137136 - name : Run OWASP Dependency Check
138137 run : mvn -B dependency-check:aggregate -Pqa
139- continue-on-error : true
140138
141- - name : Upload Dependency Check report
142- uses : actions/upload-artifact@v4
139+ reports :
140+ name : Test Reports
141+ runs-on : ubuntu-latest
142+ needs : [ build, integration-tests ]
143+ if : always()
144+
145+ permissions :
146+ contents : read
147+ checks : write
148+ pull-requests : write
149+
150+ steps :
151+ - name : Download unit XMLs (Java 21 only)
152+ uses : actions/download-artifact@v4
153+ with :
154+ name : unit-xml
155+ path : reports/unit
156+
157+ - name : Download IT XMLs (Java 21 only)
158+ uses : actions/download-artifact@v4
159+ with :
160+ name : it-xml
161+ path : reports/it
162+
163+ - name : Publish Unit Test Report
164+ uses : mikepenz/action-junit-report@v4
143165 if : always()
144166 with :
145- name : dependency-check-report
146- path : |
147- target/dependency-check-report.html
148- retention-days : 30
167+ report_paths : ' reports/unit/**/TEST-*.xml'
168+ check_name : Unit Test Report
169+
170+ - name : Publish IT Test Report
171+ uses : mikepenz/action-junit-report@v4
172+ if : always()
173+ with :
174+ report_paths : ' reports/it/**/TEST-*.xml'
175+ check_name : IT Test Report
0 commit comments