name: PR Build

on: pull_request

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        java-version: [ 8, 11, 16 ]
      fail-fast: false  

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java-version }}
      - uses: actions/cache@v2
        with:
          path: ~/.m2/repository
          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            ${{ runner.os }}-maven-          
      - run: mvn -B install --no-transfer-progress

name: PR Build

on: pull_request

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-java@v1
        with:
          java-version: 11
      - uses: actions/cache@v2
        with:
          path: ~/.m2/repository
          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            ${{ runner.os }}-maven-

      - name: Build with JDK 11
        run: mvn -B install --no-transfer-progress -DskipTests

      - uses: actions/setup-java@v1
        with:
          java-version: 1.8
      - name: Test with JDK 8
        run: mvn -v && mvn -B test

      - uses: actions/setup-java@v1
        with:
          java-version: 11
      - name: Test with JDK 11
        run: mvn -v && mvn -B test

      - uses: actions/setup-java@v1
        with:
          java-version: 14
      - name: Test with JDK 14
        run: mvn -v && mvn -B test

Add GitHub actions for CI and PR builds
Add GitHub actions for CI and PR builds
