Inform Gradle where to locate pre-installed JDKs

This commit is contained in:
daz 2023-08-19 18:11:04 -06:00
parent b17d107b8c
commit a07019c726
No known key found for this signature in database
2 changed files with 40 additions and 0 deletions

View file

@ -80,3 +80,27 @@ jobs:
run: |
grep -q 'Eclipse Temurin JDK 16' output.txt || (echo "::error::Did not detect setup-java installed JDK 16" && exit 1)
grep -q 'Eclipse Temurin JDK 20' output.txt || (echo "::error::Did not detect setup-java installed JDK 20" && exit 1)
# Test that predefined JDK detection property is not overwritten by action
check-no-overwrite:
strategy:
matrix:
os: ${{fromJSON(inputs.runner-os)}}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Download distribution if required
uses: ./.github/actions/download-dist
- name: Configure java installations env var in Gradle User Home
shell: bash
run: |
mkdir -p ~/.gradle
echo "org.gradle.java.installations.fromEnv=XXXXX" > ~/.gradle/gradle.properties
- name: Setup Gradle
uses: ./
- name: Check gradle.properties
shell: bash
run: |
cat ~/.gradle/gradle.properties
grep -q 'org.gradle.java.installations.fromEnv=JAVA_HOME' && exit 1