Skip to content

Commit 8f87e43

Browse files
committed
CI: switch vcpkg cache from removed x-gha backend to actions/cache
The first attempt used VCPKG_BINARY_SOURCES=x-gha, which vcpkg has since removed (the configure step emitted "binary caching backend has been removed"). Replaced with actions/cache on %LOCALAPPDATA%\vcpkg\archives, keyed on vcpkg.json. Same effective speedup, no GHA service tokens needed.
1 parent 78872f3 commit 8f87e43

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,22 @@ jobs:
3232
if: runner.os != 'Windows'
3333
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
3434

35-
# Expose the GitHub Actions cache service tokens so vcpkg's x-gha binary
36-
# cache can read/write built packages across runs. These env vars aren't
37-
# forwarded into job steps by default; github-script re-exports them.
38-
- name: Export GitHub Actions cache env (Windows)
35+
# Cache vcpkg's built-package archives so curl/nlohmann-json are not
36+
# rebuilt from source on every run. vcpkg's old x-gha backend was
37+
# removed; using actions/cache on the archives directory gives the same
38+
# speedup without provider setup. Key on vcpkg.json so a dep bump
39+
# invalidates cleanly.
40+
- name: Cache vcpkg archives (Windows)
3941
if: runner.os == 'Windows'
40-
uses: actions/github-script@v7
42+
uses: actions/cache@v4
4143
with:
42-
script: |
43-
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
44-
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
44+
path: ~\AppData\Local\vcpkg\archives
45+
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
46+
restore-keys: |
47+
vcpkg-${{ runner.os }}-
4548
4649
- name: Configure (Windows, vcpkg)
4750
if: runner.os == 'Windows'
48-
env:
49-
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
5051
run: |
5152
# Sync the runner's vcpkg to the manifest's builtin-baseline so its
5253
# port/version database matches, then configure.

0 commit comments

Comments
 (0)