Skip to content

Commit 0ffe4cb

Browse files
committed
Fix CI workflow
1 parent a196af3 commit 0ffe4cb

1 file changed

Lines changed: 23 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,43 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
os: [ubuntu-latest, windows-latest]
16+
os: [ubuntu-latest, macos-latest, windows-latest]
1717
build_type: [Debug, Release]
1818

1919
env:
2020
VCPKG_DIR: ${{ github.workspace }}/vcpkg
21+
VCPKG_BINARY_CACHE: ${{ github.workspace }}/vcpkg-binary-cache
22+
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/vcpkg-binary-cache,readwrite"
2123

2224
steps:
2325
- uses: actions/checkout@v4
2426

25-
- name: Cache vcpkg
27+
# Cache the vcpkg clone + bootstrap binary separately from package binaries.
28+
# Bump the suffix (v1, v2, ...) to force a fresh vcpkg update.
29+
- name: Cache vcpkg tool
2630
uses: actions/cache@v4
2731
with:
2832
path: ${{ github.workspace }}/vcpkg
29-
key: vcpkg-${{ runner.os }}-${{ hashFiles('**/CMakeLists.txt') }}
30-
restore-keys: vcpkg-${{ runner.os }}-
33+
key: vcpkg-tool-${{ runner.os }}-v1
3134

32-
- name: Bootstrap vcpkg (Linux)
33-
if: runner.os == 'Linux'
35+
- name: Cache vcpkg binary packages
36+
uses: actions/cache@v4
37+
with:
38+
path: ${{ env.VCPKG_BINARY_CACHE }}
39+
key: vcpkg-binary-${{ runner.os }}-${{ hashFiles('.github/workflows/ci.yml', '**/CMakeLists.txt') }}
40+
restore-keys: vcpkg-binary-${{ runner.os }}-
41+
42+
- name: Prepare vcpkg binary cache directory
43+
run: cmake -E make_directory "${{ env.VCPKG_BINARY_CACHE }}"
44+
45+
- name: Bootstrap vcpkg (Linux/macOS)
46+
if: runner.os != 'Windows'
3447
run: |
3548
if [ ! -f "${{ env.VCPKG_DIR }}/vcpkg" ]; then
3649
git clone https://github.com/microsoft/vcpkg.git "${{ env.VCPKG_DIR }}"
3750
"${{ env.VCPKG_DIR }}/bootstrap-vcpkg.sh" -disableMetrics
3851
fi
39-
"${{ env.VCPKG_DIR }}/vcpkg" install nlohmann-json openssl jwt-cpp
52+
"${{ env.VCPKG_DIR }}/vcpkg" install nlohmann-json openssl jwt-cpp boost-asio boost-beast boost-context boost-system
4053
4154
- name: Bootstrap vcpkg (Windows)
4255
if: runner.os == 'Windows'
@@ -47,10 +60,10 @@ jobs:
4760
git clone https://github.com/microsoft/vcpkg.git $vcpkgDir
4861
& "$vcpkgDir\bootstrap-vcpkg.bat" -disableMetrics
4962
}
50-
& "$vcpkgDir\vcpkg.exe" install nlohmann-json:x64-windows openssl:x64-windows jwt-cpp:x64-windows
63+
& "$vcpkgDir\vcpkg.exe" install nlohmann-json:x64-windows openssl:x64-windows jwt-cpp:x64-windows boost-asio:x64-windows boost-beast:x64-windows boost-context:x64-windows boost-system:x64-windows
5164
52-
- name: Configure (Linux)
53-
if: runner.os == 'Linux'
65+
- name: Configure (Linux/macOS)
66+
if: runner.os != 'Windows'
5467
run: |
5568
cmake -S . -B build \
5669
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \

0 commit comments

Comments
 (0)