-
-
Notifications
You must be signed in to change notification settings - Fork 91
392 lines (328 loc) · 12.3 KB
/
main.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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
name: Build
env:
VCPKG_DEFAULT_TRIPLET: 'x64-windows-static'
on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
mac:
timeout-minutes: 60
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- name: Setup
run: brew install sdl2 jpeg-turbo python curl glslang ninja ccache pkg-config
- name: ccache
uses: actions/cache@v4
with:
path: |
~/.ccache
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
- name: Build
run: |
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=On -DUSE_SANITIZERS=ON
cmake --build .
- name: Test
run: |
cd build
ctest -V -E shelltests .
- name: Package
run: |
cd build
cmake --build . --target package
- name: Upload the dmg
uses: actions/upload-artifact@v4
with:
name: mac-dmg
path: build/*.dmg
- name: Upload the voxedit app
uses: actions/upload-artifact@v4
with:
name: mac-vengi-voxedit-app
path: build/voxedit/vengi-voxedit.app
- name: Upload the voxconvert app
uses: actions/upload-artifact@v4
with:
name: mac-vengi-voxconvert-app
path: build/voxconvert/vengi-voxconvert.app
- name: Upload the thumbnailer app
uses: actions/upload-artifact@v4
with:
name: mac-vengi-thumbnailer-app
path: build/thumbnailer/vengi-thumbnailer.app
packages:
timeout-minutes: 45
if: github.repository == 'vengi-voxel/vengi'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup
run: |
sudo apt-get update
sudo apt-get install make cmake debhelper devscripts build-essential lintian binutils-dev libunwind-dev libjpeg-dev libfreetype-dev liblua5.4-dev libcurl4-gnutls-dev libsdl2-dev wayland-protocols pkg-config python3 ccache python3-dateutil dh-cmake ninja-build
- name: ccache
uses: actions/cache@v4
with:
path: |
~/.ccache
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
- name: Ubuntu
run: |
make deb
mv ../*.deb .
- name: Upload the ubuntu artifacts
uses: actions/upload-artifact@v4
with:
name: linux-debian
path: vengi*.deb
- name: Upload the ubuntu release artifacts
if: startsWith(github.ref, 'refs/tags/')
uses: Roang-zero1/github-upload-release-artifacts-action@master
with:
args: vengi*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
linux-ui-tests:
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup
run: |
sudo apt-get update
sudo apt-get install binutils-dev libunwind-dev libfreetype-dev liblua5.4-dev libcurl4-gnutls-dev libsdl2-dev wayland-protocols pkg-config ninja-build python3 ccache curl lua-check libjpeg-dev
- name: ccache
uses: actions/cache@v4
with:
path: |
~/.ccache
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
- name: Linux
env:
CC: gcc-12
CXX: g++-12
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -GNinja -DUSE_SANITIZERS=OFF -DUSE_LINK_TIME_OPTIMIZATION=OFF -DCMAKE_UNITY_BUILD=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DUSE_IMGUITESTENGINE=On
cmake --build . --target codegen
cmake --build . --target tests-voxedit
linux:
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup
run: |
sudo apt-get update
sudo apt-get install appstream libfuse2 binutils-dev libunwind-dev libfreetype-dev liblua5.4-dev libcurl4-gnutls-dev libsdl2-dev wayland-protocols pkg-config ninja-build python3 ccache curl lua-check libjpeg-dev
- name: ccache
uses: actions/cache@v4
with:
path: |
~/.ccache
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
- name: Linux
env:
CC: gcc-12
CXX: g++-12
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -GNinja -DUSE_SANITIZERS=OFF -DUSE_LINK_TIME_OPTIMIZATION=OFF -DCMAKE_UNITY_BUILD=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On
cmake --build .
cmake --install . --component voxedit --prefix install-voxedit/usr
- name: Test
run: |
cd build
ctest -V .
- name: luacheck
run: |
cd src
luacheck --codes .
- name: AppImage
run: |
curl https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20220822-1/linuxdeploy-x86_64.AppImage --output linuxdeploy-x86_64.AppImage --silent -L -f
chmod +x linuxdeploy-x86_64.AppImage
./linuxdeploy-x86_64.AppImage --output=appimage --appdir build/install-voxedit
- name: Upload voxedit AppImage artifacts
uses: actions/upload-artifact@v4
with:
name: linux-appimage-voxedit
path: "voxedit*.AppImage"
emscripten:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup
run: |
sudo apt-get update
sudo apt-get install libfreetype-dev libjpeg-dev liblua5.4-dev libsdl2-dev wayland-protocols pkg-config ninja-build python3 ccache
- uses: mymindstorm/setup-emsdk@v13
with:
version: 3.1.40
- name: ccache
uses: actions/cache@v4
with:
path: |
~/.ccache
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-emscripten-build-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-emscripten-build-${{ hashFiles('**/CMakeLists.txt') }}
- name: Emscripten
run: |
cmake -H. -Bbuild -GNinja -DUSE_SANITIZERS=ON
cmake --build build --target codegen
mkdir -p build/emscripten
cp -r build/generated build/emscripten
emcmake cmake -H. -Bbuild/emscripten -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On
cmake --build build/emscripten --target voxedit
- name: Upload the build artifacts
uses: actions/upload-artifact@v4
with:
name: emscripten
path: build/emscripten/voxedit
windows:
timeout-minutes: 45
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- name: Build
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
- name: Test
run: |
cd build
ctest -V -C Release .
- name: Install
run: |
cd build
cmake --install . --component voxedit --prefix voxedit-install
cmake --install . --component thumbnailer --prefix thumbnailer-install
cmake --install . --component voxelthumb --prefix thumbnailer-install
cmake --install . --component voxconvert --prefix voxconvert-install
cmake --install . --component voxconvertui --prefix voxconvert-install
cpack
- name: Upload the cpack logs
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: nsis-error-logs
path: build/_CPack_Packages/Windows/NSIS/NSISOutput.log
- name: Upload the vengi msi
uses: actions/upload-artifact@v4
with:
name: win-vengi-msi
path: build/vengi.msi
- name: Upload the voxedit artifacts
uses: actions/upload-artifact@v4
with:
name: win-voxedit
path: build/voxedit-install/
- name: Upload the tests artifacts
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: windows-release-tests
path: build/tests-*/*
- name: Upload the voxconvert artifacts
uses: actions/upload-artifact@v4
with:
name: win-voxconvert
path: build/voxconvert-install/
- name: Upload the thumbnailer artifacts
uses: actions/upload-artifact@v4
with:
name: win-thumbnailer
path: build/thumbnailer-install/
windows-debug:
timeout-minutes: 45
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- name: Build
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DUSE_SANITIZERS=ON
cmake --build .
- name: Install
run: |
cd build
cmake --install . --component voxedit --prefix voxedit-install
cmake --install . --component thumbnailer --prefix thumbnailer-install
cmake --install . --component voxelthumb --prefix thumbnailer-install
cmake --install . --component voxconvert --prefix voxconvert-install
cmake --install . --component voxconvertui --prefix voxconvert-install
- name: Upload the voxedit artifacts
uses: actions/upload-artifact@v4
with:
name: win-voxedit-debug
path: build/voxedit-install/
- name: Upload the voxconvert artifacts
uses: actions/upload-artifact@v4
with:
name: win-voxconvert-debug
path: build/voxconvert-install/
windows-msys:
timeout-minutes: 45
runs-on: windows-2022
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- name: Setup
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
pacboy: >-
gcc:p
cmake:p
ccache:p
mbedtls:p
freetype:p
ninja:p
SDL2:p
- name: Build
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
- name: Install
run: |
cd build
cmake --install . --component voxedit --prefix voxedit-install
cmake --install . --component thumbnailer --prefix thumbnailer-install
cmake --install . --component voxelthumb --prefix thumbnailer-install
cmake --install . --component voxconvert --prefix voxconvert-install
cmake --install . --component voxconvertui --prefix voxconvert-install
- name: Upload the voxedit artifacts
uses: actions/upload-artifact@v4
with:
name: win-voxedit-msys-release
path: build/voxedit-install/
- name: Upload the voxconvert artifacts
uses: actions/upload-artifact@v4
with:
name: win-voxconvert-msys-release
path: build/voxconvert-install/