2022-01-26 12:13:19 -08:00
|
|
|
name: 'Setup Java and Dependency Cache'
|
|
|
|
description: "Configures the build environment and caches Gradle and dependencies."
|
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
|
|
|
- name: Set Env
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "home=${HOME}" >> "$GITHUB_ENV"
|
|
|
|
- name: Set up Java
|
2022-06-22 03:21:09 -07:00
|
|
|
uses: actions/setup-java@16cca5479d7c6b6843f6a6515640ba33c6501543
|
2022-01-26 12:13:19 -08:00
|
|
|
with:
|
2022-05-17 03:07:22 -07:00
|
|
|
distribution: 'temurin'
|
2022-01-26 12:13:19 -08:00
|
|
|
java-version: 17
|
|
|
|
- name: Disable Gradle Daemon
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
mkdir ~/.gradle
|
|
|
|
|
|
|
|
echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
|
|
|
|
- name: Gradle Wrapper Cache
|
|
|
|
id: gradle-wrapper-cache
|
2022-06-17 03:55:11 -07:00
|
|
|
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d
|
2022-01-26 12:13:19 -08:00
|
|
|
with:
|
|
|
|
path: ~/.gradle/wrapper
|
|
|
|
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles(format('{0}{1}', github.workspace, '/gradle/wrapper/gradle-wrapper.properties')) }}
|
|
|
|
- name: Gradle Dependency Cache
|
|
|
|
id: gradle-dependency-cache
|
2022-06-17 03:55:11 -07:00
|
|
|
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d
|
2022-01-26 12:13:19 -08:00
|
|
|
with:
|
|
|
|
path: ~/.gradle/caches/modules-2
|
|
|
|
key: ${{ runner.os }}-gradle-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/gradle.properties')) }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradle-deps
|
|
|
|
- name: Download Gradle
|
|
|
|
if: steps.gradle-wrapper-cache.outputs.cache-hit != 'true'
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
./gradlew --version
|
|
|
|
- name: Download Dependencies
|
|
|
|
if: steps.gradle-dependency-cache.outputs.cache-hit != 'true'
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-05-17 07:06:56 -07:00
|
|
|
./gradlew dependencies resolveAll
|