Repository navigation
53 lines (45 loc) · 1.49 KB
/
Copy pathtests.yml
File metadata and controls
53 lines (45 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Tests
# Lance la suite de tests (+ couverture JaCoCo) sur chaque push et pull request.
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Evite d'accumuler des runs redondants sur une meme branche/PR.
concurrency:
group: tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# JDK 21 (Temurin) : Spring Boot 3.2 supporte 17-21 ; on cible 21,
# c'est la version testee en local sur ce projet.
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
cache: maven
- name: Build and run tests (with JaCoCo)
# 'verify' declenche : compile -> test (rapport JaCoCo) -> check (seuil de couverture)
run: ./mvnw -B --no-transfer-progress verify
# Publie les rapports de tests JUnit meme si la build echoue.
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: target/surefire-reports/
if-no-files-found: ignore
# Publie le rapport de couverture JaCoCo (HTML + XML).
- name: Upload JaCoCo coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: jacoco-report
path: target/site/jacoco/
if-no-files-found: ignore