@@ -38,27 +38,29 @@ jobs:
3838 "ndk;${ANDROID_NDK_VERSION}"
3939
4040 - name : Restore Bazel Repository Cache
41- uses : actions/cache@v4
41+ id : restore_bazel_repository_cache
42+ uses : actions/cache/restore@v4
4243 with :
4344 path : ${{ github.workspace }}/.bazel-cache/repository
44- key : ${{ runner.os }}-bazel-${{ env.ANDROID_PLATFORM }}-${{ env.TFJAVA_COMMIT }}-${{ hashFiles('scripts/patch_tfjava.py', '.github/workflows/build-android-arm64.yml' ) }}
45+ key : ${{ runner.os }}-bazel-${{ env.ANDROID_PLATFORM }}-${{ env.TFJAVA_COMMIT }}-${{ hashFiles('scripts/patch_tfjava.py') }}
4546 restore-keys : |
4647 ${{ runner.os }}-bazel-${{ env.ANDROID_PLATFORM }}-${{ env.TFJAVA_COMMIT }}-
4748 ${{ runner.os }}-bazel-${{ env.ANDROID_PLATFORM }}-
4849
4950 - name : Restore Bazel Disk Cache
50- uses : actions/cache@v4
51+ id : restore_bazel_disk_cache
52+ uses : actions/cache/restore@v4
5153 with :
5254 path : ${{ github.workspace }}/.bazel-cache/disk
53- key : ${{ runner.os }}-bazel-disk-${{ env.ANDROID_PLATFORM }}-${{ env.TFJAVA_COMMIT }}-${{ hashFiles('scripts/patch_tfjava.py', '.github/workflows/build-android-arm64.yml' ) }}
55+ key : ${{ runner.os }}-bazel-disk-${{ env.ANDROID_PLATFORM }}-${{ env.TFJAVA_COMMIT }}-${{ hashFiles('scripts/patch_tfjava.py') }}
5456 restore-keys : |
5557 ${{ runner.os }}-bazel-disk-${{ env.ANDROID_PLATFORM }}-${{ env.TFJAVA_COMMIT }}-
5658 ${{ runner.os }}-bazel-disk-${{ env.ANDROID_PLATFORM }}-
5759
5860 - name : Clone TensorFlow Java
5961 shell : bash
6062 run : |
61- git clone https://github.com/tensorflow/java.git tfjava
63+ git clone --filter=blob:none --no-checkout https://github.com/tensorflow/java.git tfjava
6264 cd tfjava
6365 git checkout "${TFJAVA_COMMIT}"
6466
@@ -251,6 +253,20 @@ jobs:
251253 (cd "${GITHUB_WORKSPACE}/artifacts/output" && find . -type f -print0 | sort -z | xargs -0 sha256sum) > "${GITHUB_WORKSPACE}/artifacts/sha256.txt" || true
252254 fi
253255
256+ - name : Save Bazel Repository Cache
257+ if : always() && steps.restore_bazel_repository_cache.outputs.cache-hit != 'true'
258+ uses : actions/cache/save@v4
259+ with :
260+ path : ${{ github.workspace }}/.bazel-cache/repository
261+ key : ${{ runner.os }}-bazel-${{ env.ANDROID_PLATFORM }}-${{ env.TFJAVA_COMMIT }}-${{ hashFiles('scripts/patch_tfjava.py') }}
262+
263+ - name : Save Bazel Disk Cache
264+ if : always() && steps.restore_bazel_disk_cache.outputs.cache-hit != 'true'
265+ uses : actions/cache/save@v4
266+ with :
267+ path : ${{ github.workspace }}/.bazel-cache/disk
268+ key : ${{ runner.os }}-bazel-disk-${{ env.ANDROID_PLATFORM }}-${{ env.TFJAVA_COMMIT }}-${{ hashFiles('scripts/patch_tfjava.py') }}
269+
254270 - name : Upload Artifacts
255271 if : always()
256272 uses : actions/upload-artifact@v4
0 commit comments