---
name: CI

on: [push, pull_request]

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-18.04]
        java: [8]
      fail-fast: false
      max-parallel: 4
    name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v2
      - name: Set up JDK
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
      - name: Cache local Maven repository
        uses: actions/cache@v2.1.4
        with:
          path: ~/.m2/repository
          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            ${{ runner.os }}-maven-
      - name: Verify with Maven
        run: mvn verify -B --file pom.xml

---
name: CI

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
  workflow_dispatch:

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-18.04]
        java: [8]
      fail-fast: false
      max-parallel: 4
    name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v2
      - name: Set up JDK
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
      - name: Cache local Maven repository
        uses: actions/cache@v2.1.4
        with:
          path: ~/.m2/repository
          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            ${{ runner.os }}-maven-
      - name: Verify with Maven
        run: mvn verify -B --file pom.xml

Allow CI workflow to be invoked manually
Allow CI workflow to be invoked manually
