Skip to content

Commit 4ca58ea

Browse files
committed
Automate Gradle cache in GitHub workflows
1 parent cfb7221 commit 4ca58ea

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,13 @@ jobs:
2929
with:
3030
distribution: 'adopt'
3131
java-version: ${{ matrix.java-version }}
32+
cache: 'gradle'
3233

33-
- name: Store or retrieve Gradle caches
34-
uses: actions/cache@v2
35-
with:
36-
path: |
37-
~/.gradle/caches
38-
~/.gradle/wrapper
39-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
40-
restore-keys: ${{ runner.os }}-gradle-
41-
42-
- name: Build and test with Gradle on Ubuntu and macOS
34+
- name: Build and test on Ubuntu and macOS
4335
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
4436
run: ./gradlew check
4537

46-
- name: Build and test with Gradle on Windows
38+
- name: Build and test on Windows
4739
if: ${{ matrix.os == 'windows-latest' }}
4840
run: gradlew.bat check
4941
shell: cmd

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
with:
1919
distribution: 'adopt'
2020
java-version: 8
21+
cache: 'gradle'
2122

2223
- name: Get tag version
2324
id: get_version

0 commit comments

Comments
 (0)