Skip to content

Commit

Permalink
Use Java 21 for Sonarcloud plugin (#7622)
Browse files Browse the repository at this point in the history
Sonarcloud analyzer now requires at least Java 17.
  • Loading branch information
juanluisrp authored and cmangeat committed Jan 23, 2024
1 parent 730fe76 commit ee47ef5
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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/[email protected]
show-progress: 'false'
- name: Set up JDK 11
uses: actions/[email protected]
with:
java-version: 8
distribution: 'temurin'
Expand All @@ -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/[email protected]

- name: Set up JDK 21 # Sonarcloud analyzer needs at least JDK 17
uses: actions/[email protected]
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
Expand Down

0 comments on commit ee47ef5

Please sign in to comment.