name: Java CI

on: [workflow_dispatch, push, pull_request]

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        java: [11, 17, 21, 22-ea]
        distribution: ['temurin']
      fail-fast: false
      max-parallel: 4
    name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v4
      - name: Set up JDK ${{ matrix.java }} ${{ matrix.distribution }}
        uses: actions/setup-java@v3
        with:
          java-version: ${{ matrix.java }}
          distribution: ${{ matrix.distribution }}
      - name: Test with Maven
        run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true"