Skip to content

Update plugin com.diffplug.spotless to v8.5.1 #3731

Update plugin com.diffplug.spotless to v8.5.1

Update plugin com.diffplug.spotless to v8.5.1 #3731

Workflow file for this run

name: CI tests
on:
schedule:
- cron: '0 7 * * *' # Runs daily at 2:00 AM EST
pull_request:
push:
branches: [ "master" ]
# Configure GitHub Actions cancel in progress workflow to avoid redundant runs in pull requests.
# See: https://docs.github.com/en/enterprise-cloud@latest/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'heads/master')}}
jobs:
# Basic sanity tests on JDK 21.
sanity:
name: ${{ matrix.script }} on JDK ${{ matrix.java_version }}
runs-on: ubuntu-24.04
permissions:
contents: read
strategy:
matrix:
script: ['cftests-junit', 'cftests-nonjunit']
java_version: [21]
env:
JAVA_VERSION: ${{ matrix.java_version }}
USE_BAZEL_VERSION: "9.1.0"
steps:
- uses: actions/checkout@v6
- 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.1.0
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.19.0
if: ${{ matrix.script == 'cftests-nonjunit' }}
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Store build cache per workflow.
disk-cache: ${{ github.workflow }}
# Share repository cache between workflows.
repository-cache: true
- name: Run test script checker/bin-devel/test-${{ matrix.script }}
run: ./checker/bin-devel/test-${{ matrix.script }}.sh
# The remaining tests for JDK 21. Separate from `sanity` to allow parallelism with `otheros`.
remainder:
name: ${{ matrix.script }} on JDK ${{ matrix.java_version }}
runs-on: ubuntu-24.04
# Don't depend on sanity jobs, to have more parallelism.
# TODO: cancel these jobs if sanity fails.
# needs: sanity
permissions:
contents: read
strategy:
# Run all `remainder` tasks, even if one fails.
fail-fast: false
matrix:
# No need to run 'cftests-junit-jdk21' on JDK 21.
script: ['typecheck-part1', 'typecheck-part2',
'guava', 'plume-lib',
'daikon-part1', 'daikon-part2',
'jspecify-conformance', 'jspecify-reference-checker',
'misc']
java_version: [21]
env:
JAVA_VERSION: ${{ matrix.java_version }}
steps:
- uses: actions/checkout@v6
if: ${{ matrix.script != 'misc' }}
with:
fetch-depth: 1
- uses: actions/checkout@v6
if: ${{ matrix.script == 'misc' }}
with:
# CI diff needs more history - 0 fetches all history.
fetch-depth: 0
- 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.1.0
# Setup for misc tests
- name: Install misc dependencies
if: ${{ matrix.script == 'misc' }}
run: |
sudo apt update
sudo apt install -y --fix-missing \
asciidoctor shellcheck shfmt devscripts python3-pip \
texlive-latex-base texlive-latex-extra latexmk librsvg2-bin \
autoconf dia hevea latexmk libasound2-dev rsync pdf2svg \
libcups2-dev libfontconfig1-dev libx11-dev libxext-dev \
libxrender-dev libxrandr-dev libxtst-dev libxt-dev \
texlive-font-utils texlive-fonts-recommended texlive-latex-recommended
pip install black flake8 html5validator
- name: Run test script checker/bin-devel/test-${{ matrix.script }}
run: ./checker/bin-devel/test-${{ matrix.script }}.sh
otherjdks:
name: ${{ matrix.script }} on JDK ${{ matrix.java.version }}
runs-on: ubuntu-24.04
needs: [sanity, remainder]
permissions:
contents: read
env:
JAVA_VERSION: ${{ matrix.java.version }}
USE_BAZEL_VERSION: "9.1.0"
JDK_EA_MAJOR: "27"
JDK_EA_BUILD: "22"
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:
# Keep in sync with env.JDK_EA_MAJOR above.
# env context is not available in strategy.matrix, so the version is hard-coded here.
- {version: '27', experimental: true}
- {version: '26', experimental: false}
- {version: '25', experimental: false}
- {version: '17', experimental: false}
- {version: '11', experimental: false}
- {version: '8', experimental: false}
exclude:
# JDK 8 does not allow toolchains, so testing 'cftests-junit-jdk21' is unnecessary.
- script: 'cftests-junit-jdk21'
java: {version: '8'}
# Only run `typecheck*`, `guava`, and `misc` scripts on core versions,
# so exclude 11 and 17.
- script: 'typecheck-part1'
java: {version: '11'}
- script: 'typecheck-part1'
java: {version: '17'}
- script: 'typecheck-part2'
java: {version: '11'}
- script: 'typecheck-part2'
java: {version: '17'}
- script: 'guava'
java: {version: '11'}
- script: 'guava'
java: {version: '17'}
- script: 'misc'
java: {version: '8'}
- script: 'misc'
java: {version: '11'}
- script: 'misc'
java: {version: '17'}
# At least one plume-lib project no longer works on Java 8,
# so exclude 8, 11, and 17.
- script: 'plume-lib'
java: {version: '8'}
- script: 'plume-lib'
java: {version: '11'}
- script: 'plume-lib'
java: {version: '17'}
# Daikon produces 'this-escape' compiler warnings in JDK 22+.
# Exclude all versions here and just explicitly include with JDK 17.
- script: 'daikon-part1'
- script: 'daikon-part2'
include:
- script: 'daikon-part1'
java: {version: '17', experimental: false}
- script: 'daikon-part2'
java: {version: '17', experimental: false}
continue-on-error: ${{ matrix.java.experimental }}
steps:
- name: Check out sources
uses: actions/checkout@v6
if: ${{ matrix.script != 'misc' }}
with:
fetch-depth: 1
- name: Check out sources with all history
uses: actions/checkout@v6
if: ${{ matrix.script == 'misc' }}
with:
# CI diff needs more history - 0 fetches all history.
fetch-depth: 0
- 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 stable JDK ${{ matrix.java.version }}
if: ${{ matrix.java.version != env.JDK_EA_MAJOR }}
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 early-access JDK ${{ env.JDK_EA_MAJOR }}
if: ${{ matrix.java.version == env.JDK_EA_MAJOR }}
uses: oracle-actions/setup-java@v1
with:
# Install the requested EA JDK second, to make it the default on which everything else runs.
# Pin EA builds by direct archive URI.
# If the URI stops working, check for the updated pattern here:
# https://github.com/oracle-actions/setup-java/blob/main/jdk.java.net-uri.properties
uri: ${{ format('https://download.java.net/java/early_access/jdk{0}/{1}/GPL/openjdk-{0}-ea+{1}_linux-x64_bin.tar.gz', env.JDK_EA_MAJOR, env.JDK_EA_BUILD) }}
install-as-version: ${{ env.JDK_EA_MAJOR }}
- name: Inject JAVA_HOME_21_64 into `gradle.properties` to always use JDK 21 for Gradle
run: mkdir -p ~/.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.1.0
- name: Install misc dependencies
if: ${{ matrix.script == 'misc' }}
run: |
sudo apt update
sudo apt install -y --fix-missing \
asciidoctor shellcheck shfmt devscripts python3-pip \
texlive-latex-base texlive-latex-extra latexmk librsvg2-bin \
autoconf dia hevea latexmk libasound2-dev rsync pdf2svg \
libcups2-dev libfontconfig1-dev libx11-dev libxext-dev \
libxrender-dev libxrandr-dev libxtst-dev libxt-dev \
texlive-font-utils texlive-fonts-recommended texlive-latex-recommended
pip install black flake8 html5validator
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.19.0
if: ${{ matrix.script == 'cftests-nonjunit' }}
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Store build cache per workflow.
disk-cache: ${{ github.workflow }}
# Share repository cache between workflows.
repository-cache: true
- name: Output version information to debug CI
run: which java && ./gradlew --version
- name: Run test script checker/bin-devel/test-${{ matrix.script }}
run: ./checker/bin-devel/test-${{ matrix.script }}.sh
# Set the JDK version to use, allowing us to e.g. run Java 25 while gradle does not work
# on Java 25 yet.
env:
ORG_GRADLE_PROJECT_useJdkVersion: ${{ matrix.java.version }}
# Sanity tests on Windows and MacOS.
otheros:
name: ${{ matrix.script }} on JDK ${{ matrix.java_version }} on ${{ matrix.os }}
runs-on: "${{ matrix.os }}"
needs: sanity
permissions:
contents: read
strategy:
matrix:
os: ['windows-latest', 'macos-latest']
script: ['cftests-junit']
java_version: [21]
env:
JAVA_VERSION: ${{ matrix.java_version }}
steps:
- uses: actions/checkout@v6
- 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.1.0
- name: Install coreutils on MacOS
if: ${{ matrix.os == 'macos-latest' }}
run: brew install coreutils
- name: Install wget on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
choco install wget --no-progress
- name: Run test script checker/bin-devel/test-${{ matrix.script }}
shell: bash
run: ./checker/bin-devel/test-${{ matrix.script }}.sh