Skip to content

Commit

Permalink
Adjust what scripts to run in CI for each Java version
Browse files Browse the repository at this point in the history
  • Loading branch information
wmdietl committed Jan 3, 2025
1 parent a5162ba commit bcc63cb
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
run: ./checker/bin-devel/test-${{ matrix.script }}.sh

otherjdks:
name: ${{ matrix.script }} on JDK ${{ matrix.java.version }}
name: ${{ matrix.script.name }} on JDK ${{ matrix.java.version }}
runs-on: ubuntu-latest
needs: sanity
permissions:
Expand All @@ -112,23 +112,35 @@ jobs:
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 before
java: [{version: '8', experimental: false},
{version: '11', experimental: false},
{version: '17', experimental: false},
{version: '23', experimental: false},
{version: '24-ea', experimental: true}]
# `always` scripts are run on every JDK version, otherwise only on `thorough` versions.
script: [{name: 'cftests-junit', always: true},
{name: 'cftests-nonjunit', always: true},
{name: 'cftests-junit-jdk21', always: true},
{name: 'typecheck-part1', always: false},
{name: 'typecheck-part2', always: false},
{name: 'guava', always: false},
{name: 'plume-lib', always: false},
{name: 'daikon-part1', always: false},
{name: 'daikon-part2', always: false},
{name: 'misc', always: false}]
# JDK 21 used by sanity and remainder before.
# experimental versions use the $version compiler, but run on JDK 21.
# `thorough` versions execute non-`always` scripts.
java: [{version: '8', experimental: false, thorough: true},
{version: '11', experimental: false, thorough: false},
{version: '17', experimental: false, thorough: false},
{version: '23', experimental: false, thorough: true},
{version: '24-ea', experimental: true, thorough: true}]
env:
JAVA_VERSION: ${{ matrix.java.version }}
continue-on-error: ${{ matrix.java.experimental }}
steps:
- uses: actions/checkout@v4
if: matrix.script != 'misc'
if: matrix.script.name != 'misc'
with:
fetch-depth: 1
- uses: actions/checkout@v4
if: matrix.script == 'misc'
if: (matrix.script.always || matrix.java.thorough) && matrix.script.name == 'misc'
with:
# CI diff needs more history - 0 fetches all history.
fetch-depth: 0
Expand All @@ -152,7 +164,7 @@ jobs:
uses: gradle/actions/setup-gradle@v4.2.2
# Setup for misc tests
- name: Install misc dependencies
if: matrix.script == 'misc'
if: (matrix.script.always || matrix.java.thorough) && matrix.script.name == 'misc'
run: |
sudo apt install -y shellcheck devscripts python3-pip \
texlive-latex-base texlive-latex-extra latexmk librsvg2-bin \
Expand All @@ -163,7 +175,7 @@ jobs:
pip install black flake8 html5validator
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.10.0
if: matrix.script == 'cftests-nonjunit'
if: (matrix.script.always || matrix.java.thorough) && matrix.script == 'cftests-nonjunit'
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
Expand All @@ -172,16 +184,17 @@ jobs:
# 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
- name: Run test script checker/bin-devel/test-${{ matrix.script.name }}
run: ./checker/bin-devel/test-${{ matrix.script.name }}.sh
# TODO: it would be nicer to not run the job at all, but GH Actions does
# not allow accessing the matrix on the job-if clause. There is also no way
# for an earlier step to stop execution successfully.
#
# At least one plume-lib project no longer works on Java 8.
# Java 8 does not allow toolchains, so testing 'cftests-junit-jdk21' is unnecessary.
# Daikon produces 'this-escape' compiler warnings in JDK 22+.
if: (matrix.java.version != 8 || (matrix.script != 'plume-lib' && matrix.script != 'cftests-junit-jdk21')) &&
if: (matrix.script.always || matrix.java.thorough) &&
(matrix.java.version != 8 || (matrix.script != 'plume-lib' && matrix.script != 'cftests-junit-jdk21')) &&
(matrix.java.version <= 21 || (matrix.script != 'daikon-part1' && matrix.script != 'daikon-part2'))
# Set the compiler version to use, allowing us to e.g. run Java 23 while gradle does not work
# on Java 23 yet. This only tests the compiler, it does not use that version to run the tests.
Expand Down

0 comments on commit bcc63cb

Please sign in to comment.