-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (49 loc) · 2.05 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
name: Build
on: [push, pull_request]
env:
BUILD_PATH: "${{ github.workspace }}/build"
VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/build/vcpkg_binary_cache,readwrite"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { os: macos-latest, cc: clang, cxx: clang++, build-type: Debug }
- { os: macos-latest, cc: clang, cxx: clang++, build-type: Release }
- { os: macos-latest, cc: gcc, cxx: g++, build-type: Debug }
- { os: macos-latest, cc: gcc, cxx: g++, build-type: Release }
- { os: ubuntu-latest, cc: clang, cxx: clang++, build-type: Debug }
- { os: ubuntu-latest, cc: clang, cxx: clang++, build-type: Release }
- { os: ubuntu-latest, cc: gcc, cxx: g++, build-type: Debug }
- { os: ubuntu-latest, cc: gcc, cxx: g++, build-type: Release }
- { os: windows-latest, cc: cl, cxx: cl, build-type: Debug }
- { os: windows-latest, cc: cl, cxx: cl, build-type: Release }
- { os: windows-latest, cc: gcc, cxx: g++, build-type: Debug }
- { os: windows-latest, cc: gcc, cxx: g++, build-type: Release }
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v2
with:
submodules: true
- name: Restore cached dependencies
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/build/vcpkg_binary_cache
key: ${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.cxx }}
- name: Configure CMake
run: cmake -S . -B ${{ env.BUILD_PATH }} -D CMAKE_BUILD_TYPE=${{ matrix.build-type }} -D BUILD_EXAMPLES=ON
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
- name: Build
run: cmake --build ${{ env.BUILD_PATH }} --config ${{ matrix.build-type }}
- name: Test
working-directory: ${{ env.BUILD_PATH }}
run: ctest -C ${{ matrix.build-type }}
docs:
needs: build
runs-on: ubuntu-latest
steps:
- run: echo "Building docs"