From 4ca58ead2d2ce6bad6d85574b7efd5b3ca29aa4b Mon Sep 17 00:00:00 2001 From: "Peter M. Stahl" Date: Sun, 12 Dec 2021 12:42:57 +0100 Subject: [PATCH] Automate Gradle cache in GitHub workflows --- .github/workflows/build.yml | 14 +++----------- .github/workflows/release.yml | 1 + 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2096e124..c287db9c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,21 +29,13 @@ jobs: with: distribution: 'adopt' java-version: ${{ matrix.java-version }} + cache: 'gradle' - - name: Store or retrieve Gradle caches - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} - restore-keys: ${{ runner.os }}-gradle- - - - name: Build and test with Gradle on Ubuntu and macOS + - name: Build and test on Ubuntu and macOS if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }} run: ./gradlew check - - name: Build and test with Gradle on Windows + - name: Build and test on Windows if: ${{ matrix.os == 'windows-latest' }} run: gradlew.bat check shell: cmd diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1543e45b..f9a4eec3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,7 @@ jobs: with: distribution: 'adopt' java-version: 8 + cache: 'gradle' - name: Get tag version id: get_version