-
Notifications
You must be signed in to change notification settings - Fork 101
367 lines (318 loc) · 9.63 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
name: Test Builds
on:
push:
branches:
- master
- staging
- staging/*
- v[0-9].[0-9]**
paths:
- "**.c"
- "**.h"
- "**.m"
- "**.yml"
- "**.yaml"
- "**.build"
- "**.ini"
- "**.wrap"
pull_request:
paths:
- "**.c"
- "**.h"
- "**.m"
- "**.yml"
- "**.yaml"
- "**.build"
- "**.ini"
- "**.wrap"
env:
MESON_VERSION: '0.63.3'
EM_VERSION: '3.1.68'
PYTHON_VERSION: '3.11.8'
EM_CACHE_FOLDER: 'emsdk'
TAISEI_NOPRELOAD: 0
TAISEI_PRELOAD_REQUIRED: 1
jobs:
linux-test-build:
name: Linux (x64)
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-20.04
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Tools
run: >
sudo apt update || true # debian cache is not atomic and can sometimes fail
sudo apt install -y -qq
build-essential
libsdl2-dev
libogg-dev
libopusfile-dev
libpng-dev
libzip-dev
libx11-dev
libwayland-dev
python3-docutils
libwebp-dev
libfreetype6-dev
libzstd-dev
libssl-dev
pip install
meson==${{ env.MESON_VERSION }}
ninja
zstandard
- name: Configure
run: >
meson setup build/
--native-file misc/ci/common-options.ini
--native-file misc/ci/nofallback.ini
--native-file misc/ci/linux-x86_64-build-test-ci.ini
--prefix=$(pwd)/build-test
- name: Build
run: |
meson compile -C build/ --verbose
meson install -C build/
- name: Run Test
run: $(pwd)/build-test/bin/taisei -R $(pwd)/misc/ci/tests/test-replay.tsr
env:
TAISEI_NOPRELOAD: ${{ env.TAISEI_NOPRELOAD }}
TAISEI_PRELOAD_REQUIRED: ${{ env.TAISEI_PRELOAD_REQUIRED }}
- name: Upload Log
if: always()
uses: actions/upload-artifact@v4
with:
name: taisei_linux_fail_log
path: build/meson-logs/meson-log.txt
if-no-files-found: warn
macos-test-build:
name: macOS (x64)
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: macos-14
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Tools
run: >
brew install
gcc
pkg-config
docutils
pygments
freetype2
libzip
opusfile
libvorbis
webp
sdl2
ninja
pip install
meson==${{ env.MESON_VERSION }}
ninja
setuptools
zstandard
--break-system-packages
- name: Configure
run: >
meson setup build/
--native-file misc/ci/common-options.ini
--native-file misc/ci/nofallback.ini
--native-file misc/ci/macos-x86_64-build-test-ci.ini
--prefix=$(pwd)/build-test
- name: Build
run: |
meson compile -C build/ --verbose
meson install -C build/
- name: Run Test
run: $(pwd)/build-test/Taisei.app/Contents/MacOS/Taisei -R $(pwd)/misc/ci/tests/test-replay.tsr
env:
TAISEI_NOPRELOAD: ${{ env.TAISEI_NOPRELOAD }}
TAISEI_PRELOAD_REQUIRED: ${{ env.TAISEI_PRELOAD_REQUIRED }}
- name: Upload Log
if: always()
uses: actions/upload-artifact@v4
with:
name: taisei_macos_fail_log
path: build/meson-logs/meson-log.txt
if-no-files-found: warn
windows-test-build:
name: Windows (x64)
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
container: taiseiproject/windows-toolkit:20240304 # cross-compiler with mingw
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Configure Taisei (Meson)
run: >
meson setup build/
--cross-file misc/ci/common-options.ini
--cross-file misc/ci/forcefallback.ini
--cross-file misc/ci/windows-llvm_mingw-x86_64-build-test-ci.ini
--prefix=$(pwd)/build-test
- name: Build
run: |
meson compile -C build/ --verbose
meson install -C build/
- name: Upload Log
if: always()
uses: actions/upload-artifact@v4
with:
name: taisei_windows_fail_log
path: build/meson-logs/meson-log.txt
if-no-files-found: warn
emscripten-test-build:
name: "Emscripten"
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-20.04
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: Fetch Git Tags
run: |
git config --add safe.directory $(pwd)
git fetch --force --tags
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Tools
run: >
sudo apt update || true
sudo apt install -y -qq
python3-docutils
python3-pip
git
pip install
meson==${{ env.MESON_VERSION }}
ninja
zstandard
python-gnupg # required as we call into gen-dist.py for Emscripten
- name: Fetch Cached Emscripten SDK
id: emsdk-cache
uses: actions/cache@v4
with:
path: ${{ env.EM_CACHE_FOLDER }}
key: ${{ env.EM_VERSION }}-${{ runner.os }}
- name: Install Emscripten SDK
if: steps.emsdk-cache.outputs.cache-hit != 'true'
run: |
rm -rf ./${{ env.EM_CACHE_FOLDER }}/
git clone https://github.com/emscripten-core/emsdk.git ${{ env.EM_CACHE_FOLDER }}
${{ env.EM_CACHE_FOLDER }}/emsdk install ${{ env.EM_VERSION }}
${{ env.EM_CACHE_FOLDER }}/emsdk activate ${{ env.EM_VERSION }}
- name: Verify Emscripten SDK
run: |
source ${{ env.EM_CACHE_FOLDER }}/emsdk_env.sh
emcc -v
tee misc/ci/emscripten-ephemeral-ci.ini <<EOF >/dev/null
[constants]
toolchain = '$(pwd)/${{ env.EM_CACHE_FOLDER }}/upstream/emscripten/'
EOF
- name: Configure Standard Version
run: >
scripts/version.py > .VERSION.tmp
mv .VERSION.tmp .VERSION
source ${{ env.EM_CACHE_FOLDER }}/emsdk_env.sh
meson setup build/
--cross-file misc/ci/common-options.ini
--cross-file misc/ci/forcefallback.ini
--cross-file misc/ci/emscripten-ephemeral-ci.ini
--cross-file misc/ci/emscripten-build.ini
--prefix=$(pwd)/taisei-web-test
-Dbuild.cpp_std=gnu++14
- name: Build Standard Version
run: |
source ${{ env.EM_CACHE_FOLDER }}/emsdk_env.sh
meson compile tar -C build/ --verbose
- name: Checkout taisei-web-test
uses: actions/checkout@v4
if: github.ref == 'refs/heads/master'
with:
repository: taisei-project/taisei-web-test
ssh-key: ${{ secrets.WEB_SSH_DEPLOY_KEY }}
path: taisei-web-test
clean: false
- name: Prepare taisei-web-test
if: github.ref == 'refs/heads/master'
run: |
rm -v taisei-web-test/data/*
- name: Install Standard Version to taisei-web-test
if: github.ref == 'refs/heads/master'
run: |
meson install -C build --no-rebuild
- name: Configure Developer Version
if: github.ref == 'refs/heads/master'
run: |
source ${{ env.EM_CACHE_FOLDER }}/emsdk_env.sh
sed -i "s/^\(taisei_basename = \).*/\1'taisei-dev'/" src/meson.build # I'm sorry
meson setup --reconfigure $(pwd) build/ -Ddeveloper=true
- name: Build Developer Version
if: github.ref == 'refs/heads/master'
run: |
source ${{ env.EM_CACHE_FOLDER }}/emsdk_env.sh
meson compile -C build/ --verbose
- name: Install Developer Version to taisei-web-test
if: github.ref == 'refs/heads/master'
run: |
meson install -C build --no-rebuild
- name: Deploy to taisei-web-test
if: github.ref == 'refs/heads/master'
run: |
TAISEI_VERSION=$(scripts/version.py)
cd taisei-web-test
git config user.name 'Nitori Kawashiro [bot]'
git config user.email 'release@taisei-project.org'
git add .
git commit -m "Taisei $TAISEI_VERSION"
git push
- name: Upload Log
if: always()
uses: actions/upload-artifact@v4
with:
name: taisei_emscripten_stable_build_log
path: build/meson-logs/meson-log.txt
if-no-files-found: warn
switch-test-build:
name: Switch (ARM64)
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
container: taiseiproject/switch-toolkit:20240305
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Configure
run: >
switch/crossfile.sh > misc/ci/switch-crossfile-ci.ini
meson setup build/
--cross-file misc/ci/common-options.ini
--cross-file misc/ci/switch-options.ini
--cross-file misc/ci/switch-crossfile-ci.ini
--prefix=$(pwd)/build-test
- name: Build
run: meson compile -C build/ --verbose
- name: Upload Log
if: always()
uses: actions/upload-artifact@v4
with:
name: taisei_switch_build_log
path: build/meson-logs/meson-log.txt
if-no-files-found: warn