Skip to content

Commit 14817b5

Browse files
committed
Improve MacOS workflow
Update version of the cache action to fix node deprecation warning Try to enable some caching
1 parent 32cfd75 commit 14817b5

1 file changed

Lines changed: 30 additions & 5 deletions

File tree

.github/workflows/macos.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,46 @@ jobs:
66
build-and-test-macos:
77
name: Build And Test MacOS
88
runs-on: macos-latest
9+
env:
10+
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
11+
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg-bincache
12+
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg-bincache,readwrite
913
steps:
10-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
15+
16+
- name: Ensure vcpkg cache directories exist
17+
run: |
18+
mkdir -p "${VCPKG_ROOT}/downloads"
19+
mkdir -p "${VCPKG_DEFAULT_BINARY_CACHE}"
20+
21+
- name: Restore vcpkg caches
22+
uses: actions/cache@v4
23+
with:
24+
path: |
25+
${{ env.VCPKG_ROOT }}/downloads
26+
${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
27+
key: vcpkg-${{ runner.os }}-macos-c3867e714dd3a51c272826eea77267876517ed99-${{ hashFiles('vcpkg.json') }}
28+
restore-keys: |
29+
vcpkg-${{ runner.os }}-macos-
30+
1131
- name: Install Vcpkg
1232
run: |
13-
git clone https://github.com/Microsoft/vcpkg.git
14-
cd vcpkg
33+
git clone https://github.com/microsoft/vcpkg.git "${VCPKG_ROOT}"
34+
cd "${VCPKG_ROOT}"
35+
git checkout c3867e714dd3a51c272826eea77267876517ed99
1536
./bootstrap-vcpkg.sh
1637
./vcpkg integrate install
1738
39+
- name: Install vcpkg dependencies
40+
run: |
41+
"${VCPKG_ROOT}/vcpkg" install
42+
1843
- name: Configure CMake
1944
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
2045
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
21-
run: cmake -B ${{github.workspace}}/build
46+
run: cmake -B ${{github.workspace}}/build
2247
-DCMAKE_BUILD_TYPE=Release
23-
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
48+
-DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake
2449
-DBUILD_TESTS=ON
2550

2651
- name: Build

0 commit comments

Comments
 (0)