name: Java CI

on: [ push ]

jobs:
  build:
    runs-on: ${{ matrix.os }}
    continue-on-error: ${{ matrix.experimental }}
    strategy:
      matrix:
        os: [ ubuntu-latest , windows-latest ]
        java: [ 8, 11 ]
        experimental: [ false ]

    steps:
      - uses: actions/checkout@v2.4.0
      - uses: actions/cache@v2.1.7
        with:
          path: ~/.m2/repository
          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            ${{ runner.os }}-maven-
      - name: Set up JDK ${{ matrix.java }}
        uses: actions/setup-java@v2
        with:
          java-version: ${{ matrix.java }}
          distribution: adopt
      - name: Build with mvn
        run: |
          mvn clean install
