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 * * *"
|
||||
|
||||
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:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
|
@ -56,18 +27,10 @@ jobs:
|
|||
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
|
||||
uses: burrunan/gradle-cache-action@v1
|
||||
with:
|
||||
path: ~/.gradle
|
||||
key: build-${{ env.cache-name }}-${{ env.TODAY }}
|
||||
restore-keys: |
|
||||
build-${{ env.cache-name }}-
|
||||
job-id: jdk${{ matrix.java }}
|
||||
|
||||
- name: Test with Gradle
|
||||
uses: nick-invision/retry@v1
|
||||
|
@ -77,7 +40,6 @@ jobs:
|
|||
max_attempts: 3
|
||||
|
||||
testLatestDep:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
@ -86,18 +48,10 @@ jobs:
|
|||
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
|
||||
uses: burrunan/gradle-cache-action@v1
|
||||
with:
|
||||
path: ~/.gradle
|
||||
key: build-${{ env.cache-name }}-${{ env.TODAY }}
|
||||
restore-keys: |
|
||||
build-${{ env.cache-name }}-
|
||||
job-id: latestDepTest
|
||||
|
||||
- name: Test with Gradle
|
||||
uses: nick-invision/retry@v1
|
||||
|
|
Loading…
Reference in New Issue