Skip to content

Bump actions/setup-java from 3 to 4 #65

Bump actions/setup-java from 3 to 4

Bump actions/setup-java from 3 to 4 #65

Workflow file for this run

name: Java CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
matrix-build:
name: Build and test with Java ${{ matrix.java }}
strategy:
matrix:
java: ['17', '21']
env:
DEFAULT_JAVA: '17'
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.java }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache SonarQube packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-sonar-
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'gradle'
- name: Build with Java ${{ matrix.java }}
run: ./gradlew clean build --info -PjavaVersion=${{matrix.java}}
- name: Publish Test Report
uses: scacap/action-surefire-report@v1
if: ${{ always() && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }}
with:
report_paths: '**/build/test-results/*/TEST-*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Sonar analysis
if: ${{ env.DEFAULT_JAVA == matrix.java && env.SONAR_TOKEN != null }}
run: ./gradlew sonarqube -Dsonar.token=$SONAR_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
build:
name: Build and test with all Java versions
needs: matrix-build
runs-on: ubuntu-latest
continue-on-error: false
steps:
- run: echo Build successful