-
Notifications
You must be signed in to change notification settings - Fork 140
66 lines (61 loc) · 2.07 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
name: C/C++ CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-linux-unix:
strategy:
matrix:
os: [ubuntu]
config: [Debug, RelWithDebInfo, Release]
standard: [c++98, c++11, c++14, c++17, c++20]
name: ${{matrix.os}}-${{matrix.config}}-${{matrix.standard}}
runs-on: ${{matrix.os}}-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt update && sudo apt install -y cmake make ninja-build zlib1g-dev
- name: Build
run: |
make \
BUILD_TYPE=${{matrix.config}} \
BUILD_SHARED_LIBS=ON \
BUILD_STATIC_LIBS=ON \
VERBOSE=1 \
prefix=/usr \
all
env:
CXXFLAGS_STD: ${{matrix.standard}}
- name: Install
run: make install DESTDIR=$PWD/dist prefix=/usr VERBOSE=1
env:
CXXFLAGS_STD: ${{matrix.standard}}
- name: Test
run: make test DESTDIR=$PWD/dist prefix=/usr VERBOSE=1
env:
CXXFLAGS_STD: ${{matrix.standard}}
build-windows:
runs-on: windows-latest
strategy:
matrix:
architecture: [x64]
config: [Debug, RelWithDebInfo, Release]
shared-libs: [ON, OFF]
standard: [c++98, c++11, c++14, c++17, c++20]
name: windows-${{matrix.architecture}}-${{matrix.config}}-${{matrix.standard}}-${{matrix.shared-libs}}
steps:
- uses: actions/checkout@v2
- name: Get ZLIB
run: vcpkg install zlib:${{matrix.architecture}}-windows
- name: CMake configure
run: cmake -D CMAKE_INSTALL_PREFIX=/dist -D CMAKE_BUILD_TYPE=${{matrix.config}} "-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -D PTEX_BUILD_SHARED_LIBS=${{matrix.shared-libs}} -A ${{matrix.architecture}} .
env:
CXXFLAGS_STD: ${{matrix.standard}}
- name: Build
run: cmake --build . --config ${{matrix.config}} --target install
env:
CXXFLAGS_STD: ${{matrix.standard}}
- name: Test
run: ctest --verbose --force-new-ctest-process --build-config ${{matrix.config}}