Skip to content

Commit aed6a78

Browse files
committed
Leave the Gradle plugin's tests out of the JDK 27 job
On JDK 27 every TestKit build failed with "BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 71": Gradle 9.7.1 does not run on Java 27, and TestKit runs the builds on the test JVM. The formatter's own tests all pass there. Each leg of the matrix now names its extra Gradle arguments and the reason for them, empty for 25 and 26. The 27 leg passes -x :gradle-open-java-format:test, and the job shows the reason as a notice, so it is visible in the run and not only in a YAML comment.
1 parent 4e6ca5e commit aed6a78

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,19 @@ jobs:
4848
strategy:
4949
fail-fast: false
5050
matrix:
51-
jdk: [25, 26, 27]
51+
include:
52+
- jdk: 25
53+
gradle_args: ''
54+
gradle_args_reason: ''
55+
- jdk: 26
56+
gradle_args: ''
57+
gradle_args_reason: ''
58+
- jdk: 27
59+
gradle_args: -x :gradle-open-java-format:test
60+
gradle_args_reason: >-
61+
Gradle 9.7.1 does not run on Java 27 yet, and the Gradle plugin's tests run their TestKit builds on
62+
the test JVM, where they fail with "Unsupported class file major version 71". Those tests are left
63+
out until the wrapper's Gradle supports Java 27.
5264
steps:
5365
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5466

@@ -66,10 +78,17 @@ jobs:
6678
distribution: temurin
6779
java-version: '21'
6880

81+
- name: Explain the extra Gradle arguments
82+
if: ${{ matrix.gradle_args != '' }}
83+
env:
84+
GRADLE_ARGS: ${{ matrix.gradle_args }}
85+
REASON: ${{ matrix.gradle_args_reason }}
86+
run: echo "::notice title=JDK ${{ matrix.jdk }} runs with $GRADLE_ARGS::$REASON"
87+
6988
# Gradle does not look into the runner's tool cache, so it is told where the test JDK is.
7089
- name: Build
7190
run: >-
72-
./gradlew test -PjavaRuntime=${{ matrix.jdk }}
91+
./gradlew test -PjavaRuntime=${{ matrix.jdk }} ${{ matrix.gradle_args }}
7392
-Porg.gradle.java.installations.paths=${{ steps.test-jdk.outputs.path }}
7493
7594
- name: Publish Test Report

0 commit comments

Comments
 (0)