name: Java CI Build and Test

on: [push, pull_request]


jobs:
  build:

    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [windows-latest, ubuntu-latest]
        java: [ '1.8.0', '11.0.x', '13.0.x' ]
    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK
      uses: actions/setup-java@v1
      with:
        java-version: ${{ matrix.java }}
    - name: Cached .m2
      uses: actions/cache@v1
      with:
        path: ~/.m2/repository
        key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
        restore-keys: |
          ${{ runner.os }}-maven-
    - name: Maven Build
      run: mvn -B install site -D enable-ci --file pom.xml

name: Java CI Build and Test

on: [push, pull_request]


jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: [ '11.0.x' ]
    steps:
      - uses: actions/checkout@v2
      - name: Set up JDK
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
      - name: Cached .m2
        uses: actions/cache@v1
        with:
          path: ~/.m2/repository
          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            ${{ runner.os }}-maven-
      - name: Maven Install (skipTests)
        run: mvn -B install -DskipTests -D enable-ci --file pom.xml
  site:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: [ '11.0.x' ]
    steps:
      - uses: actions/checkout@v2
      - name: Set up JDK
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
      - uses: actions/cache@v1
        with:
          path: ~/.m2/repository
          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            ${{ runner.os }}-maven-
      - name: Maven Site
        run: mvn -B site -D enable-ci --file pom.xml
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ windows-latest, ubuntu-latest ]
        java: [ '1.8.0', '11.0.x', '13.0.x' ]
    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK
      uses: actions/setup-java@v1
      with:
        java-version: ${{ matrix.java }}
    - uses: actions/cache@v1
      with:
        path: ~/.m2/repository
        key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
        restore-keys: |
          ${{ runner.os }}-maven-
    - name: Maven Install
      run: mvn -B install --file pom.xml

Split build jobs for clarity
Split build jobs for clarity
