Run tests with every supported Spring Boot version #160
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: Build Java Core Library | |
| on: | |
| pull_request: | |
| push: | |
| branches: [ "master" ] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| java: [ '17', '21' ] | |
| spring-boot-version: ['3.0.13', '3.1.12', '3.2.12', '3.3.12', '3.4.6', '3.5.0'] | |
| name: Test with Java ${{ matrix.Java }} / Spring Boot ${{ matrix.spring-boot-version }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: ${{ matrix.java }} | |
| - name: Update Spring Boot version | |
| run: | | |
| ./gradlew useSpringBootVersion -PspringBootVersion=${{ matrix.spring-boot-version }} | |
| - name: Run tests and generate reports | |
| run: ./gradlew testAndReport | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: report-java-${{ matrix.java }}-${{ matrix.spring-boot-version }} | |
| path: build/reports/** | |
| retention-days: 5 | |
| - name: Run Sonar analysis | |
| if: matrix.java == '17' && matrix.spring-boot-version == '3.5.0' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: ./gradlew sonar -x test --no-watch-fs | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: [test] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Run build with Gradle Wrapper | |
| run: ./gradlew build -x test | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jar | |
| path: build/libs/** | |
| retention-days: 5 |