From 3ea2f62531b0a093950a2c7d91f829cd40f7633a Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Mon, 21 Jul 2025 09:02:04 -0700 Subject: [PATCH] Bump ccache cache key on GHA (#52711) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52711 The ccache cache is not really working. That's because we don't have a way to properly compute the cache. I'm adding has `hashFiles` to collect all the C++ and CMake files that are used by ccache to fix this. Changelog: [Internal] [Changed] - Reviewed By: cipolleschi Differential Revision: D78560946 fbshipit-source-id: 8d521d01386b62d3cfbd485f8e6fcf5f66eba71b --- .github/actions/build-android/action.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/actions/build-android/action.yml b/.github/actions/build-android/action.yml index 2eab7660156..ac769b62ce9 100644 --- a/.github/actions/build-android/action.yml +++ b/.github/actions/build-android/action.yml @@ -28,10 +28,11 @@ runs: uses: actions/cache/restore@v4 with: path: /github/home/.cache/ccache - key: v1-ccache-android-${{ github.job }}-${{ github.ref }} + key: v2-ccache-android-${{ github.job }}-${{ github.ref }}-${{ hashFiles('packages/react-native/ReactAndroid/**/*.cpp', 'packages/react-native/ReactAndroid/**/*.h', 'packages/react-native/ReactCommon/**/*.cpp', 'packages/react-native/ReactAndroid/**/CMakeLists.txt', 'packages/react-native/ReactCommon/**/CMakeLists.txt') }} restore-keys: | - v1-ccache-android-${{ github.job }}- - v1-ccache-android- + v2-ccache-android-${{ github.job }}-${{ github.ref }}- + v2-ccache-android-${{ github.job }}- + v2-ccache-android- - name: Show ccache stats shell: bash run: ccache -s -v @@ -56,7 +57,7 @@ runs: uses: actions/cache/save@v4 with: path: /github/home/.cache/ccache - key: v1-ccache-android-${{ github.job }}-${{ github.ref }} + key: v2-ccache-android-${{ github.job }}-${{ github.ref }}-${{ hashFiles('packages/react-native/ReactAndroid/**/*.cpp', 'packages/react-native/ReactAndroid/**/*.h', 'packages/react-native/ReactCommon/**/*.cpp', 'packages/react-native/ReactAndroid/**/CMakeLists.txt', 'packages/react-native/ReactCommon/**/CMakeLists.txt') }} - name: Show ccache stats shell: bash run: ccache -s -v