Update JUnit to 6.1.0 (latest stable version) #3
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/CD | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| java: [ '21' ] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK ${{ matrix.java }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{ matrix.java }} | |
| cache: 'maven' | |
| - name: Build with Maven | |
| run: mvn -B clean verify | |
| - name: Run tests | |
| run: mvn -B test | |
| - name: Generate test report | |
| if: always() | |
| run: mvn surefire-report:report-only | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-java-${{ matrix.java }} | |
| path: target/surefire-reports/ | |
| retention-days: 30 | |
| code-quality: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| cache: 'maven' | |
| - name: OWASP Dependency Check | |
| run: mvn org.owasp:dependency-check-maven:check -DfailBuildOnCVSS=7 | |
| continue-on-error: true | |
| - name: Upload OWASP Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dependency-check-report | |
| path: target/dependency-check-report.html | |
| retention-days: 30 |