-
Notifications
You must be signed in to change notification settings - Fork 5
69 lines (62 loc) · 1.71 KB
/
cmake.yml
File metadata and controls
69 lines (62 loc) · 1.71 KB
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
name: CMake Build Matrix
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
BUILD_TYPE: Release
BUILD_DIR: ${{ github.workspace }}/build
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows Latest",
os: "windows-latest",
cc: "cl",
cxx: "cl",
}
- {
name: "Ubuntu 22.04 GCC",
os: "ubuntu-22.04",
cc: "gcc",
cxx: "g++",
}
- {
name: "Ubuntu 22.04 Clang",
os: "ubuntu-22.04",
cc: "clang-14",
cxx: "clang++-14",
}
- {
name: "MacOS Latest",
os: "macos-latest",
cc: "clang",
cxx: "clang++",
}
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: Configure CMake
run: >
cmake -B ${{ env.BUILD_DIR }}
-DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }}
-DCMAKE_C_COMPILER=${{ matrix.config.cc }}
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
-DEJSON_UNITTEST=ON
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ env.BUILD_DIR }} --config ${{env.BUILD_TYPE}}
- name: Check Tests
working-directory: ${{ env.BUILD_DIR }}
run: ctest --build-config ${{ env.BUILD_TYPE }} --rerun-failed --output-on-failure