Attempt to reuse cache on Windows

This commit is contained in:
topjohnwu 2024-08-21 22:06:12 -07:00
parent 8f271c2575
commit 1dc723fb6d

View File

@ -27,7 +27,7 @@ runs:
- name: Cache sccache - name: Cache sccache
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: ${{ github.workspace }}/.sccache path: .sccache
key: sccache-${{ runner.os }}-${{ github.sha }} key: sccache-${{ runner.os }}-${{ github.sha }}
restore-keys: sccache-${{ runner.os }}- restore-keys: sccache-${{ runner.os }}-
@ -49,14 +49,18 @@ runs:
run: sccache -s run: sccache -s
post: sccache -s post: sccache -s
- name: Set GRADLE_USER_HOME
shell: bash
run: echo "GRADLE_USER_HOME=$GITHUB_WORKSPACE/.gradle" >> "$GITHUB_ENV"
- name: Cache Gradle dependencies - name: Cache Gradle dependencies
uses: actions/cache@v4 uses: actions/cache@v4
if: inputs.is-asset-build == 'true' if: inputs.is-asset-build == 'true'
with: with:
path: | path: |
~/.gradle/caches .gradle/caches
~/.gradle/wrapper .gradle/wrapper
!~/.gradle/caches/build-cache-* !.gradle/caches/build-cache-*
key: gradle-cache-${{ hashFiles('gradle/**') }} key: gradle-cache-${{ hashFiles('gradle/**') }}
restore-keys: gradle-cache- restore-keys: gradle-cache-
@ -65,18 +69,19 @@ runs:
if: inputs.is-asset-build == 'false' if: inputs.is-asset-build == 'false'
with: with:
path: | path: |
~/.gradle/caches .gradle/caches
~/.gradle/wrapper .gradle/wrapper
!~/.gradle/caches/build-cache-* !.gradle/caches/build-cache-*
key: gradle-cache-${{ hashFiles('gradle/**') }} key: gradle-cache-${{ hashFiles('gradle/**') }}
restore-keys: gradle-cache- restore-keys: gradle-cache-
enableCrossOsArchive: true
- name: Cache Gradle build cache - name: Cache Gradle build cache
uses: actions/cache@v4 uses: actions/cache@v4
if: inputs.is-asset-build == 'true' if: inputs.is-asset-build == 'true'
with: with:
path: | path: |
~/.gradle/caches/build-cache-* .gradle/caches/build-cache-*
key: gradle-build-cache-${{ github.sha }} key: gradle-build-cache-${{ github.sha }}
restore-keys: gradle-build-cache- restore-keys: gradle-build-cache-
@ -85,9 +90,10 @@ runs:
if: inputs.is-asset-build == 'false' if: inputs.is-asset-build == 'false'
with: with:
path: | path: |
~/.gradle/caches/build-cache-* .gradle/caches/build-cache-*
key: gradle-build-cache-${{ github.sha }} key: gradle-build-cache-${{ github.sha }}
restore-keys: gradle-build-cache- restore-keys: gradle-build-cache-
enableCrossOsArchive: true
- name: Set up NDK - name: Set up NDK
shell: bash shell: bash