-
-
Notifications
You must be signed in to change notification settings - Fork 29
342 lines (297 loc) · 12.6 KB
/
RaZ.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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
name: RaZ
on: [push, pull_request]
jobs:
#########
# Linux #
#########
linux:
name: Linux (${{ matrix.compiler.c }}, ${{ matrix.build_type }}${{ !matrix.use_audio && ', no audio' || '' }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler:
- { c: gcc, cpp: g++ }
- { c: clang, cpp: clang++ }
build_type:
- Debug
- Release
use_audio:
- true
include:
- { compiler: { c: gcc, cpp: g++ }, build_type: Debug, use_audio: false }
steps:
- uses: actions/checkout@v3
# Installing the needed packages:
# - Ninja to build the project
# - GLEW & X11 as graphical dependencies
# - Lcov to output code coverage
# - Doxygen & Dot to generate the documentation
# - OpenAL-soft to handle the audio part
# - Xvfb to launch a headless server (allows GL context initialisation without a screen)
# - Gdb to run the unit tests with the debugger
# - Mesa-utils to get glxinfo
# Running glxinfo through xvfb to recover graphics capabilities
- name: Packages installation
run: |
sudo apt update && sudo apt install -y --no-install-recommends \
ninja-build \
libglew-dev libxi-dev libxcursor-dev libxrandr-dev libxinerama-dev libxxf86vm-dev \
lcov \
doxygen python3-pydot \
libopenal-dev \
xvfb \
gdb \
mesa-utils &&
xvfb-run -a glxinfo -B
# Installing the FBX SDK (in /usr)
# The installation asks for software user agreement (send 'yes'), then afterward if the README file should be opened (send 'n')
#- name: FBX SDK setup
# run: |
# wget http://download.autodesk.com/us/fbx/2019/2019.0/fbx20190_fbxsdk_linux.tar.gz -O ./fbx_sdk.tar.gz &&
# tar xvf ./fbx_sdk.tar.gz &&
# chmod +x ./fbx20190_fbxsdk_linux &&
# printf 'yes\nn' | sudo ./fbx20190_fbxsdk_linux /usr
- name: Build setup
run: cmake -E make_directory ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
- name: Configuration
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
cmake -GNinja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_C_COMPILER=${{ matrix.compiler.c }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp }} \
-DRAZ_BUILD_EXAMPLES=ON -DRAZ_GEN_DOC=ON -DRAZ_USE_AUDIO=${{ matrix.use_audio && 'ON' || 'OFF' }} \
-DRAZ_USE_FBX=OFF -DRAZ_BUILD_TESTS=ON ${{ matrix.compiler.c == 'gcc' && '-DRAZ_ENABLE_COVERAGE=ON' || '' }} \
-DSKIP_RENDERER_ERRORS=ON -DENABLE_DEBUG_INFO=ON \
${{ github.workspace }} &&
cmake --build . --target RaZ_PrintDebugInfo --config ${{ matrix.build_type }}
- name: Build
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
cmake --build . --config ${{ matrix.build_type }} &&
pwd && find .
# Running the tests using gdb to catch potential segfaults
- name: Test
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
ALSOFT_DRIVERS=null xvfb-run -a --server-args='-screen 0 1280x720x16' \
gdb --batch --return-child-result -x '${{ github.workspace }}/tests/assets/debug/gdb_commands.txt' ./tests/RaZ_Tests
# Preparing code coverage; only done with GCC in Debug with audio enabled
- name: Coverage setup
if: matrix.compiler.c == 'gcc' && matrix.build_type == 'Debug' && matrix.use_audio
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
lcov -d ./CMakeFiles/RaZ.dir/src/ -c -o coverage.info &&
lcov -r coverage.info '/usr/*' -o coverage.info &&
lcov -l coverage.info
# Processing code coverage; only done with GCC in Debug with audio enabled
- name: Coverage processing
if: matrix.compiler.c == 'gcc' && matrix.build_type == 'Debug' && matrix.use_audio
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: github-actions-${{ github.run_id }}
path-to-lcov: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}/coverage.info
# Installing RaZ in the build directory; default is /usr/local
- name: Install
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: sudo cmake --install . --prefix ./ --config ${{ matrix.build_type }}
- name: Upload build
if: matrix.use_audio
uses: actions/upload-artifact@v3
with:
name: linux-${{ matrix.compiler.c }}-${{ matrix.build_type }}-${{ github.run_id }}
path: |
${{ runner.workspace }}/build-${{ matrix.compiler.c }}/include
${{ runner.workspace }}/build-${{ matrix.compiler.c }}/lib
###########
# Windows #
###########
windows:
name: Windows (${{ matrix.compiler.c }}, ${{ matrix.build_type }}${{ !matrix.use_audio && ', no audio' || '' }})
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
compiler:
- { c: cl, cpp: cl }
build_type:
- Debug
- Release
use_audio:
- true
include:
- { compiler: { c: cl, cpp: cl }, build_type: Debug, use_audio: false }
steps:
- uses: actions/checkout@v3
# Installing OpenAL-soft to handle the audio part
- name: Build setup
run: |
curl --silent --insecure https://www.openal-soft.org/openal-binaries/openal-soft-1.21.0-bin.zip -O &&
7z x openal-soft-1.21.0-bin.zip &&
mv openal-soft-1.21.0-bin C:/OpenAL;
cmake -E make_directory ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
- name: Configuration
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
cmake -G"Visual Studio 17 2022" -A x64 \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DRAZ_BUILD_EXAMPLES=ON -DRAZ_GEN_DOC=OFF -DRAZ_USE_AUDIO=${{ matrix.use_audio && 'ON' || 'OFF' }} \
-DRAZ_USE_FBX=OFF -DRAZ_BUILD_TESTS=ON \
-DSKIP_RENDERER_ERRORS=ON -DENABLE_DEBUG_INFO=ON \
$GITHUB_WORKSPACE &&
cmake --build . --target RaZ_PrintDebugInfo --config ${{ matrix.build_type }}
- name: Build
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
cmake --build . --config ${{ matrix.build_type }} &&
pwd && find .
- name: Install
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: cmake --install . --prefix C:/RaZ --config ${{ matrix.build_type }}
- name: Upload build
if: matrix.use_audio
uses: actions/upload-artifact@v3
with:
name: windows-${{ matrix.compiler.c }}-${{ matrix.build_type }}-${{ github.run_id }}
path: |
C:/RaZ
#########
# macOS #
#########
macos:
name: macOS (${{ matrix.compiler.c }}, ${{ matrix.build_type }}${{ !matrix.use_audio && ', no audio' || '' }})
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
compiler:
- { c: clang, cpp: clang++ }
build_type:
- Debug
- Release
use_audio:
- true
include:
- { compiler: { c: clang, cpp: clang++ }, build_type: Debug, use_audio: false }
steps:
- uses: actions/checkout@v3
# Installing the needed packages:
# - Ninja to build the project
# - OpenAL-soft to handle the audio part
- name: Packages installation
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install \
ninja \
openal-soft
- name: Build setup
run: cmake -E make_directory ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
- name: Configuration
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
cmake -GNinja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_C_COMPILER=${{ matrix.compiler.c }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp }} \
-DRAZ_BUILD_EXAMPLES=ON -DRAZ_GEN_DOC=OFF -DRAZ_USE_AUDIO=${{ matrix.use_audio && 'ON' || 'OFF' }} \
-DRAZ_USE_FBX=OFF -DRAZ_BUILD_TESTS=ON \
-DSKIP_RENDERER_ERRORS=ON -DENABLE_DEBUG_INFO=ON \
$GITHUB_WORKSPACE &&
cmake --build . --target RaZ_PrintDebugInfo --config ${{ matrix.build_type }}
- name: Build
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
shell: bash
run: |
cmake --build . --config ${{ matrix.build_type }} &&
pwd && find .
# Installing RaZ in the build directory; default is /usr/local
- name: Install
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: sudo cmake --install . --prefix ./ --config ${{ matrix.build_type }}
- name: Upload build
if: matrix.use_audio
uses: actions/upload-artifact@v3
with:
name: macos-${{ matrix.compiler.c }}-${{ matrix.build_type }}-${{ github.run_id }}
path: |
${{ runner.workspace }}/build-${{ matrix.compiler.c }}/include
${{ runner.workspace }}/build-${{ matrix.compiler.c }}/lib
##############
# Emscripten #
##############
emscripten:
name: Emscripten (${{ matrix.compiler.c }}, ${{ matrix.build_type }}${{ !matrix.use_audio && ', no audio' || '' }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler:
- { c: emcc, cpp: em++, version: 3.1.0 } # The 'latest' version may fail to build
build_type:
- Debug
- Release
use_audio:
- true
include:
- { compiler: { c: emcc, cpp: em++, version: 3.1.0 }, build_type: Debug, use_audio: false }
steps:
- uses: actions/checkout@v3
# Installing the needed packages:
# - Ninja to build the project
# - GL & X11 as needed graphical dependencies
# - OpenAL-soft to handle the audio part
- name: Packages installation
run: |
sudo apt update && sudo apt install -y --no-install-recommends \
ninja-build \
libglew-dev libxi-dev libxcursor-dev libxrandr-dev libxinerama-dev libxxf86vm-dev \
libopenal-dev
#- name: FBX SDK setup
# run: |
# wget http://download.autodesk.com/us/fbx/2019/2019.0/fbx20190_fbxsdk_linux.tar.gz -O ./fbx_sdk.tar.gz &&
# tar xvf ./fbx_sdk.tar.gz &&
# chmod +x ./fbx20190_fbxsdk_linux &&
# printf 'yes\nn' | ./fbx20190_fbxsdk_linux /usr
# Caching Emscripten's installation; this avoids installing it on every build
- name: Emscripten caching
uses: actions/cache@v3
id: emsdk
with:
path: ~/emsdk
key: emsdk-${{ matrix.compiler.version }}
restore-keys: |
emsdk-${{ matrix.compiler.version }}
# Downloading & installing Emscripten; only done when failed to find its cached installation
- name: Emscripten setup
if: steps.emsdk.outputs.cache-hit != 'true'
shell: bash
run: |
git clone --depth 1 https://github.com/emscripten-core/emsdk.git ~/emsdk &&
~/emsdk/emsdk install ${{ matrix.compiler.version }} && ~/emsdk/emsdk activate ${{ matrix.compiler.version }}
# Downloading & installing Emscripten, to build RaZ in WebAssembly
- name: Build setup
shell: bash
run: cmake -E make_directory ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
- name: Configuration
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
source ~/emsdk/emsdk_env.sh &&
emcmake cmake -GNinja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DRAZ_BUILD_EXAMPLES=ON -DRAZ_GEN_DOC=OFF -DRAZ_USE_AUDIO=${{ matrix.use_audio && 'ON' || 'OFF' }} \
-DRAZ_USE_FBX=OFF -DRAZ_BUILD_TESTS=ON ${{ matrix.build_type == 'Debug' && '-DRAZ_EMSCRIPTEN_DEBUG_FAST_LINK=ON' || '' }} \
-DSKIP_RENDERER_ERRORS=ON -DENABLE_DEBUG_INFO=ON \
$GITHUB_WORKSPACE &&
cmake --build . --target RaZ_PrintDebugInfo --config ${{ matrix.build_type }}
- name: Build
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
cmake --build . --config ${{ matrix.build_type }} &&
pwd && find .