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