Skip to content

Commit 7d1e913

Browse files
committed
Replace vcpkg x-gha cache with actions/cache
1 parent 31e3ba8 commit 7d1e913

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

.github/workflows/build-multi-platform.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323

2424
steps:
2525
- uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
submodules: recursive
2629

2730
- uses: jurplel/install-qt-action@v4
2831
with:
@@ -31,7 +34,7 @@ jobs:
3134

3235
- uses: actions/setup-go@v5
3336
with:
34-
go-version: '^1.24.0'
37+
go-version: "^1.24.0"
3538

3639
- name: Install Linux dependencies
3740
if: startsWith( matrix.os, 'ubuntu' )
@@ -40,28 +43,45 @@ jobs:
4043
ninja-build \
4144
libglvnd-dev \
4245
libsecret-1-dev \
46+
linux-libc-dev \
4347
pkg-config
4448
4549
- name: Install Windows dependencies
4650
if: startsWith( matrix.os, 'windows' )
51+
shell: powershell
4752
run: choco install -y zip ninja
4853

4954
- name: Install macOS dependencies
5055
if: startsWith( matrix.os, 'macos' )
5156
run: brew install zip ninja
5257

53-
- name: Export GitHub Actions cache environment variables
54-
uses: actions/github-script@v7
58+
- name: Retrieve vcpkg commit hash
59+
id: cache_info
60+
shell: bash
61+
run: |
62+
mkdir -p .cache
63+
echo "vcpkg_commit=$(git -C ./extern/vcpkg rev-parse HEAD)" >> $GITHUB_OUTPUT
64+
echo "vcpkg_cache_dir=$(realpath .cache)" >> $GITHUB_OUTPUT
65+
echo "timestamp=$(date +%s)" >> $GITHUB_OUTPUT
66+
67+
- uses: actions/cache@v4
5568
with:
56-
script: |
57-
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
58-
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
69+
path: |
70+
.cache/
71+
extern/vcpkg/installed
72+
extern/vcpkg/downloads
73+
extern/vcpkg/scripts/buildsystems/vcpkg.cmake
74+
key: vcpkg-${{ matrix.os }}-${{ steps.cache_info.outputs.vcpkg_commit }}-${{ steps.cache_info.outputs.timestamp }}
75+
restore-keys: |
76+
vcpkg-${{ matrix.os }}-
77+
vcpkg-${{ matrix.os }}-${{ steps.cache_info.outputs.vcpkg_commit }}-
5978
6079
- name: Build
6180
id: build
6281
env:
63-
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
6482
MSYSTEM: ""
83+
VCPKG_DEFAULT_BINARY_CACHE: ${{ steps.cache_info.outputs.vcpkg_cache_dir }}
84+
VCPKG_BUILD_TYPE: Release
6585
run: make build
6686

6787
- name: Report build failure

0 commit comments

Comments
 (0)