-
Notifications
You must be signed in to change notification settings - Fork 154
83 lines (71 loc) · 2.55 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Build
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
name: [
linux-cmake-shared,
linux-cmake-static,
macos-cmake-shared,
macos-cmake-static,
windows-cmake-shared,
windows-cmake-static,
]
include:
- name: linux-cmake-shared
os: ubuntu-latest
build-system: cmake
CXXFLAGS: -Werror
cmake-options: -DBUILD_SHARED_LIBS=ON
- name: linux-cmake-static
os: ubuntu-latest
build-system: cmake
CXXFLAGS: -Werror
cmake-options: -DBUILD_SHARED_LIBS=OFF
- name: macos-cmake-shared
os: macos-latest
build-system: cmake
CXXFLAGS: -Werror
cmake-options: -DBUILD_SHARED_LIBS=ON
- name: macos-cmake-static
os: macos-latest
build-system: cmake
CXXFLAGS: -Werror
cmake-options: -DBUILD_SHARED_LIBS=OFF
- name: windows-cmake-shared
os: windows-latest
build-system: cmake
CXXFLAGS: /WX
cmake-options: -DBUILD_SHARED_LIBS=ON -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake
- name: windows-cmake-static
os: windows-latest
build-system: cmake
CXXFLAGS: /WX
cmake-options: -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install Linux dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update -y
sudo apt-get install -y pkg-config libjsoncpp-dev zlib1g-dev
- name: Install macOS dependencies
if: startsWith(matrix.os, 'macos')
run: brew install pkg-config jsoncpp zlib
- name: Install Windows dependencies
if: startsWith(matrix.os, 'windows')
run: vcpkg install zlib:x64-windows
- name: Create CMake Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
working-directory: ${{runner.workspace}}/build
run: cmake ${{github.workspace}} -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_CXX_FLAGS="${{matrix.CXXFLAGS}}" ${{matrix.cmake-options}}
- name: Build CMake
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config Release
- name: Test CMake
working-directory: ${{runner.workspace}}/build
run: ctest -C Release