Skip to content

Commit 1844654

Browse files
authored
Use JDK 21 Graal in the CI (#839)
1 parent 6315677 commit 1844654

9 files changed

Lines changed: 34 additions & 11 deletions

File tree

.github/actions/prepare-environment/action.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ inputs:
99
java-version:
1010
description: 'Java version to use'
1111
required: false
12-
default: '17'
12+
default: '17.0.12'
13+
graal-java-version:
14+
description: 'GraalVM Java version to use for tests (sets GRAALVM_HOME, leaves JAVA_HOME unchanged)'
15+
required: false
16+
default: '21'
1317
push-access:
1418
description: 'Does this workflow require push access?'
1519
required: false
@@ -22,12 +26,19 @@ inputs:
2226
runs:
2327
using: "composite"
2428
steps:
25-
- name: "🔧 Install GraalVM (JDK${{ inputs.java-version }})"
26-
uses: graalvm/setup-graalvm@main
29+
- name: "🔧 Install Gradle JDK (JDK${{ inputs.java-version }})"
30+
uses: actions/setup-java@v4
2731
with:
32+
distribution: 'graalvm'
2833
java-version: ${{ inputs.java-version }}
34+
- name: "🔧 Install GraalVM for tests (JDK${{ inputs.graal-java-version }})"
35+
if: ${{ inputs.graal-java-version != '' }}
36+
uses: graalvm/setup-graalvm@main
37+
with:
38+
java-version: ${{ inputs.graal-java-version }}
2939
distribution: 'graalvm'
3040
github-token: ${{ inputs.github-token }}
41+
set-java-home: 'false'
3142
- name: "🔒 Configure push access"
3243
if: ${{ inputs.push-access == '1' }}
3344
shell: "bash"

.github/workflows/deploy-documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
java-version: [ 17 ]
21+
java-version: [ 17.0.12 ]
2222
os: [ ubuntu-22.04 ]
2323
steps:
2424
- name: "☁ Checkout repository"

.github/workflows/deploy-snapshots.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
java-version: [ 17 ]
23+
java-version: [ 17.0.12 ]
2424
os: [ ubuntu-22.04 ]
2525
steps:
2626
- name: "☁ Checkout repository"

.github/workflows/test-graalvm-metadata.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
java-version: [ 17 ]
29+
java-version: [ 17.0.12 ]
3030
os: [ ubuntu-22.04 ]
3131
steps:
3232
- name: "☁️ Checkout repository"

.github/workflows/test-junit-platform-native.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
java-version: [ 17 ]
29+
java-version: [ 17.0.12 ]
3030
os: [ ubuntu-22.04 ]
3131
steps:
3232
- name: "☁️ Checkout repository"

.github/workflows/test-native-gradle-plugin.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
uses: ./.github/actions/prepare-environment
5959
with:
6060
java-version: ${{ matrix.java-version }}
61+
graal-java-version: '21'
6162
github-token: ${{ secrets.GITHUB_TOKEN }}
6263
- name: "❓ Check and test the plugin"
6364
run: ./gradlew :native-gradle-plugin:functionalTest -DgradleVersion="${{ matrix.gradle-version }}" --tests ${{ matrix.test }}
@@ -103,6 +104,7 @@ jobs:
103104
uses: ./.github/actions/prepare-environment
104105
with:
105106
java-version: ${{ matrix.java-version }}
107+
graal-java-version: '21'
106108
github-token: ${{ secrets.GITHUB_TOKEN }}
107109
- name: "❓ Check and test the plugin with configuration cache"
108110
run: ./gradlew :native-gradle-plugin:configCacheFunctionalTest -DgradleVersion="${{ matrix.gradle-config-cache-version }}" --tests ${{ matrix.test }}
@@ -120,7 +122,7 @@ jobs:
120122
strategy:
121123
fail-fast: false
122124
matrix:
123-
java-version: [ 17 ]
125+
java-version: [ 17.0.12 ]
124126
os: [ ubuntu-22.04 ]
125127
steps:
126128
- name: "☁️ Checkout repository"
@@ -129,6 +131,7 @@ jobs:
129131
uses: ./.github/actions/prepare-environment
130132
with:
131133
java-version: ${{ matrix.java-version }}
134+
graal-java-version: '21'
132135
github-token: ${{ secrets.GITHUB_TOKEN }}
133136
- name: "❓ Unit tests and inspections"
134137
run: ./gradlew :native-gradle-plugin:test :native-gradle-plugin:inspections
@@ -146,7 +149,7 @@ jobs:
146149
strategy:
147150
fail-fast: false
148151
matrix:
149-
java-version: [ 17 ]
152+
java-version: [ 17.0.12 ]
150153
os: [ ubuntu-22.04 ]
151154
steps:
152155
- name: "☁️ Checkout repository"
@@ -155,6 +158,7 @@ jobs:
155158
uses: ./.github/actions/prepare-environment
156159
with:
157160
java-version: ${{ matrix.java-version }}
161+
graal-java-version: ''
158162
github-token: ${{ secrets.GITHUB_TOKEN }}
159163
- name: "🔧 Install GraalVM (dev)"
160164
uses: graalvm/setup-graalvm@main

.github/workflows/test-native-maven-plugin.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ jobs:
5959
uses: ./.github/actions/prepare-environment
6060
with:
6161
java-version: ${{ matrix.java-version }}
62+
graal-java-version: '21'
6263
github-token: ${{ secrets.GITHUB_TOKEN }}
6364
- name: "❓ Check and test the plugin"
6465
run: ./gradlew :native-maven-plugin:functionalTest --no-daemon --fail-fast --tests ${{ matrix.test }}
@@ -77,7 +78,7 @@ jobs:
7778
strategy:
7879
fail-fast: false
7980
matrix:
80-
java-version: [ 17 ]
81+
java-version: [ 17.0.12 ]
8182
os: [ ubuntu-22.04 ]
8283
steps:
8384
- name: "☁️ Checkout repository"
@@ -86,6 +87,7 @@ jobs:
8687
uses: ./.github/actions/prepare-environment
8788
with:
8889
java-version: ${{ matrix.java-version }}
90+
graal-java-version: ''
8991
github-token: ${{ secrets.GITHUB_TOKEN }}
9092
- name: "🔧 Install GraalVM (dev)"
9193
uses: graalvm/setup-graalvm@main

build-logic/common-plugins/src/main/groovy/org.graalvm.build.github-actions-helper.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import groovy.json.JsonOutput
22

33
def matrixDefault = [
4-
"java-version": [ "17" ],
4+
"java-version": [ "17.0.12" ],
55
"os": [ "ubuntu-22.04", "windows-latest", "macos-latest" ]
66
]
77

samples/java-application-with-custom-packaging/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@
127127
<artifactId>jakarta.annotation-api</artifactId>
128128
<scope>compile</scope>
129129
</dependency>
130+
<dependency>
131+
<groupId>javax.inject</groupId>
132+
<artifactId>javax.inject</artifactId>
133+
<version>1</version>
134+
<scope>compile</scope>
135+
</dependency>
130136
<dependency>
131137
<groupId>ch.qos.logback</groupId>
132138
<artifactId>logback-classic</artifactId>

0 commit comments

Comments
 (0)