-
Notifications
You must be signed in to change notification settings - Fork 22
338 lines (318 loc) · 10.6 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
name: Regression tests
env:
MZXDEPS_DEBIAN_SDL2: "zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev"
MZXDEPS_DEBIAN_MISC: "libsdl1.2-dev libegl1-mesa-dev libmikmod-dev libopenmpt-dev"
MZXDEPS_MACOS: "libpng libogg libvorbis sdl2"
MZX_MAKE: "make -j4"
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
#
# Platform variants and distribution packages.
#
unix:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt update && sudo apt install -y --no-install-recommends $MZXDEPS_DEBIAN_SDL2
- uses: actions/checkout@v4
- name: Configure
run: ./config.sh --platform unix --enable-release --enable-sdlaccel
- name: Build
run: $MZX_MAKE
- name: Run tests
run: $MZX_MAKE test
- name: Install
run: sudo $MZX_MAKE install V=1
- name: Check install
run: command -v megazeux && [ -f "/usr/share/doc/megazeux/LICENSE" ] && [ -f "/etc/megazeux-config" ]
- name: Uninstall
run: sudo $MZX_MAKE uninstall V=1
- name: Check uninstall
run: true && [ ! -f "/usr/bin/megazeux" ] && [ ! -f "/usr/share/doc/megazeux/LICENSE" ] && [ ! -f "/etc/megazeux-config" ]
- name: Package source .tar.xz
run: make source
unix-portable:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt update && sudo apt install -y --no-install-recommends $MZXDEPS_DEBIAN_SDL2
- uses: actions/checkout@v4
- name: Configure
run: ./config.sh --platform unix-devel --enable-release --enable-sdlaccel
- name: Build
run: $MZX_MAKE
- name: Run tests
run: $MZX_MAKE test
- name: Package linux-amd64 .zip
run: make archive
unix-misc:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt update && sudo apt install -y --no-install-recommends $MZXDEPS_DEBIAN_SDL2 $MZXDEPS_DEBIAN_MISC
- uses: actions/checkout@v4
- name: Configure (SDL 1.2)
run: ./config.sh --platform unix-devel --enable-release --enable-sdl1
- name: Build (SDL 1.2)
run: $MZX_MAKE
- name: Run tests (SDL 1.2)
run: $MZX_MAKE test
- name: Distclean (SDL 1.2)
run: $MZX_MAKE distclean
- name: Configure (EGL/X11)
run: ./config.sh --platform unix-devel --enable-release --disable-sdl --enable-egl
- name: Build (EGL/X11)
run: $MZX_MAKE
# Note: EGL mzxrun builds can't run headless, unit tests only.
- name: Run tests (EGL/X11)
run: $MZX_MAKE unit
- name: Distclean (EGL/X11)
run: $MZX_MAKE distclean
- name: Configure (ModPlug)
run: ./config.sh --platform unix-devel --enable-release --enable-modplug
- name: Build (Modplug)
run: $MZX_MAKE
- name: Run tests (Modplug)
run: $MZX_MAKE test
- name: Distclean (Modplug)
run: $MZX_MAKE distclean
- name: Configure (MikMod)
run: ./config.sh --platform unix-devel --enable-release --enable-mikmod
- name: Build (MikMod)
run: $MZX_MAKE
- name: Run tests (MikMod)
run: $MZX_MAKE test
- name: Distclean (MikMod)
run: $MZX_MAKE distclean
- name: Configure (OpenMPT)
run: ./config.sh --platform unix-devel --enable-release --enable-openmpt
- name: Build (OpenMPT)
run: $MZX_MAKE
- name: Run tests (OpenMPT)
run: $MZX_MAKE test
- name: Distclean (OpenMPT)
run: $MZX_MAKE distclean
darwin-arm64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: brew install $MZXDEPS_MACOS
- name: Configure (darwin-devel)
run: ./config.sh --platform darwin-devel --prefix /opt/homebrew --enable-release --enable-sdlaccel
- name: Build (darwin-devel)
run: $MZX_MAKE
- name: Run tests (darwin-devel)
run: $MZX_MAKE test
darwin-x86_64:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: brew install $MZXDEPS_MACOS
- name: Configure (darwin-devel)
run: ./config.sh --platform darwin-devel --prefix /usr/local --enable-release --enable-sdlaccel
- name: Build (darwin-devel)
run: $MZX_MAKE
- name: Run tests (darwin-devel)
run: $MZX_MAKE test
MSYS2-MINGW64:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Setup msys2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
base-devel git zip
mingw-w64-x86_64-gcc mingw-w64-x86_64-zlib mingw-w64-x86_64-libpng
mingw-w64-x86_64-libogg mingw-w64-x86_64-libvorbis mingw-w64-x86_64-SDL2
- uses: actions/checkout@v4
- name: Configure x64
run: ./config.sh --platform win64 --enable-release
- name: Build x64
run: $MZX_MAKE
- name: Test x64
run: $MZX_MAKE test
- name: Package x64 .zip
run: make archive
MSYS2-MINGW32:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Setup msys2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
update: true
install: >-
base-devel git zip
mingw-w64-i686-gcc mingw-w64-i686-zlib mingw-w64-i686-libpng
mingw-w64-i686-libogg mingw-w64-i686-libvorbis mingw-w64-i686-SDL2
- uses: actions/checkout@v4
- name: Configure x86
run: ./config.sh --platform win32 --enable-release
- name: Build x86
run: $MZX_MAKE
- name: Test x86
run: $MZX_MAKE test
- name: Package x86 .zip
run: make archive
AArch64-Switch:
runs-on: ubuntu-latest
container: devkitpro/devkita64
steps:
- run: echo "PATH=$DEVKITPRO/devkitA64/bin:$PATH" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Configure Switch
run: arch/switch/CONFIG.SWITCH
- name: Build Switch
run: $MZX_MAKE
- name: Package Switch .zip
run: make archive
ARM-3DS:
runs-on: ubuntu-latest
container: devkitpro/devkitarm
steps:
- run: echo "PATH=$DEVKITPRO/devkitARM/bin:$PATH" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Configure 3DS
run: arch/3ds/CONFIG.3DS
- name: Build 3DS
run: $MZX_MAKE
- name: Package 3DS .zip
run: make archive
ARM-NDS:
runs-on: ubuntu-latest
container: devkitpro/devkitarm:20241104
steps:
- run: echo "PATH=$DEVKITPRO/devkitARM/bin:$PATH" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Configure NDS
run: arch/nds/CONFIG.NDS
- name: Build NDS
run: $MZX_MAKE
- name: Package NDS .zip
run: make archive
ARM-NDS-BlocksDS:
runs-on: ubuntu-latest
container: skylyrac/blocksds:slim-latest
steps:
- name: Install dependencies
run: apt update && apt install -y --no-install-recommends zip
- name: Install target dependencies
run: wf-pacman -Syu --noconfirm && wf-pacman -S --noconfirm toolchain-gcc-arm-none-eabi-zlib
- run: echo "BLOCKSDS=/opt/blocksds/core" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Configure NDS/BlocksDS
run: arch/nds-blocksds/CONFIG.NDS
- name: Build NDS/BlocksDS
run: $MZX_MAKE
- name: Package NDS/BlocksDS .zip
run: make archive
PowerPC-Wii:
runs-on: ubuntu-latest
container: devkitpro/devkitppc
steps:
- run: echo "PATH=$DEVKITPRO/devkitPPC/bin:$PATH" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Configure Wii
run: arch/wii/CONFIG.WII
- name: Build Wii
run: $MZX_MAKE
- name: Package Wii .zip
run: make archive
PowerPC-WiiU:
runs-on: ubuntu-latest
container: devkitpro/devkitppc
steps:
- run: echo "PATH=$DEVKITPRO/devkitPPC/bin:$PATH" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Configure Wii U
run: arch/wiiu/CONFIG.WIIU
- name: Build Wii U
run: $MZX_MAKE
- name: Package Wii U .zip
run: make archive
Emscripten-HTML5:
runs-on: ubuntu-latest
steps:
- name: Install Emscripten
uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.57
# actions-cache-folder: 'emsdk-cache'
- uses: actions/checkout@v4
- name: Configure HTML5
run: arch/emscripten/CONFIG.HTML5
- name: Build HTML5
run: $MZX_MAKE && make build
- name: Package HTML5 .zip
run: make archive
#
# Sanitizers.
#
AddressSanitizer:
runs-on: ubuntu-latest
env:
CC: clang
CXX: clang++
steps:
- name: Install dependencies
run: sudo apt update && sudo apt install -y --no-install-recommends $MZXDEPS_DEBIAN_SDL2
- uses: actions/checkout@v4
- name: Configure
run: ./config.sh --platform unix-devel --enable-asan --enable-extram
- name: Build
run: $MZX_MAKE
- name: Run tests
run: $MZX_MAKE test
# Note: requires all non-system/libc calls to be from instrumented libraries.
# For the regression tests, MZX can get away with just zlib.
# SDL calls into uninstrumented functions and is not built at all.
# libpng is temporarily disabled. libogg/libvorbis work with no issue.
# MemorySanitizer:
# runs-on: ubuntu-latest
# env:
# CC: clang
# CXX: clang++
# steps:
# - uses: actions/checkout@v4
# - name: Fetch dependencies
# run: |
# (cd scripts/deps;
# wget https://github.com/AliceLR/megazeux-dependencies/releases/download/v2.93c/megazeux-dependencies-2.93c-r0-linux-msan.tar.xz;
# tar -xJf megazeux-dependencies-*-linux-msan.tar.xz)
# - name: Configure
# run: ./config.sh --platform unix-devel --prefix scripts/deps/linux-msan/x86_64 --enable-msan --disable-sdl --disable-libpng --disable-x11 --enable-extram
# - name: Build
# run: $MZX_MAKE V=1
# - name: Run tests
# run: $MZX_MAKE V=1 test
UndefinedBehaviorSanitizer:
runs-on: ubuntu-latest
env:
CC: clang
CXX: clang++
UBSAN_OPTIONS: print_stacktrace=1
steps:
- name: Install dependencies
run: sudo apt update && sudo apt install -y --no-install-recommends $MZXDEPS_DEBIAN_SDL2
- uses: actions/checkout@v4
- name: Configure
run: ./config.sh --platform unix-devel --enable-ubsan --enable-extram
- name: Build
run: $MZX_MAKE
- name: Run tests
run: $MZX_MAKE test