From cd4c8ecbf341e141e35b28980cdc5c7a2c04b1ca Mon Sep 17 00:00:00 2001 From: glx22 Date: Mon, 1 Mar 2021 19:35:39 +0100 Subject: [PATCH] Add: [Actions] Allow partial cache invalidation on dependencies change --- .github/workflows/ci-build.yml | 8 ++++++-- .github/workflows/release.yml | 9 +++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 2e5ad6e31a..d5bd304028 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -169,7 +169,9 @@ jobs: uses: actions/cache@v2 with: path: /usr/local/share/vcpkg/installed - key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }} + key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified + restore-keys: | + ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }} - name: Prepare vcpkg run: | @@ -249,7 +251,9 @@ jobs: uses: actions/cache@v2 with: path: vcpkg/installed - key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }} + key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified + restore-keys: | + ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }} - name: Prepare vcpkg shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c03ea6ea98..ae0e4e1208 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -496,7 +496,10 @@ jobs: uses: actions/cache@v2 with: path: /usr/local/share/vcpkg/installed - key: ${{ steps.key.outputs.image }}-vcpkg-release + key: ${{ steps.key.outputs.image }}-vcpkg-release-0 # Increase the number whenever dependencies are modified + restore-keys: | + ${{ steps.key.outputs.image }}-vcpkg-release + ${{ steps.key.outputs.image }}-vcpkg-x64 - name: Prepare vcpkg run: | @@ -696,7 +699,9 @@ jobs: uses: actions/cache@v2 with: path: vcpkg/installed - key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }} + key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-0 # Increase the number whenever dependencies are modified + restore-keys: | + ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }} - name: Prepare vcpkg shell: bash