Conversation
There was a problem hiding this comment.
Pull request overview
Updates the CI workflow’s JDK provisioning to move off Temurin, enable Gradle caching in Java setup steps, and adjust early-access (EA) testing toward newer JDKs.
Changes:
- Switch
actions/setup-javadistribution from Temurin to Zulu across jobs. - Add
cache: 'gradle'toactions/setup-javasteps. - Change EA configuration toward JDK 27 and add an Oracle EA setup step (intended for EA runs).
Comments suppressed due to low confidence (5)
.github/workflows/ci.yml:101
- This job now enables
cache: 'gradle'inactions/setup-javaand also runsgradle/actions/setup-gradle(which configures Gradle caching). Consider using only one caching mechanism to avoid redundant cache save/restore work and potential cache churn.
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java_version }}
distribution: 'zulu'
cache: 'gradle'
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6.0.1
# Setup for misc tests
.github/workflows/ci.yml:228
- In
otherjdks,actions/setup-javais configured withcache: 'gradle'while the job also runsgradle/actions/setup-gradlelater. Using both caching mechanisms is redundant; consider keeping caching in one place to reduce CI overhead.
- name: Set up JDK 21 for Gradle to run on
uses: actions/setup-java@v5
with:
# Install JDK 21 first, to make it available to Gradle using `gradle.properties` below.
java-version: 21
distribution: 'zulu'
cache: 'gradle'
- name: Set up JDK ${{ matrix.java.version }}
if: ${{ matrix.java.version != 'EA' }}
uses: actions/setup-java@v5
with:
# Install the requested JDK second, to make it the default on which everything else runs.
java-version: ${{ matrix.java.version }}
distribution: 'zulu'
cache: 'gradle'
- name: Set up JDK $JDK_EA_MAJOR
if: ${{ matrix.java.version == 'EA' }}
uses: oracle-actions/setup-java@v1
with:
# Install the requested EA JDK second, to make it the default on which everything else runs.
website: jdk.java.net
release: ${{ matrix.java.version }}
cache: 'gradle'
- name: Inject JAVA_HOME_21_64 into `gradle.properties` to always use JDK 21 for Gradle
run: mkdir ~/.gradle && echo "org.gradle.java.home=$JAVA_HOME_21_X64" >> ~/.gradle/gradle.properties
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6.0.1
- name: Install misc dependencies
.github/workflows/ci.yml:287
- This job enables
cache: 'gradle'inactions/setup-javaand also usesgradle/actions/setup-gradlefor Gradle configuration/caching. Consider removing one of these caches to avoid duplicated cache operations.
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java_version }}
distribution: 'zulu'
cache: 'gradle'
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6.0.1
.github/workflows/ci.yml:143
- The PR title indicates testing on JDK 26 stable and JDK 27 EA, but the
otherjdksmatrix still lists{version: '25', ...}and{version: 'ea', ...}. Unless those are updated, CI will continue running the newest non‑LTS on 25 rather than 26, which doesn’t match the intended coverage.
JDK_EA_MAJOR: "27"
strategy:
fail-fast: true
matrix:
# `jspecify-conformance` and `jspecify-reference-checker` only tested on JDK 21.
script: ['cftests-junit', 'cftests-nonjunit', 'cftests-junit-jdk21',
'typecheck-part1', 'typecheck-part2',
'guava', 'plume-lib',
'daikon-part1', 'daikon-part2',
'misc']
# JDK 21 used by `sanity` and `remainder` before.
# Keep all LTS versions and the newest non-LTS version.
# `experimental` versions use the $version compiler, but run on JDK 21.
java: [{version: '8', experimental: false},
{version: '11', experimental: false},
{version: '17', experimental: false},
{version: '25', experimental: false},
{version: 'ea', experimental: true}]
.github/workflows/ci.yml:42
actions/setup-javais now configured withcache: 'gradle'while the workflow also runsgradle/actions/setup-gradle, which already sets up Gradle caching (per the comment immediately below). Using both caches is redundant and can increase cache restore/save time or cause cache churn; consider relying on the Gradle action’s caching and removing thesetup-javaGradle cache, or vice versa, but not both.
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java_version }}
distribution: 'zulu'
cache: 'gradle'
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6.0.1
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/ci.yml
Outdated
| java-version: ${{ matrix.java.version }} | ||
| distribution: 'zulu' | ||
| cache: 'gradle' | ||
| - name: Set up JDK $JDK_EA_MAJOR |
There was a problem hiding this comment.
Step name Set up JDK $JDK_EA_MAJOR won’t interpolate $JDK_EA_MAJOR in GitHub Actions YAML; it will be shown literally. Use the Actions expression syntax (e.g., ${{ env.JDK_EA_MAJOR }}) if you want the major version to appear in the step name.
| - name: Set up JDK $JDK_EA_MAJOR | |
| - name: Set up JDK ${{ env.JDK_EA_MAJOR }} |
|
@thisisalexandercook Could you take a look whether we can specify a specific EA build to use? Otherwise we might again run into random failures when an EA build breaks us. |
|
@thisisalexandercook Oracle Actions are documented here: https://github.com/oracle-actions/setup-java Should I merge this PR now and you follow up with those improvements? Or do you want to start a new PR that builds on this one and already fixes these issues? |
@wmdietl I've opened a follow-up PR that makes these changes directly against this branch: #1616 |
Fixes #1565.