Use better gradle cache action for local Gradle cache (#943)
* Use better gradle cache action * Update .github/workflows/nightly.yaml Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com> Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
This commit is contained in:
parent
0eafc28608
commit
5f31109fa2
|
@ -6,36 +6,7 @@ on:
|
||||||
- cron: "24 3 * * *"
|
- cron: "24 3 * * *"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Set up JDK 11
|
|
||||||
uses: actions/setup-java@v1
|
|
||||||
with:
|
|
||||||
java-version: 11
|
|
||||||
- name: Set current date as env variable
|
|
||||||
run: echo "::set-env name=TODAY::$(date +'%Y-%m-%d')"
|
|
||||||
|
|
||||||
- name: Cache gradle dependencies
|
|
||||||
uses: actions/cache@v2
|
|
||||||
env:
|
|
||||||
cache-name: cache-gradle
|
|
||||||
with:
|
|
||||||
path: ~/.gradle
|
|
||||||
# Every night we refresh cache with dependencies and class compilation results.
|
|
||||||
# Gradle build files can change for a variety of reasons, no need to invalidate cache.
|
|
||||||
# TODO cache test results as well
|
|
||||||
# TODO replace/augment with remote gradle cache
|
|
||||||
key: build-${{ env.cache-name }}-${{ env.TODAY }}
|
|
||||||
restore-keys: |
|
|
||||||
build-${{ env.cache-name }}-
|
|
||||||
|
|
||||||
- name: Build with Gradle
|
|
||||||
run: ./gradlew assemble testClasses --stacktrace
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -56,18 +27,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
|
||||||
- name: Set current date as env variable
|
|
||||||
run: echo "::set-env name=TODAY::$(date +'%Y-%m-%d')"
|
|
||||||
|
|
||||||
- name: Cache gradle dependencies
|
- name: Cache gradle dependencies
|
||||||
uses: actions/cache@v2
|
uses: burrunan/gradle-cache-action@v1
|
||||||
env:
|
|
||||||
cache-name: cache-gradle
|
|
||||||
with:
|
with:
|
||||||
path: ~/.gradle
|
job-id: jdk${{ matrix.java }}
|
||||||
key: build-${{ env.cache-name }}-${{ env.TODAY }}
|
|
||||||
restore-keys: |
|
|
||||||
build-${{ env.cache-name }}-
|
|
||||||
|
|
||||||
- name: Test with Gradle
|
- name: Test with Gradle
|
||||||
uses: nick-invision/retry@v1
|
uses: nick-invision/retry@v1
|
||||||
|
@ -77,7 +40,6 @@ jobs:
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
|
|
||||||
testLatestDep:
|
testLatestDep:
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -86,18 +48,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
|
||||||
- name: Set current date as env variable
|
|
||||||
run: echo "::set-env name=TODAY::$(date +'%Y-%m-%d')"
|
|
||||||
|
|
||||||
- name: Cache gradle dependencies
|
- name: Cache gradle dependencies
|
||||||
uses: actions/cache@v2
|
uses: burrunan/gradle-cache-action@v1
|
||||||
env:
|
|
||||||
cache-name: cache-gradle
|
|
||||||
with:
|
with:
|
||||||
path: ~/.gradle
|
job-id: latestDepTest
|
||||||
key: build-${{ env.cache-name }}-${{ env.TODAY }}
|
|
||||||
restore-keys: |
|
|
||||||
build-${{ env.cache-name }}-
|
|
||||||
|
|
||||||
- name: Test with Gradle
|
- name: Test with Gradle
|
||||||
uses: nick-invision/retry@v1
|
uses: nick-invision/retry@v1
|
||||||
|
|
Loading…
Reference in New Issue