name: CI

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java_version: [ 8, 11, 15 ]

    steps:
    - uses: actions/checkout@v2

    - name: Set up JDK ${{ matrix.java_version }}
      uses: actions/setup-java@v1
      with:
        java-version: ${{ matrix.java_version }}

    - name: Build with Gradle
      uses: eskatos/gradle-command-action@v1
      with:
        arguments: build
        wrapper-cache-enabled: true
        dependencies-cache-enabled: true
        dependencies-cache-key: '**/*gradle.lockfile'
        dependencies-cache-exact: true

name: CI

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java_version: [ 8, 11, 15 ]

    steps:
    - uses: actions/checkout@v2

    - name: Set up JDK ${{ matrix.java_version }}
      id: setup-test-java
      if: matrix.java_version != 8 && matrix.java_version != 11
      uses: actions/setup-java@v1
      with:
        java-version: ${{ matrix.java_version }}

    - name: Setup JAVA_HOME
      if: steps.setup-test-java.conclusion == 'skipped'
      run: echo "JAVA_HOME=${JAVA_HOME_${{ matrix.java_version }}_X64}" | tee -a $GITHUB_ENV

    - name: Build with Gradle
      uses: eskatos/gradle-command-action@v1
      with:
        arguments: build
        wrapper-cache-enabled: true
        dependencies-cache-enabled: true
        dependencies-cache-key: '**/*gradle.lockfile'
        dependencies-cache-exact: true

Use local JDK in CI when possible rather than downloading it
Use local JDK in CI when possible rather than downloading it
