Skip to content

re-use JDK if gradle version is the same. #289

re-use JDK if gradle version is the same.

re-use JDK if gradle version is the same. #289

Workflow file for this run

name: Gradle Check
on:
push:
branches:
- master
pull_request:
jobs:
check:
strategy:
matrix:
os: [ ubuntu-latest, macOS-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v3
- uses: actions/setup-java@v4
if: ${{ vars.GRADLE_JAVA_VERSION != vars.JAVA_VERSION }}
with:
distribution: ${{ vars.JAVA_VENDOR }}
java-version: ${{ vars.GRADLE_JAVA_VERSION }}
java-package: jre
cache: 'gradle'
- run: printf "org.gradle.java.home=%s" "$JAVA_HOME" > gradle.properties
if: ${{ vars.GRADLE_JAVA_VERSION != vars.JAVA_VERSION }}
- uses: actions/setup-java@v4
with:
distribution: ${{ vars.JAVA_VENDOR }}
java-version: ${{ vars.JAVA_VERSION }}
check-latest: true
- run: printf "org.gradle.java.home=%s" "$JAVA_HOME" > gradle.properties
if: ${{ vars.GRADLE_JAVA_VERSION == vars.JAVA_VERSION }}
- run: printf "\norg.gradle.java.installations.paths=%s" "$JAVA_HOME" >> gradle.properties
- run: java --version
- name: Gradle Check
run: ./gradlew -PtargetJava=${{ vars.JAVA_VERSION }} check --stacktrace --no-daemon