Skip to content

Commit d5b8c15

Browse files
committed
Build with JDK 11 when required
1 parent fb0c695 commit d5b8c15

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

.github/workflows/build.yml

+22-1
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,15 @@ jobs:
9494
.gradle/wrapper
9595
# refresh cache every month to avoid unlimited growth
9696
key: gradle-examples-${{ matrix.db }}-${{ steps.get-date.outputs.yearmonth }}
97+
- name: Set up JDK 11
98+
uses: actions/[email protected]
99+
if: ${{ startsWith( inputs.branch, 'wip/2' ) }}
100+
with:
101+
distribution: 'temurin'
102+
java-version: 11
97103
- name: Set up JDK 17
98104
uses: actions/[email protected]
105+
if: ${{ !startsWith( inputs.branch, 'wip/2' ) }}
99106
with:
100107
distribution: 'temurin'
101108
java-version: 17
@@ -136,8 +143,15 @@ jobs:
136143
.gradle/wrapper
137144
# refresh cache every month to avoid unlimited growth
138145
key: gradle-db-${{ matrix.db }}-${{ steps.get-date.outputs.yearmonth }}
146+
- name: Set up JDK 11
147+
uses: actions/[email protected]
148+
if: ${{ startsWith( inputs.branch, 'wip/2' ) }}
149+
with:
150+
distribution: 'temurin'
151+
java-version: 11
139152
- name: Set up JDK 17
140153
uses: actions/[email protected]
154+
if: ${{ !startsWith( inputs.branch, 'wip/2' ) }}
141155
with:
142156
distribution: 'temurin'
143157
java-version: 17
@@ -244,13 +258,20 @@ jobs:
244258
- name: Export path to JDK ${{ matrix.java.name }}
245259
id: testjdk-exportpath
246260
run: echo "::set-output name=path::${JAVA_HOME}"
247-
# Always use JDK 11 to build the main code: that's what we use for releases.
261+
- name: Set up JDK 11
262+
uses: actions/[email protected]
263+
with:
264+
distribution: 'temurin'
265+
java-version: 11
266+
check-latest: true
267+
if: ${{ startsWith( inputs.branch, 'wip/2' ) }}
248268
- name: Set up JDK 17
249269
uses: actions/[email protected]
250270
with:
251271
distribution: 'temurin'
252272
java-version: 17
253273
check-latest: true
274+
if: ${{ !startsWith( inputs.branch, 'wip/2' ) }}
254275
- name: Export path to JDK 11
255276
id: mainjdk-exportpath
256277
run: echo "::set-output name=path::${JAVA_HOME}"

0 commit comments

Comments
 (0)