-
Notifications
You must be signed in to change notification settings - Fork 12
276 lines (230 loc) · 8.63 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
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
name: ci
on:
pull_request:
release:
types: [published]
push:
# tags:
# branches:
# - main
# - develop
env:
# Conan cache environment variables
CONAN_SYSREQUIRES_MODE: enabled
CONAN_USER_HOME: "${{ github.workspace }}/conan-cache"
CONAN_USER_HOME_SHORT: "${{ github.workspace }}/conan-cache/short"
jobs:
Clang-tidy:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Cache
uses: ./.github/actions/setup_cache
with:
compiler: llvm
build_type: Release
doxygen: "OFF"
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: llvm
cmake: true
conan: "2.2.2"
clangtidy: true
- name: Setup Linux
run: |
sudo apt install -y libglfw3-dev libglfw3
- name: Checking conan version
run: |
conan --version
- name: Create default conan profile
run: |
conan profile detect
- name: Installing conan dependencies
run: |
conan install . --build=missing -s build_type=Release
- name: Configure CMake
run: |
cmake -B ./build -S. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="build/Release/generators/conan_toolchain.cmake" -DENABLE_MAIN=ON -DENABLE_TESTING=ON -DENABLE_DOXYGEN=OFF -DLOG_LEVEL=DATA -DWARNINGS_AS_ERRORS=ON -DENABLE_CPPCHECK=OFF -DENABLE_CLANG_TIDY=ON -DENABLE_INCLUDE_WHAT_YOU_USE=OFF
- name: Copy compile commands
run: |
cmake --build ./build --target copy-compile-commands --config Release
- name: Run clang-tidy on ./src
run: |
python3 ./tools/run-clang-tidy.py $PWD/src
- name: Run clang-tidy on ./test
run: |
python3 ./tools/run-clang-tidy.py $PWD/test
Documentation:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Cache
uses: ./.github/actions/setup_cache
with:
compiler: gcc-11
build_type: Release
doxygen: "ON"
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: gcc-11
cmake: true
conan: "2.2.2"
doxygen: true
- name: Setup Linux
run: |
sudo apt install -y libglfw3-dev libglfw3
sudo apt install -y flex bison graphviz dia mscgen pdf2svg texlive texlive-lang-german texlive-latex-extra ghostscript
- name: Cleanup Conan system packages (they are not properly cached)
run: |
conan remove -f '*/system/*' || true
- name: Checking conan version
run: |
conan --version
- name: Create default conan profile
run: |
conan profile detect
- name: Installing conan dependencies
run: |
conan install . --build=missing -s build_type=Release
- name: Configure CMake
run: |
cmake -B ./build -S. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="build/Release/generators/conan_toolchain.cmake" -DENABLE_MAIN=OFF -DENABLE_TESTING=OFF -DENABLE_DOXYGEN=ON -DLOG_LEVEL=OFF -DENABLE_CLANG_TIDY=OFF -DENABLE_CPPCHECK=OFF -DENABLE_INCLUDE_WHAT_YOU_USE=OFF -DDOC_CHECK_CODE_DOCUMENTATION=YES
- name: Check documentation
run: |
cmake --build ./build --target doc --config Release
Test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- macos-12
- windows-2022
compiler:
# you can specify the version after `-` like "llvm-13.0.0".
- llvm
- gcc-11
- msvc-2022
build_type:
- Release
- Debug
log-level:
- "DEBUG"
exclude:
- os: ubuntu-22.04
compiler: msvc-2022
- os: macos-12
compiler: gcc-11
- os: macos-12
compiler: msvc-2022
- os: windows-2022
compiler: gcc-11
- os: windows-2022
compiler: llvm
include:
# Add appropriate variables for gcov version required. This will intentionally break
# if you try to use a compiler that does not have gcov set
- compiler: gcc-11
gcov_executable: gcov-11
- compiler: llvm
gcov_executable: "llvm-cov gcov-11"
- os: ubuntu-22.04
compiler: gcc-11
build_type: Release
log-level: "OFF"
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Cache
uses: ./.github/actions/setup_cache
with:
compiler: ${{ matrix.compiler }}
build_type: ${{ matrix.build_type }}
doxygen: "OFF"
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows' )}}
cmake: true
# brew: true
conan: "2.2.2"
ccache: true
gcovr: "7.2"
- name: Setup MacOS
if: ${{ runner.os == 'macOS' }}
run: |
brew install glfw
- name: Setup Linux
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt install -y libglfw3-dev libglfw3
- name: Setup Windows
if: ${{ runner.os == 'Windows' }}
run: |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
choco install ninja
choco install visualstudio2019buildtools --package-parameters "--includeRecommended --includeOptional"
choco install visualstudio2019-workload-vctools
choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64"
- name: Configure MSVC environment
if: ${{ runner.os == 'Windows' }}
shell: cmd
run: |
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
set
- name: Cleanup Conan system packages (they are not properly cached)
run: |
conan remove -f '*/system/*' || true
- name: Create default conan profile
run: |
conan profile detect
- name: Create custom conan profile
if: ${{ runner.os != 'Windows' }}
run: |
mkdir -p ~/.conan/profiles
conan profile detect --force
echo 'settings.compiler.cppstd=17' >> ~/.conan/profiles/default
- name: Create Conan profile for Windows
if: ${{ runner.os == 'Windows' }}
run: |
conan profile detect --force
conan profile update default --settings compiler.cppstd=17
conan profile update default --settings compiler.version=193
conan profile update default --settings compiler.runtime=dynamic
conan profile update default --settings compiler.toolset=v142
- name: Installing conan dependencies
run: |
conan install . --build=missing -s build_type=${{matrix.build_type}} -s compiler.cppstd=17
- name: Configure CMake
run: |
cmake -S . -B ./build -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -DCMAKE_TOOLCHAIN_FILE="build/${{matrix.build_type}}/generators/conan_toolchain.cmake" -DENABLE_MAIN=TRUE -DENABLE_TESTING=TRUE -DENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }} -DENABLE_DOXYGEN=OFF -DLOG_LEVEL:STRING=${{matrix.log-level}} -DWARNINGS_AS_ERRORS:BOOL=${{ !contains(matrix.os, 'windows' )}} -DENABLE_CPPCHECK=OFF -DENABLE_CLANG_TIDY=OFF -DENABLE_INCLUDE_WHAT_YOU_USE=OFF
- name: Build
run: |
cmake --build ./build --config ${{matrix.build_type}}
- name: Test
working-directory: ./build
run: |
ctest -C ${{matrix.build_type}} --output-on-failure --timeout 180
- name: Coverage
if: ${{ runner.os != 'Windows' && matrix.build_type == 'Debug' }}
run: |
mkdir -p build/coverage
gcovr --config doc/coverage/gcovr.cfg --gcov-executable '${{ matrix.gcov_executable }}'
- name: Publish to codecov
uses: codecov/codecov-action@v3
with:
flags: ${{ runner.os }}
name: ${{ runner.os }}-coverage
files: ./build/cobertura.xml