Skip to content

Commit c8bd99e

Browse files
committed
Replace vcpkg cache with sccache
1 parent 31e3ba8 commit c8bd99e

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

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

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,28 @@ jobs:
3131

3232
- uses: actions/setup-go@v5
3333
with:
34-
go-version: '^1.24.0'
34+
go-version: "^1.24.0"
35+
36+
- uses: mozilla-actions/sccache-action@main
37+
38+
- name: Setup sccache under Unix-like systems
39+
if: startsWith( matrix.os, 'ubuntu' ) || startsWith( matrix.os, 'macos' )
40+
shell: bash
41+
run: |
42+
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
43+
echo "CMAKE_C_COMPILER_LAUNCHER=${SCCACHE_PATH}" >> $GITHUB_ENV
44+
echo "CMAKE_CXX_COMPILER_LAUNCHER=${SCCACHE_PATH}" >> $GITHUB_ENV
45+
echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV
46+
47+
- name: Setup sccache under Windows
48+
if: startsWith( matrix.os, 'windows' )
49+
shell: powershell
50+
run: |
51+
echo "SCCACHE_GHA_ENABLED=true" >> $env:GITHUB_ENV
52+
echo "CMAKE_C_COMPILER_LAUNCHER=${env:SCCACHE_PATH}" >> $env:GITHUB_ENV
53+
echo "CMAKE_CXX_COMPILER_LAUNCHER=${env:SCCACHE_PATH}" >> $env:GITHUB_ENV
54+
echo "VCPKG_KEEP_ENV_VARS=CMAKE_C_COMPILER_LAUNCHER;CMAKE_CXX_COMPILER_LAUNCHER;CMAKE_GENERATOR" >> $env:GITHUB_ENV
55+
echo "CMAKE_GENERATOR=Ninja" >> $env:GITHUB_ENV
3556
3657
- name: Install Linux dependencies
3758
if: startsWith( matrix.os, 'ubuntu' )
@@ -50,17 +71,9 @@ jobs:
5071
if: startsWith( matrix.os, 'macos' )
5172
run: brew install zip ninja
5273

53-
- name: Export GitHub Actions cache environment variables
54-
uses: actions/github-script@v7
55-
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 || '');
59-
6074
- name: Build
6175
id: build
6276
env:
63-
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
6477
MSYSTEM: ""
6578
run: make build
6679

0 commit comments

Comments
 (0)