From 1dc723fb6d9846954fddc1ff0fe8c32fa8a31355 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Wed, 21 Aug 2024 22:06:12 -0700 Subject: [PATCH] Attempt to reuse cache on Windows --- .github/actions/setup/action.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 2c11397b3..139de3125 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -27,7 +27,7 @@ runs: - name: Cache sccache uses: actions/cache@v4 with: - path: ${{ github.workspace }}/.sccache + path: .sccache key: sccache-${{ runner.os }}-${{ github.sha }} restore-keys: sccache-${{ runner.os }}- @@ -49,14 +49,18 @@ runs: run: 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 uses: actions/cache@v4 if: inputs.is-asset-build == 'true' with: path: | - ~/.gradle/caches - ~/.gradle/wrapper - !~/.gradle/caches/build-cache-* + .gradle/caches + .gradle/wrapper + !.gradle/caches/build-cache-* key: gradle-cache-${{ hashFiles('gradle/**') }} restore-keys: gradle-cache- @@ -65,18 +69,19 @@ runs: if: inputs.is-asset-build == 'false' with: path: | - ~/.gradle/caches - ~/.gradle/wrapper - !~/.gradle/caches/build-cache-* + .gradle/caches + .gradle/wrapper + !.gradle/caches/build-cache-* key: gradle-cache-${{ hashFiles('gradle/**') }} restore-keys: gradle-cache- + enableCrossOsArchive: true - name: Cache Gradle build cache uses: actions/cache@v4 if: inputs.is-asset-build == 'true' with: path: | - ~/.gradle/caches/build-cache-* + .gradle/caches/build-cache-* key: gradle-build-cache-${{ github.sha }} restore-keys: gradle-build-cache- @@ -85,9 +90,10 @@ runs: if: inputs.is-asset-build == 'false' with: path: | - ~/.gradle/caches/build-cache-* + .gradle/caches/build-cache-* key: gradle-build-cache-${{ github.sha }} restore-keys: gradle-build-cache- + enableCrossOsArchive: true - name: Set up NDK shell: bash