-
Notifications
You must be signed in to change notification settings - Fork 288
71 lines (58 loc) · 2.26 KB
/
ci.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
name: ci
on: push
permissions:
contents: read
jobs:
build:
strategy:
matrix:
container: [ ubuntu-latest, macos-latest, windows-latest ]
build_type: [ Debug, Release ]
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ${{ matrix.container }}
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Configure
shell: bash
# Configure CMake in a 'buildX' subdirectory.
# We can't use `build` as `BUILD` is already taken by the bazel build file.
# On Mac and Windows this leads to a conflict.
run: |
mkdir -p buildX
cd buildX
cmake -DBUILD_TESTING=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_INSTALL_PREFIX:PATH=${{ github.workspace }}/install_dir \
-DBUILD_SHARED_LIBS=ON \
..
- name: Build shared
run: |
cmake --build buildX --config ${{ matrix.build_type }}
- name: Install shared
run: |
cmake --install buildX --config ${{ matrix.build_type }}
- name: Build static
run: |
cmake -DBUILD_SHARED_LIBS=OFF buildX
cmake --build buildX --config ${{ matrix.build_type }}
- name: Install static
run: |
cmake --install buildX --config ${{ matrix.build_type }}
- name: Test
if: runner.os != 'Windows'
working-directory: ${{ github.workspace }}/buildX
# Execute all tests.
run: |
ctest
# Also run the tests directly, just in case we forgot to add it to ctest.
test/cctest/cctest
- name: Test - Windows
if: runner.os == 'Windows'
working-directory: ${{ github.workspace }}/buildX
# Execute all tests.
run: |
ctest -C ${{ matrix.build_type }}
# Also run the tests directly, just in case we forgot to add it to ctest.
test/cctest/${{ matrix.build_type }}/cctest.exe