# This workflow will build a Java project with Gradle

name: Build

on: [push, pull_request]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK 11
      uses: actions/setup-java@v2
      with:
        java-version: '11'
        distribution: 'adopt'
    - name: Grant execute permission for gradlew
      run: chmod +x gradlew
    - name: Build with Gradle
      run: ./gradlew build --build-cache

# This workflow will build a Java project with Gradle

name: Build

on: [push, pull_request]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Set up JDK 11
      uses: actions/setup-java@v2
      with:
        java-version: '11'
        distribution: 'adopt'

    - name: Grant execute permission for gradlew
      run: chmod +x gradlew

    - name: Gradle Wrapper Validation
      uses: gradle/wrapper-validation-action@v1

    - name: Setup Cache
      uses: actions/cache@v3
      with:
        path: |
          ~/.gradle/caches/
          ~/.gradle/wrapper/
        key: cache-gradle-${{ hashFiles('**/*.gradle') }}

    - name: Build with Gradle
      run: ./gradlew build

Improve GitHub workflow run time with action cache
Improve GitHub workflow run time with action cache
