From da79e2c8e37b7e837c0cc1ab5d4a2a6c886656da Mon Sep 17 00:00:00 2001 From: PixelyIon Date: Tue, 31 May 2022 00:28:40 +0530 Subject: [PATCH] Add Robust CI Cache Restoration The `restore-keys` parameter of `actions/cache@v3` is now utilized to add robust fallbacks for missing cache keys, it should automatically fall back to an older but still valid cache rather than entirely miss now. --- .github/workflows/ci.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c7831af..b2c9ff6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,11 @@ jobs: uses: actions/cache@v3 with: path: ~/.gradle/ - key: ${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle') }} + key: ${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('app/**/*.xml') }}-${{ hashFiles('app/**.kt', 'app/**.java') }} + restore-keys: | + ${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('app/**/*.xml') }}- + ${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle') }}- + ${{ runner.os }}-gradle- - name: Restore CXX Cache uses: actions/cache@v3 @@ -26,7 +30,10 @@ jobs: path: | app/.cxx/ app/build/intermediates/cxx/ - key: ${{ runner.os }}-cxx-${{ hashFiles('**/CMakeLists.txt') }} + key: ${{ runner.os }}-cxx-${{ hashFiles('app/**/CMakeLists.txt') }}-${{ hashFiles('app/**/*.h', 'app/**/*.hpp', 'app/**/*.cpp', 'app/**/*.S') }} + restore-keys: | + ${{ runner.os }}-cxx-${{ hashFiles('app/**/CMakeLists.txt') }}- + ${{ runner.os }}-cxx- - name: Install Ninja Build run: |