name: master

on:
  push:
    branches:
    - master

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: [ '1.8', '11' ]
    name: Build Spark with JDK ${{ matrix.java }}

    steps:
    - uses: actions/checkout@master
    - name: Set up JDK ${{ matrix.java }}
      uses: actions/setup-java@v1
      with:
        version: ${{ matrix.java }}
    - name: Build with Maven
      run: |
        export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=512m -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN"
        export MAVEN_CLI_OPTS="--no-transfer-progress"
        ./build/mvn $MAVEN_CLI_OPTS -DskipTests -Pyarn -Pmesos -Pkubernetes -Phive -Phive-thriftserver -Phadoop-3.2 -Phadoop-cloud -Djava.version=${{ matrix.java }} package

name: master

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

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: [ '1.8', '11' ]
    name: Build Spark with JDK ${{ matrix.java }}

    steps:
    - uses: actions/checkout@master
    - name: Set up JDK ${{ matrix.java }}
      uses: actions/setup-java@v1
      with:
        version: ${{ matrix.java }}
    - name: Build with Maven
      run: |
        export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=512m -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN"
        export MAVEN_CLI_OPTS="--no-transfer-progress"
        ./build/mvn $MAVEN_CLI_OPTS -DskipTests -Pyarn -Pmesos -Pkubernetes -Phive -Phive-thriftserver -Phadoop-3.2 -Phadoop-cloud -Djava.version=${{ matrix.java }} package

Enable GitHub Action on PR
[SPARK-29079][INFRA] Enable GitHub Action on PR

### What changes were proposed in this pull request?

This PR enables GitHub Action on PRs.

### Why are the changes needed?

So far, we detect JDK11 compilation error after merging.
This PR aims to prevent JDK11 compilation error at PR stage.

### Does this PR introduce any user-facing change?

No.

### How was this patch tested?

Manual. See the GitHub Action on this PR.

Closes #25786 from dongjoon-hyun/SPARK-29079.

Authored-by: Dongjoon Hyun <9b02cb7e37158797a8e22c559f7c5f5ecd28ea57@apple.com>
Signed-off-by: DB Tsai <0430fe8116355e2ecfa7f2b79341c5ad5a243c66@apple.com>
