Skip to content

Commit

Permalink
Automate Gradle cache in GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
pemistahl committed Dec 12, 2021
1 parent cfb7221 commit 4ca58ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
with:
distribution: 'adopt'
java-version: 8
cache: 'gradle'

- name: Get tag version
id: get_version
Expand Down

0 comments on commit 4ca58ea

Please sign in to comment.