@@ -28,10 +28,119 @@ jobs:
2828 base_ref : ${{ needs.get-base-ref.outputs.base_ref }}
2929 head_ref : ${{ github.sha }}
3030
31- build-and-release :
31+ backend-tests :
32+ name : Backend Tests
33+ needs : [ migration-check ]
34+ if : needs.migration-check.result == 'success' || needs.migration-check.result == 'skipped'
35+ runs-on : ubuntu-latest
36+
37+ permissions :
38+ contents : read
39+ checks : write
40+ pull-requests : write
41+
42+ steps :
43+ - name : Checkout Repository
44+ uses : actions/checkout@v6
45+
46+ - name : Set Up JDK 21
47+ uses : actions/setup-java@v5
48+ with :
49+ java-version : ' 21'
50+ distribution : ' temurin'
51+ cache : gradle
52+
53+ - name : Execute Backend Tests
54+ id : backend_tests
55+ working-directory : ./booklore-api
56+ run : |
57+ echo "Running backend tests..."
58+ ./gradlew test --no-daemon --parallel --build-cache
59+ continue-on-error : true
60+
61+ - name : Publish Backend Test Results
62+ uses : EnricoMi/publish-unit-test-result-action@v2
63+ if : always()
64+ with :
65+ files : booklore-api/build/test-results/**/*.xml
66+ check_name : Backend Test Results
67+
68+ - name : Upload Backend Test Reports
69+ uses : actions/upload-artifact@v6
70+ if : always()
71+ with :
72+ name : backend-test-reports
73+ path : |
74+ booklore-api/build/reports/tests/
75+ booklore-api/build/test-results/
76+ retention-days : 30
77+
78+ - name : Validate Backend Test Results
79+ if : steps.backend_tests.outcome == 'failure'
80+ run : |
81+ echo "❌ Backend tests failed"
82+ exit 1
83+
84+ frontend-tests :
85+ name : Frontend Tests
3286 needs : [ migration-check ]
3387 if : needs.migration-check.result == 'success' || needs.migration-check.result == 'skipped'
3488 runs-on : ubuntu-latest
89+
90+ permissions :
91+ contents : read
92+ checks : write
93+ pull-requests : write
94+
95+ steps :
96+ - name : Checkout Repository
97+ uses : actions/checkout@v6
98+
99+ - name : Set Up Node.js
100+ uses : actions/setup-node@v4
101+ with :
102+ node-version : ' 22'
103+ cache : ' npm'
104+ cache-dependency-path : booklore-ui/package-lock.json
105+
106+ - name : Install Frontend Dependencies
107+ working-directory : ./booklore-ui
108+ run : npm ci --force
109+
110+ - name : Execute Frontend Tests
111+ id : frontend_tests
112+ working-directory : ./booklore-ui
113+ run : |
114+ echo "Running frontend tests..."
115+ npx ng test
116+ continue-on-error : true
117+
118+ - name : Publish Frontend Test Results
119+ uses : EnricoMi/publish-unit-test-result-action@v2
120+ if : always()
121+ with :
122+ files : booklore-ui/test-results/vitest-results.xml
123+ check_name : Frontend Test Results
124+
125+ - name : Upload Frontend Test Reports
126+ uses : actions/upload-artifact@v6
127+ if : always()
128+ with :
129+ name : frontend-test-reports
130+ path : |
131+ booklore-ui/test-results/vitest-results.xml
132+ retention-days : 30
133+
134+ - name : Validate Frontend Test Results
135+ if : steps.frontend_tests.outcome == 'failure'
136+ run : |
137+ echo "❌ Frontend tests failed"
138+ exit 1
139+
140+ build-and-release :
141+ needs : [ backend-tests, frontend-tests ]
142+ if : needs.backend-tests.result == 'success' && needs.frontend-tests.result == 'success'
143+ runs-on : ubuntu-latest
35144 permissions :
36145 contents : write
37146 packages : write
@@ -62,28 +171,6 @@ jobs:
62171 - name : Set Up Docker Buildx
63172 uses : docker/setup-buildx-action@v3
64173
65- - name : Set Up JDK 21
66- uses : actions/setup-java@v5
67- with :
68- java-version : ' 21'
69- distribution : ' temurin'
70- cache : ' gradle'
71-
72- - name : Set Up Node.js
73- uses : actions/setup-node@v4
74- with :
75- node-version : ' 22'
76- cache : ' npm'
77- cache-dependency-path : booklore-ui/package-lock.json
78-
79- - name : Install Frontend Dependencies
80- working-directory : ./booklore-ui
81- run : npm ci --force
82-
83- - name : Execute Frontend Tests
84- working-directory : ./booklore-ui
85- run : npm run test:ci
86-
87174 - name : Retrieve Latest Master Version Tag
88175 id : get_version
89176 run : |
0 commit comments