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.
This commit is contained in:
PixelyIon 2022-05-31 00:28:40 +05:30
parent 40a7433e97
commit da79e2c8e3

View File

@ -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: |