Code: Adding extra layer of protection v2 #11
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ "main", "develop", "feature/**", "fix/**" ] | |
| pull_request: | |
| branches: [ "develop", "main" ] | |
| jobs: | |
| build-and-test: | |
| name: Build & Test (Java 17) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Java 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: maven # met le dépôt Maven en cache → builds 2x plus rapides | |
| - name: Build & run tests | |
| run: ./mvnw test --no-transfer-progress | |
| - name: Upload Surefire reports on failure | |
| if: failure() # s'exécute UNIQUEMENT si les tests échouent | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: surefire-reports | |
| path: target/surefire-reports/ | |
| retention-days: 7 |