Skip to content

Commit

Permalink
Make SonarCloud job use Java 17 (#782 / #784)
Browse files Browse the repository at this point in the history
SonarCloud is moving away from supporting Java 11.
This PR separates the job from the main build into its own step
and configures it to use Java 17.

Closes: #782
PR: #784
  • Loading branch information
Michael1993 committed Nov 6, 2023
1 parent 22c6940 commit 37195b7
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ jobs:
# experience with little build time and sufficient feedback. Therefore, we
# only build this on our default Java version but for all operating systems
# we are supporting. This allows for a fast execution and fast feedback. The
# extended tests will run later under certain conditions. If the OS is
# Ubuntu, we also run the SonarCloud analysis.
# extended tests will run later under certain conditions.
basic:
runs-on: ${{ matrix.os }}-latest
needs: validation
Expand All @@ -56,6 +55,26 @@ jobs:
matrix:
os: [ubuntu, macos, windows]
name: with Java 11 on ${{ matrix.os }}
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
cache: 'gradle'
- name: Gradle build
uses: gradle/gradle-build-action@v2
with:
arguments: --refresh-dependencies --stacktrace --scan clean build -x spotlessCheck

# SonarCloud analysis
sonar-cloud-analysis:
runs-on: ubuntu-latest
needs: validation
timeout-minutes: 15
name: SonarCloud analysis
steps:
- name: Check out repo
uses: actions/checkout@v4
Expand All @@ -65,11 +84,10 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: temurin
cache: 'gradle'
- name: Cache SonarCloud results
if: ${{ matrix.os == 'ubuntu' }}
uses: actions/cache@v3
with:
path: ~/.sonar/cache/
Expand All @@ -79,7 +97,6 @@ jobs:
with:
arguments: --refresh-dependencies --stacktrace --scan clean build -x spotlessCheck
- name: SonarCloud analysis
if: ${{ matrix.os == 'ubuntu' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: "61ab2579215aa8a0024a2f9368fc1298fdecfd18"
Expand Down

0 comments on commit 37195b7

Please sign in to comment.