Skip to content

Commit 47430ac

Browse files
Copilotjohnpatek
andcommitted
fix: only save vcpkg cache when binary contents have changed
Co-authored-by: johnpatek <31934875+johnpatek@users.noreply.github.com> Agent-Logs-Url: https://github.com/maxtek6/WebFrame/sessions/119ad140-61dd-47ae-b1a1-bf9d9daaf024
1 parent 8b7af6b commit 47430ac

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -96,7 +99,8 @@ jobs:
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

Comments
 (0)