[#545] GitHub Cache Action 3.0.4
Also updated the caching to be a bit simpler and more efficient.
This commit is contained in:
parent
22d9cbecc0
commit
e602d3dd7e
|
@ -31,45 +31,35 @@ runs:
|
||||||
echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
|
echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
|
||||||
- name: Gradle Wrapper Cache
|
- name: Gradle Wrapper Cache
|
||||||
id: gradle-wrapper-cache
|
id: gradle-wrapper-cache
|
||||||
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09
|
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d
|
||||||
with:
|
with:
|
||||||
path: ~/.gradle/wrapper
|
path: ~/.gradle/wrapper
|
||||||
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles(format('{0}{1}', github.workspace, '/gradle/wrapper/gradle-wrapper.properties')) }}
|
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles(format('{0}{1}', github.workspace, '/gradle/wrapper/gradle-wrapper.properties')) }}
|
||||||
- name: Gradle Dependency Cache
|
- name: Gradle Dependency Cache
|
||||||
id: gradle-dependency-cache
|
id: gradle-dependency-cache
|
||||||
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09
|
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d
|
||||||
with:
|
with:
|
||||||
path: ~/.gradle/caches/modules-2
|
path: ~/.gradle/caches/modules-2
|
||||||
key: ${{ runner.os }}-gradle-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/gradle.properties')) }}
|
key: ${{ runner.os }}-gradle-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/gradle.properties')) }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-gradle-deps
|
${{ runner.os }}-gradle-deps-
|
||||||
# This tries to fall back to the build cache from the main branch, while ensuring that
|
# The build cache is doing two things:
|
||||||
# main branch builds repopulate the cache each time.
|
# 1. Relying on the most recent main branch build to provide a partial cache for both main branch and PR builds.
|
||||||
- name: Gradle Build Cache Main
|
# 2. Relying on the sha for an exact match so that the prime_cache job is re-used by all dependent jobs in a single workflow run
|
||||||
id: gradle-build-cache-main
|
- name: Gradle Build Cache
|
||||||
if: github.event.pull_request.head.sha == ''
|
id: gradle-build-cache
|
||||||
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09
|
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.gradle/caches/build-cache-1
|
~/.gradle/caches/build-cache-1
|
||||||
~/.gradle/caches/transforms-3
|
~/.gradle/caches/transforms-3
|
||||||
|
.gradle/configuration-cache
|
||||||
key: ${{ runner.os }}-gradle-build-${{ github.sha }}
|
key: ${{ runner.os }}-gradle-build-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-gradle-build
|
${{ runner.os }}-gradle-build-
|
||||||
- name: Gradle Build Cache Pull Request
|
|
||||||
id: gradle-build-cache-pr
|
|
||||||
if: github.event.pull_request.head.sha != ''
|
|
||||||
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.gradle/caches/build-cache-1
|
|
||||||
~/.gradle/caches/transforms-3
|
|
||||||
key: ${{ runner.os }}-gradle-build-${{ github.event.pull_request.base.sha }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-gradle-build
|
|
||||||
- name: Rust Cache
|
- name: Rust Cache
|
||||||
id: rust-cache
|
id: rust-cache
|
||||||
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09
|
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
sdk-lib/target
|
sdk-lib/target
|
||||||
|
@ -86,7 +76,7 @@ runs:
|
||||||
run: |
|
run: |
|
||||||
./gradlew dependencies :sdk-lib:dependencies :demo-app:dependencies
|
./gradlew dependencies :sdk-lib:dependencies :demo-app:dependencies
|
||||||
- name: Compile
|
- name: Compile
|
||||||
if: steps.gradle-build-cache-main.outputs.cache-hit != 'true' && steps.gradle-build-cache-pr.outputs.cache-hit != 'true'
|
if: steps.gradle-build-cache.outputs.cache-hit != 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
ORG_GRADLE_PROJECT_IS_MINIFY_APP_ENABLED: "false"
|
ORG_GRADLE_PROJECT_IS_MINIFY_APP_ENABLED: "false"
|
||||||
|
|
Loading…
Reference in New Issue