ci: update build.yml (#310) #318
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| java: ["17", "21"] | |
| name: jdk-${{ matrix.java }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK ${{ matrix.java }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ matrix.java }} | |
| distribution: temurin | |
| - name: Validate Gradle wrapper | |
| uses: gradle/wrapper-validation-action@v2 | |
| continue-on-error: true | |
| - name: Setup Gradle | |
| uses: gradle/gradle-build-action@v2 | |
| with: | |
| cache-read-only: false | |
| - name: Build with Gradle | |
| run: ./gradlew build --no-daemon --stacktrace | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-java-${{ matrix.java }} | |
| path: | | |
| **/build/test-results/**/*.xml | |
| **/build/reports/tests/**/* | |
| retention-days: 7 | |
| - name: Upload build reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-reports-java-${{ matrix.java }} | |
| path: | | |
| **/build/reports/**/* | |
| retention-days: 7 |