name: Java CI

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest
    continue-on-error: ${{ matrix.experimental }}
    strategy:
      matrix:
        java: [ 11, 14 ]
        experimental: [false]
        include:
          - java: 15-ea
            experimental: true

    steps:
    - uses: actions/checkout@v2.3.2
    - name: Set up JDK ${{ matrix.java }}
      uses: actions/setup-java@v1.4.2
      with:
        java-version: ${{ matrix.java }}
    - name: Cache Maven packages
      uses: actions/cache@v2.1.1
      with:
        path: ~/.m2
        key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
        restore-keys: ${{ runner.os }}-m2
    - name: Build with Maven
      run: mvn -B clean package --file pom.xml

name: Java CI

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest
    continue-on-error: ${{ matrix.experimental }}
    strategy:
      matrix:
        java: [ 11, 15 ]
        experimental: [false]
        include:
          - java: 16-ea
            experimental: true

    steps:
    - uses: actions/checkout@v2.3.2
    - name: Set up JDK ${{ matrix.java }}
      uses: actions/setup-java@v1.4.2
      with:
        java-version: ${{ matrix.java }}
    - name: Cache Maven packages
      uses: actions/cache@v2.1.1
      with:
        path: ~/.m2
        key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
        restore-keys: ${{ runner.os }}-m2
    - name: Build with Maven
      run: mvn -B clean package --file pom.xml

Use latest Java version 15 & 16 EA to test.
Use latest Java version 15 & 16 EA to test.

Replace Java 14 with Java 15 and use Java 16 EA as the EA version to test.