name: Build
on:
  push:
    branches:
      - master
  pull_request:

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macOS-latest]
        # choosing to run a reduced set of LTS, current, and next, to balance coverage and execution time
        java: [8, 11, 17]
      fail-fast: false
    name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Set up JDK ${{ matrix.java }}
        uses: actions/setup-java@v2
        with:
          java-version: ${{ matrix.java }}
          distribution: 'temurin'
          cache: 'maven'

      - name: Maven Compile
        run: mvn -X compile -B --file pom.xml

      - name: Maven Verify
        run: mvn -X verify -B --file pom.xml
...
