@@ -30,10 +30,11 @@ jobs:
3030 ref : ${{ github.ref }}
3131
3232 - name : " Restore VCPKG cache"
33+ id : restore-test-cache
3334 uses : actions/cache/restore@v4
3435 with :
3536 path : ${{ github.workspace }}/vcpkg-test-cache
36- key : vcpkg-test-cache-${{ github.run_id }}
37+ key : vcpkg-test-cache-${{ hashFiles('WebFrame/vcpkg.json', 'WebFrame/vcpkg-configuration.json') }}
3738 restore-keys : vcpkg-test-cache
3839
3940 - name : CMake Build
@@ -44,10 +45,11 @@ jobs:
4445 make test
4546
4647 - name : " Save VCPKG cache"
48+ if : steps.restore-test-cache.outputs.cache-hit != 'true'
4749 uses : actions/cache/save@v4
4850 with :
4951 path : ${{ github.workspace }}/vcpkg-test-cache
50- key : vcpkg-test-cache-${{ github.run_id }}
52+ key : vcpkg-test-cache-${{ hashFiles('WebFrame/vcpkg.json', 'WebFrame/vcpkg-configuration.json') }}
5153
5254 build :
5355 needs : test
@@ -76,10 +78,11 @@ jobs:
7678 ref : ${{ github.ref }}
7779
7880 - name : " Restore VCPKG cache"
81+ id : restore-build-cache
7982 uses : actions/cache/restore@v5
8083 with :
8184 path : ${{ github.workspace }}/vcpkg-${{ matrix.os }}
82- key : vcpkg-${{ matrix.os }}-${{ github.run_id }}
85+ key : vcpkg-${{ matrix.os }}-${{ hashFiles('WebFrame/vcpkg.json', 'WebFrame/vcpkg-configuration.json') }}
8386 restore-keys : vcpkg-${{ matrix.os }}
8487
8588 - name : Ubuntu setup
9699 cmake --build build
97100
98101 - name : " Save VCPKG cache"
102+ if : steps.restore-build-cache.outputs.cache-hit != 'true'
99103 uses : actions/cache/save@v5
100104 with :
101105 path : ${{ github.workspace }}/vcpkg-${{ matrix.os }}
102- key : vcpkg-${{ matrix.os }}-${{ github.run_id }}
106+ key : vcpkg-${{ matrix.os }}-${{ hashFiles('WebFrame/vcpkg.json', 'WebFrame/vcpkg-configuration.json') }}
0 commit comments