Skip to content

Commit

Permalink
Sonar requires JDK 17
Browse files Browse the repository at this point in the history
  • Loading branch information
ascheman committed Mar 28, 2024
1 parent 403b359 commit aa70f75
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Gradle Build and Test
name: Build and Test
on:
pull_request:
push:
Expand All @@ -10,12 +10,22 @@ jobs:
gradle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
- name: Check out
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
# Always build with JDK 8 initially
java-version: 8
# SonarQube requires JDK 17 or higher
java-version: 17

- name: Cache JDK
uses: actions/cache@v4
with:
path: ~/.jdk
key: ${{ runner.os }}-jdk
restore-keys: ${{ runner.os }}-jdk

- name: Setup Gradle
uses: gradle/gradle-build-action@v3
Expand Down Expand Up @@ -65,12 +75,6 @@ jobs:
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- uses: actions/setup-java@v4
with:
distribution: temurin
# Sonar needs JDK 17 or higher
java-version: 17

- name: Analyze with SonarCloud
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
Expand Down

0 comments on commit aa70f75

Please sign in to comment.