Skip to content

Commit 8d036a2

Browse files
committed
[#2034] Build with JDK 11 when required
`workflow_dispatch` uses the workflow defined in the `main` branch. So, we need different JDK depending on the branch we are building using the scheduler or manually: * Hibernate Reactive 2.* (with ORM 6) requires JDK 11 * Hibernate Reactive 3.* (with ORM 7) requires JDK 17
1 parent 7ba99e5 commit 8d036a2

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/build.yml

+23-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,14 @@ jobs:
9999
.gradle/wrapper
100100
# refresh cache every month to avoid unlimited growth
101101
key: gradle-examples-${{ matrix.db }}-${{ steps.get-date.outputs.yearmonth }}
102+
- name: Set up JDK 11
103+
if: ${{ startsWith( inputs.branch, 'wip/2' ) }}
104+
uses: actions/[email protected]
105+
with:
106+
distribution: 'temurin'
107+
java-version: 11
102108
- name: Set up JDK 17
109+
if: ${{ !startsWith( inputs.branch, 'wip/2' ) }}
103110
uses: actions/[email protected]
104111
with:
105112
distribution: 'temurin'
@@ -141,8 +148,16 @@ jobs:
141148
.gradle/wrapper
142149
# refresh cache every month to avoid unlimited growth
143150
key: gradle-db-${{ matrix.db }}-${{ steps.get-date.outputs.yearmonth }}
151+
- name: Set up JDK 11
152+
if: ${{ startsWith( inputs.branch, 'wip/2' ) }}
153+
uses: actions/[email protected]
154+
with:
155+
distribution: 'temurin'
156+
java-version: 11
144157
- name: Set up JDK 17
158+
if: ${{ !startsWith( inputs.branch, 'wip/2' ) }}
145159
uses: actions/[email protected]
160+
146161
with:
147162
distribution: 'temurin'
148163
java-version: 17
@@ -249,8 +264,15 @@ jobs:
249264
- name: Export path to JDK ${{ matrix.java.name }}
250265
id: testjdk-exportpath
251266
run: echo "::set-output name=path::${JAVA_HOME}"
252-
# Always use JDK 11 to build the main code: that's what we use for releases.
267+
- name: Set up JDK 11
268+
if: ${{ startsWith( inputs.branch, 'wip/2' ) }}
269+
uses: actions/[email protected]
270+
with:
271+
distribution: 'temurin'
272+
java-version: 11
273+
check-latest: true
253274
- name: Set up JDK 17
275+
if: ${{ !startsWith( inputs.branch, 'wip/2' ) }}
254276
uses: actions/[email protected]
255277
with:
256278
distribution: 'temurin'

0 commit comments

Comments
 (0)