-
Notifications
You must be signed in to change notification settings - Fork 117
120 lines (100 loc) · 3.63 KB
/
cmake.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Build and test
on: [push, pull_request]
jobs:
ubuntu-build:
name: Build - Ubuntu
strategy:
matrix:
os: ['ubuntu-20.04', 'ubuntu-22.04']
build_type: [Debug, Release]
compiler: [{c: gcc, cxx: g++}]
libbacktrace: ['-DVAL_USE_LIBBACKTRACE_BACKTRACE=OFF']
include:
- os: 'ubuntu-22.04'
build_type: Release
compiler: {c: clang, cxx: clang++}
libbacktrace: '-DVAL_USE_LIBBACKTRACE_BACKTRACE=OFF'
- os: 'ubuntu-22.04'
build_type: Release
compiler: {c: gcc, cxx: g++}
libbacktrace: '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON'
- os: 'ubuntu-22.04'
build_type: Release
compiler: {c: clang, cxx: clang++}
libbacktrace: '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON'
- os: 'ubuntu-20.04'
build_type: Release
compiler: {c: gcc-7, cxx: g++-7}
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y doxygen ${{matrix.compiler.c}}
- name: Install g++-7
if: matrix.compiler.cxx == 'g++-7'
run: |
sudo apt-get install -y ${{matrix.compiler.cxx}}
- name: Install pip packages
run: pip install -r third_party/requirements.txt
- name: Install libbacktrace
if: matrix.libbacktrace == '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON'
run: |
git clone https://github.com/ianlancetaylor/libbacktrace.git
cd libbacktrace
./configure
make
sudo make install
cd ..
- name: Configure CMake
run: >
cmake
-B${{github.workspace}}/build
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DUR_ENABLE_TRACING=ON
-DUR_DEVELOPER_MODE=ON
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DUR_BUILD_TESTS=ON
-DUR_FORMAT_CPP_STYLE=ON
${{matrix.libbacktrace}}
- name: Generate source from spec, check for uncommitted diff
if: matrix.os == 'ubuntu-22.04'
run: cmake --build ${{github.workspace}}/build --target check-generated
- name: Build
run: cmake --build ${{github.workspace}}/build -j $(nproc)
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "python|uma|loader|validation|tracing|unit|urtrace"
windows-build:
name: Build - Windows
strategy:
matrix:
os: ['windows-2019', 'windows-2022']
build_type: [Debug, Release]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install prerequisites
run: python3 -m pip install -r third_party/requirements.txt
- name: Configure CMake
run: >
cmake
-B${{github.workspace}}/build
-DCMAKE_POLICY_DEFAULT_CMP0094=NEW
-DUR_ENABLE_TRACING=ON
-DUR_DEVELOPER_MODE=ON
-DUR_BUILD_TESTS=ON
-DUR_FORMAT_CPP_STYLE=ON
- name: Generate source from spec, check for uncommitted diff
if: matrix.os == 'windows-2022'
run: cmake --build ${{github.workspace}}/build --target check-generated --config ${{matrix.build_type}}
- name: Build all
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j 2
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "python|uma|loader|validation|tracing|unit|urtrace"