Skip to content

Commit 2e01bc6

Browse files
authored
Always run CI on the latest Java (#1193)
1 parent fb36ee3 commit 2e01bc6

File tree

7 files changed

+26
-7
lines changed

7 files changed

+26
-7
lines changed

.github/renovate.json5

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,31 @@
3131
"allowedVersions": "!/(-alpha|-Alpha|-ALPHA|-beta|-Beta|-BETA|-milestone|-m|-SNAPSHOT)/"
3232
}
3333
],
34+
ignorePresets: [
35+
// Ensure we get the latest version and are not pinned to old versions.
36+
'workarounds:javaLTSVersions',
37+
],
3438
"customManagers": [
3539
{
3640
"customType": "regex",
3741
"fileMatch": ["\\.versions.toml$"],
3842
"matchStrings": ["(^|\n)(?<depName>gradle) *= *\"(?<currentValue>.*)\""],
3943
"depNameTemplate": "gradle",
4044
"datasourceTemplate": "gradle-version"
45+
},
46+
// Update .java-version file with the latest JDK version.
47+
{
48+
customType: 'regex',
49+
managerFilePatterns: [
50+
'/\\.java-version$/',
51+
],
52+
matchStrings: [
53+
'(?<currentValue>.*)\\n',
54+
],
55+
datasourceTemplate: 'java-version',
56+
depNameTemplate: 'java',
57+
// Only write the major version.
58+
extractVersionTemplate: '^(?<version>\\d+)',
4159
}
4260
]
4361
}

.github/workflows/.java-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
25

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
test_java_version:
2121
- 11 # Minimum supported version.
2222
- 17 # Supported by all tests.
23-
- 25 # Latest supported version.
23+
- latest # Latest supported version, the value syncs with the .java-version file.
2424
test_config_method: ["DSL", "PROPERTIES", "BASE"]
2525

2626
steps:
@@ -31,7 +31,7 @@ jobs:
3131
uses: actions/setup-java@v5
3232
with:
3333
distribution: zulu
34-
java-version: 25
34+
java-version-file: .github/workflows/.java-version
3535

3636
- name: Accept Android SDK license
3737
run: echo -e "24333f8a63b6825ea9c5514f83c2829b004d1fee\n" > "$ANDROID_HOME/licenses/android-sdk-license"

.github/workflows/publish-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
uses: actions/setup-java@v5
4040
with:
4141
distribution: zulu
42-
java-version: 25
42+
java-version-file: .github/workflows/.java-version
4343

4444
- uses: gradle/actions/setup-gradle@v5
4545
with:

.github/workflows/publish-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: actions/setup-java@v5
2222
with:
2323
distribution: zulu
24-
java-version: 25
24+
java-version-file: .github/workflows/.java-version
2525

2626
- name: Set version for tag
2727
run: |

.github/workflows/publish-snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: actions/setup-java@v5
2828
with:
2929
distribution: zulu
30-
java-version: 25
30+
java-version-file: .github/workflows/.java-version
3131

3232
- name: Set version
3333
run: |

plugin/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ val integrationTest by tasks.registering(Test::class) {
138138
classpath = integrationTestSourceSet.runtimeClasspath
139139

140140
val testJavaVersion = providers.gradleProperty("testJavaVersion").orNull
141-
if (testJavaVersion != null) {
141+
if (testJavaVersion != null && testJavaVersion != "latest") {
142142
javaLauncher = javaToolchains.launcherFor {
143-
languageVersion = JavaLanguageVersion.of(testJavaVersion.toInt())
143+
languageVersion = JavaLanguageVersion.of(testJavaVersion)
144144
}
145145
}
146146

0 commit comments

Comments
 (0)