name: CI

on:
  push:
    branches:
      - master

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

      - name: Set up settings.xml for GitHub Packages
        uses: actions/setup-java@v1
        with:
          java-version: 1.8

      - name: Publish SNAPSHOT version to GitHub Packages (we can skip tests, since we only deploy, if the build workflow succeeded)
        run: mvn -v && mvn -B -P requireSnapshot --no-transfer-progress deploy -DskipTests
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}        

name: CI

on:
  push:
    branches:
      - master

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

      - 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: 16
      - name: Test with JDK 16         
        run: mvn -v && mvn -B test

      - name: Set up settings.xml for GitHub Packages
        uses: actions/setup-java@v1
        with:
          java-version: 1.8

      - name: Publish SNAPSHOT version to GitHub Packages (we can skip tests, since we only deploy, if the build workflow succeeded)
        run: mvn -v && mvn -B -P requireSnapshot --no-transfer-progress deploy -DskipTests
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}        

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