Skip to content

Commit 5d141ed

Browse files
committed
Add macOS workflow with vcpkg
1 parent c9f6a96 commit 5d141ed

File tree

3 files changed

+61
-4
lines changed

3 files changed

+61
-4
lines changed

.github/workflows/linux.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
strategy:
88
fail-fast: false
99
matrix:
10-
build_type: [Debug, Release]
10+
config: [Debug, Release]
1111

1212
runs-on: ubuntu-latest
1313

@@ -20,14 +20,14 @@ jobs:
2020
run: sudo apt-get update && sudo apt-get install -yq libgtest-dev libboost-program-options-dev rapidjson-dev ninja-build
2121

2222
- name: Build GTest
23-
run: cmake -E make_directory gtest && cd gtest && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -G Ninja /usr/src/gtest && cmake --build . -j -v && sudo cmake --install .
23+
run: cmake -E make_directory gtest && cd gtest && cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} -G Ninja /usr/src/gtest && cmake --build . -j -v && sudo cmake --install .
2424

2525
- name: Create Build Environment
2626
run: cmake -E make_directory build
2727

2828
- name: Configure CMake
2929
working-directory: build
30-
run: cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -G Ninja $GITHUB_WORKSPACE
30+
run: cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} -G Ninja $GITHUB_WORKSPACE
3131

3232
- name: Build the Project
3333
working-directory: build

.github/workflows/macos.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: macOS
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
xcode:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
config: [Debug, Release]
11+
12+
runs-on: macos-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
submodules: true
18+
19+
- name: Cache vcpkg
20+
uses: actions/cache@v2
21+
id: cache-vcpkg
22+
with:
23+
path: vcpkg/
24+
key: vcpkg-x64-osx
25+
26+
- name: Install Dependencies
27+
if: ${{ !steps.cache-vcpkg.outputs.cache-hit }}
28+
shell: pwsh
29+
run: |
30+
git clone https://github.com/microsoft/vcpkg
31+
cd vcpkg
32+
./bootstrap-vcpkg.sh -allowAppleClang
33+
./vcpkg integrate install
34+
./vcpkg install boost-program-options rapidjson gtest
35+
36+
- name: Create Build Environment
37+
run: cmake -E make_directory build
38+
39+
- name: Configure
40+
shell: pwsh
41+
working-directory: build/
42+
run: |
43+
$vcpkgToolchain = Join-Path '../vcpkg' './scripts/buildsystems/vcpkg.cmake' -Resolve
44+
45+
cmake "-DCMAKE_TOOLCHAIN_FILE=$vcpkgToolchain" ${{ github.workspace }}
46+
47+
- name: Configure
48+
working-directory: build/
49+
run: cmake $GITHUB_WORKSPACE
50+
51+
- name: Build
52+
working-directory: build/
53+
run: cmake --build . --config ${{ matrix.build_type }} -j -v
54+
55+
- name: Test
56+
working-directory: build/
57+
run: ctest --config ${{ matrix.build_type }} --output-on-failure

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
5757
- name: Build
5858
working-directory: build/
59-
run: cmake --build . --config ${{ matrix.config }}
59+
run: cmake --build . --config ${{ matrix.config }} -j -v
6060

6161
- name: Test
6262
working-directory: build/

0 commit comments

Comments
 (0)