From ee47ef535404a660bb356fa2c14a5942bcab93ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Rodr=C3=ADguez=20Ponce?= Date: Tue, 16 Jan 2024 12:19:33 +0100 Subject: [PATCH] Use Java 21 for Sonarcloud plugin (#7622) Sonarcloud analyzer now requires at least Java 17. --- .github/workflows/sonarcloud.yml | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 72c6169460..aa0ecffca4 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -2,9 +2,7 @@ name: SonarCloud QA on: push: branches: - - main - - 4.0.x - - 3.12.x + - geocat_v4.2.3_report_custom pull_request: types: [opened, synchronize, reopened] jobs: @@ -19,12 +17,9 @@ jobs: with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis submodules: 'recursive' - # For building GeoNetwork, JDK8 is necessary, but for running - # the SonarQube plugin, JDK11 is necessary. - # So, first install JDK 8, build GeoNetwork, then install JDK11 - # and run SonarQube: - - name: Set up JDK 8 - uses: actions/setup-java@v3.10.0 + show-progress: 'false' + - name: Set up JDK 11 + uses: actions/setup-java@v4.0.0 with: java-version: 8 distribution: 'temurin' @@ -37,11 +32,13 @@ jobs: restore-keys: ${{ runner.os }}-sonar - name: Build GN run: mvn -B package -DskipTests - - name: Set up JDK 11 - uses: actions/setup-java@v3.10.0 + + - name: Set up JDK 21 # Sonarcloud analyzer needs at least JDK 17 + uses: actions/setup-java@v4.0.0 with: distribution: 'temurin' - java-version: '11' + java-version: '21' + cache: 'maven' - name: Analyze with Sonar env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any