-
Notifications
You must be signed in to change notification settings - Fork 405
455 lines (448 loc) · 18.9 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
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
name: continuous-integration
on: [push, pull_request]
jobs:
linux-os:
runs-on: ubuntu-22.04
permissions:
checks: write
pull-requests: write
env:
ALSOFT_CONF: love2d-${{ github.sha }}/testing/resources/alsoft.conf
DISPLAY: :99
steps:
- name: Update APT
run: sudo apt-get update
- name: Install Dependencies
run: |
sudo apt-get install --assume-yes build-essential git make cmake autoconf automake \
libtool pkg-config libasound2-dev libpulse-dev libaudio-dev \
libjack-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev \
libxfixes-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev \
libgl1-mesa-dev libdbus-1-dev libudev-dev libgles2-mesa-dev \
libegl1-mesa-dev libibus-1.0-dev fcitx-libs-dev libsamplerate0-dev \
libsndio-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev \
libcurl4-openssl-dev libfuse2 wmctrl openbox mesa-vulkan-drivers \
libvulkan1 vulkan-tools vulkan-validationlayers
- name: Checkout love-appimage-source
uses: actions/checkout@v3
with:
repository: love2d/love-appimage-source
ref: 12.x
- name: Checkout LÖVE
uses: actions/checkout@v3
with:
path: love2d-${{ github.sha }}
- name: Get Dependencies for AppImage
shell: python
env:
LOVE_BRANCH: ${{ github.sha }}
run: |
import os
for i in range(250):
if os.system(f"make getdeps LOVE_BRANCH={os.environ['LOVE_BRANCH']}") == 0:
raise SystemExit(0)
raise Exception("make getdeps failed")
- name: Build AppImage
run: make LOVE_BRANCH=${{ github.sha }}
- name: Print LuaJIT branch
run: git -C LuaJIT-v2.1 branch -v
# start xvfb for test running
- name: Start xvfb and openbox
run: |
echo "Starting XVFB on $DISPLAY"
Xvfb $DISPLAY -screen 0, 360x240x24 &
echo "XVFBPID=$!" >> $GITHUB_ENV
# wait for xvfb to startup (3s is the same amount xvfb-run waits by default)
sleep 3
openbox &
echo "OPENBOXPID=$!" >> $GITHUB_ENV
# linux opengl tests
- name: Run Test Suite (opengl)
run: |
chmod a+x love-${{ github.sha }}.AppImage
./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --runAllTests --isRunner
- name: Love Test Report (opengl)
uses: ellraiser/love-test-report@main
with:
name: Love Testsuite Linux
title: test-report-linux-opengl
path: love2d-${{ github.sha }}/testing/output/lovetest_runAllTests.md
- name: Zip Test Output (opengl)
run: |
7z a -tzip test-output-linux-opengl.zip love2d-${{ github.sha }}/testing/output/
- name: Artifact Test Output (opengl)
uses: actions/upload-artifact@v3
with:
name: test-output-linux-opengl
path: test-output-linux-opengl.zip
# linux opengles tests
- name: Run Test Suite (opengles)
run: |
export LOVE_GRAPHICS_USE_OPENGLES=1
./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --runAllTests --isRunner
- name: Love Test Report (opengles)
uses: ellraiser/love-test-report@main
with:
name: Love Testsuite Linux
title: test-report-linux-opengles
path: love2d-${{ github.sha }}/testing/output/lovetest_runAllTests.md
- name: Zip Test Output (opengles)
run: |
7z a -tzip test-output-linux-opengles.zip love2d-${{ github.sha }}/testing/output/
- name: Artifact Test Output (opengles)
uses: actions/upload-artifact@v3
with:
name: test-output-linux-opengles
path: test-output-linux-opengles.zip
# # linux vulkan tests
# - name: Run Test Suite (vulkan)
# run: |
# export LOVE_GRAPHICS_DEBUG=1
# ./love-${{ github.sha }}.AppImage love2d-${{ github.sha }}/testing/main.lua --runAllTests --isRunner --renderers vulkan
# - name: Love Test Report (vulkan)
# uses: ellraiser/love-test-report@main
# with:
# name: Love Testsuite Linux
# title: test-report-linux-vulkan
# path: love2d-${{ github.sha }}/testing/output/lovetest_runAllTests.md
# - name: Zip Test Output (vulkan)
# run: |
# 7z a -tzip test-output-linux-vulkan.zip love2d-${{ github.sha }}/testing/output/
# - name: Artifact Test Output (vulkan)
# uses: actions/upload-artifact@v3
# with:
# name: test-output-linux-vulkan
# path: test-output-linux-vulkan.zip
- name: Stop xvfb and openbox
# should always stop xvfb and openbox even if other steps failed
if: always()
run: |
kill $XVFBPID
kill $OPENBOXPID
- name: Artifact
uses: actions/upload-artifact@v3
with:
name: love-linux-x86_64.AppImage
path: love-${{ github.sha }}.AppImage
- name: Artifact Debug Symbols
uses: actions/upload-artifact@v3
with:
name: love-x86_64-AppImage-debug
path: love-${{ github.sha }}.AppImage-debug.tar.gz
windows-os:
runs-on: windows-latest
permissions:
checks: write
pull-requests: write
env:
ALSOFT_CONF: megasource/libs/love/testing/resources/alsoft.conf
VK_ICD_FILENAMES: ${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json
VULKAN_SDK: C:/VulkanSDK/1.3.231.1
strategy:
matrix:
platform: [Win32, x64, ARM64]
install: [compat, modern]
exclude:
- platform: ARM64
install: compat
defaults:
run:
shell: cmd
continue-on-error: ${{ matrix.platform == 'ARM64' }}
steps:
- name: Define Variables
id: vars
run: |
rem Compat/Modern switch
if "${{ matrix.install }}" == "compat" (
echo moredef=-DLOVE_INSTALL_UCRT=ON>> "%GITHUB_OUTPUT%"
echo compatname=-compat>> "%GITHUB_OUTPUT%"
) else (
echo moredef=>> "%GITHUB_OUTPUT%"
echo compatname=>> "%GITHUB_OUTPUT%"
)
rem JIT Modules
if "${{ matrix.platform }}-${{ matrix.install }}" == "x64-modern" (
(echo jitmodules=1)>> "%GITHUB_OUTPUT%"
) else (
(echo jitmodules=0)>> "%GITHUB_OUTPUT%"
)
rem Architecture-Specific Switch
goto ${{ matrix.platform }}
exit /b 1
:Win32
(echo arch=x86)>> "%GITHUB_OUTPUT%"
(echo angle=0)>> "%GITHUB_OUTPUT%"
echo nofiles=warn>> "%GITHUB_OUTPUT%"
exit /b 0
:x64
(echo arch=x64)>> "%GITHUB_OUTPUT%"
(echo angle=0)>> "%GITHUB_OUTPUT%"
echo nofiles=warn>> "%GITHUB_OUTPUT%"
exit /b 0
:ARM64
(echo arch=arm64)>> "%GITHUB_OUTPUT%"
(echo angle=1)>> "%GITHUB_OUTPUT%"
echo nofiles=ignore>> "%GITHUB_OUTPUT%"
echo moredef=-DLOVE_EXTRA_DLLS=%CD%\angle\libEGL.dll;%CD%\angle\libGLESv2.dll>> "%GITHUB_OUTPUT%"
exit /b 0
- name: Download Windows SDK Setup 10.0.20348
run: curl -Lo winsdksetup.exe https://go.microsoft.com/fwlink/?linkid=2164145
- name: Install Debugging Tools for Windows
id: windbg
run: |
setlocal enabledelayedexpansion
start /WAIT %CD%\winsdksetup.exe /features OptionId.WindowsDesktopDebuggers /q /log %CD%\log.txt
echo ERRORLEVEL=!ERRORLEVEL! >> %GITHUB_OUTPUT%
- name: Print Debugging Tools Install Log
if: always()
run: |
type log.txt
exit /b ${{ steps.windbg.outputs.ERRORLEVEL }}
- name: Setup Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Download source_index.py
run: curl -Lo source_index.py https://gist.github.com/MikuAuahDark/d9c099f5714e09a765496471c2827a55/raw/df34956052035f3473c5f01861dfb53930d06843/source_index.py
- name: Clone Megasource
uses: actions/checkout@v3
with:
path: megasource
repository: love2d/megasource
ref: 12.x
- id: megasource
name: Get Megasource Commit SHA
shell: python
run: |
import os
import subprocess
result = subprocess.run("git -C megasource rev-parse HEAD".split(), check=True, capture_output=True, encoding="UTF-8")
commit = result.stdout.split()[0]
with open(os.environ["GITHUB_OUTPUT"], "w", encoding="UTF-8") as f: f.write(f"commit={commit}")
- name: Checkout
uses: actions/checkout@v3
with:
path: megasource/libs/love
- name: Download ANGLE
uses: robinraju/release-downloader@v1.7
if: steps.vars.outputs.angle == '1'
with:
repository: MikuAuahDark/angle-winbuild
tag: cr_5249
fileName: angle-win-${{ steps.vars.outputs.arch }}.zip
tarBall: false
zipBall: false
out-file-path: angle
- name: Extract ANGLE
if: steps.vars.outputs.angle == '1'
working-directory: angle
run: 7z x angle-win-${{ steps.vars.outputs.arch }}.zip
- name: Delete Strawbery Perl
# https://github.com/actions/runner-images/issues/6627
# In particular, this is not pretty, but even CMAKE_IGNORE_PREFIX_PATH
# cannot help in this case. Delete the whole folder!
run: |
rmdir /s /q C:\Strawberry
exit /b 0
- name: Configure
env:
CFLAGS: /Zi
CXXFLAGS: /Zi
LDFLAGS: /DEBUG:FULL /OPT:REF /OPT:ICF
run: cmake -Bbuild -Smegasource -T v142 -A ${{ matrix.platform }} --install-prefix %CD%\install -DCMAKE_PDB_OUTPUT_DIRECTORY=%CD%\pdb ${{ steps.vars.outputs.moredef }}
- name: Install
run: cmake --build build --target PACKAGE --config Release -j2
- name: Copy LuaJIT lua51.pdb
run: |
copy /Y build\libs\LuaJIT\src\lua51.pdb pdb\Release\lua51.pdb
exit /b 0
- name: Add srcsrv to PATH
run: |
echo C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\srcsrv>>%GITHUB_PATH%
- name: Embed Source Index into PDBs
run: |
python source_index.py ^
--source %CD%\megasource\libs\love https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }} ^
--source %CD%\megasource https://raw.githubusercontent.com/love2d/megasource/${{ steps.megasource.outputs.commit }} ^
--source %CD%\build\libs\LuaJIT https://raw.githubusercontent.com/love2d/megasource/${{ steps.megasource.outputs.commit }}/libs/LuaJIT ^
pdb\Release\*.pdb
- name: Artifact
uses: actions/upload-artifact@v3
with:
name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}
path: |
build/*.zip
build/*.exe
if-no-files-found: ${{ steps.vars.outputs.nofiles }}
- name: Artifact JIT Modules
if: steps.vars.outputs.jitmodules == '1'
uses: actions/upload-artifact@v3
with:
name: love-windows-jitmodules
path: build/libs/LuaJIT/src/jit/*.lua
- name: Artifact PDB
uses: actions/upload-artifact@v3
with:
name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-dbg
path: pdb/Release/*.pdb
# install mesa for graphic tests
- name: Install Mesa
run: |
curl -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z
7z x mesa.7z -o*
powershell.exe mesa\systemwidedeploy.cmd 1
# build love to use for the tests
- name: Build Test Exe
if: steps.vars.outputs.arch != 'ARM64'
run: cmake --build build --config Release --target install
# windows opengl tests
- name: Run Tests (opengl)
if: steps.vars.outputs.arch != 'ARM64'
run: |
echo 'check dir'
ls
powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --runAllTests --isRunner
- name: Love Test Report (opengl)
if: steps.vars.outputs.arch != 'ARM64'
uses: ellraiser/love-test-report@main
with:
name: Love Testsuite Windows ${{ steps.vars.outputs.arch }} ${{ steps.vars.outputs.compatname }} (opengl)
title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengl
path: megasource/libs/love/testing/output/lovetest_runAllTests.md
- name: Zip Test Output (opengl)
if: steps.vars.outputs.arch != 'ARM64'
run: |
7z a -tzip test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengl.zip megasource/libs/love/testing/output/
- name: Artifact Test Output (opengl)
if: steps.vars.outputs.arch != 'ARM64'
uses: actions/upload-artifact@v3
with:
name: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengl
path: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengl.zip
# windows opengles tests
- name: Run Tests (opengles)
if: steps.vars.outputs.arch != 'ARM64'
run: |
$ENV:LOVE_GRAPHICS_USE_OPENGLES=1
powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --runAllTests --isRunner
- name: Love Test Report (opengles)
if: steps.vars.outputs.arch != 'ARM64'
uses: ellraiser/love-test-report@main
with:
name: Love Testsuite Windows ${{ steps.vars.outputs.arch }} ${{ steps.vars.outputs.compatname }} (opengles)
title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles
path: megasource/libs/love/testing/output/lovetest_runAllTests.md
- name: Zip Test Output (opengles)
if: steps.vars.outputs.arch != 'ARM64'
run: |
7z a -tzip test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles.zip megasource/libs/love/testing/output/
- name: Artifact Test Output (opengles)
if: steps.vars.outputs.arch != 'ARM64'
uses: actions/upload-artifact@v3
with:
name: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles
path: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-opengles.zip
# # install vulkan
# - name: Install Vulkan
# if: steps.vars.outputs.arch != 'ARM64'
# run: |
# curl -L --show-error --output VulkanSDK.exe https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/VulkanSDK-1.3.231.1-Installer.exe
# ./VulkanSDK.exe --root C:/VulkanSDK/1.3.231.1 --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.core com.lunarg.vulkan.vma
# curl -L --show-error --output vulkan-runtime.zip https://sdk.lunarg.com/sdk/download/1.3.231.1/windows/vulkan-runtime-components.zip
# 7z e vulkan-runtime.zip -o"C:/VulkanSDK/1.3.231.1/runtime/x64" */x64
# copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "mesa/x64"
# copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "C:/Windows/System32"
# copy "C:/VulkanSDK/1.3.231.1/runtime/x64/vulkan-1.dll" "love-12.0-win64/love-12.0-win64"
# reg add HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers /v "${{ github.workspace }}\mesa\x64\lvp_icd.x86_64.json" /t REG_DWORD /d 0
# powershell.exe C:/VulkanSDK/1.3.231.1/runtime/x64/vulkaninfo.exe --summary
# # windows vulkan tests
# - name: Run Tests (vulkan)
# if: steps.vars.outputs.arch != 'ARM64'
# run: |
# $ENV:LOVE_GRAPHICS_DEBUG=1
# powershell.exe ./install/lovec.exe ./megasource/libs/love/testing/main.lua --runAllTests --isRunner --renderers vulkan
# - name: Love Test Report (vulkan)
# if: steps.vars.outputs.arch != 'ARM64'
# uses: ellraiser/love-test-report@main
# with:
# name: Love Testsuite Windows ${{ steps.vars.outputs.arch }} ${{ steps.vars.outputs.compatname }} (vulkan)
# title: test-report-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan
# path: megasource/libs/love/testing/output/lovetest_runAllTests.md
# - name: Zip Test Output (vulkan)
# if: steps.vars.outputs.arch != 'ARM64'
# run: |
# 7z a -tzip test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan.zip megasource/libs/love/testing/output/
# - name: Artifact Test Output (vulkan)
# if: steps.vars.outputs.arch != 'ARM64'
# uses: actions/upload-artifact@v3
# with:
# name: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan
# path: test-output-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}-vulkan.zip
macOS:
runs-on: macos-latest
permissions:
checks: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Clone Dependencies
uses: actions/checkout@v3
with:
path: apple-dependencies
repository: love2d/love-apple-dependencies
ref: 12.x
- name: Move Dependencies
run:
mv apple-dependencies/macOS/Frameworks platform/xcode/macosx
- name: Build
run:
xcodebuild clean archive -project platform/xcode/love.xcodeproj -scheme love-macosx -configuration Release -archivePath love-macos.xcarchive
- name: Export Archive
run:
xcodebuild -exportArchive -archivePath love-macos.xcarchive -exportPath love-macos -exportOptionsPlist platform/xcode/macosx/macos-copy-app.plist
- name: Zip Archive
run:
ditto -c -k --sequesterRsrc --keepParent love-macos/love.app love-macos.zip
- name: Artifact
uses: actions/upload-artifact@v3
with:
name: love-macos
path: love-macos.zip
# macos opengl tests (metal not supported on runners)
- name: Run Test Suite
run: |
ls
love-macos/love.app/Contents/MacOS/love ./testing/main.lua --runAllTests --isRunner
- name: Love Test Report
uses: ellraiser/love-test-report@main
with:
name: Love Testsuite MacOS
title: test-report-macos
path: testing/output/lovetest_runAllTests.md
- name: Zip Test Output
run: |
7z a -tzip test-output-macos-opengl.zip ./testing/output/
- name: Artifact Test Output
uses: actions/upload-artifact@v3
with:
name: test-output-macos-opengl
path: test-output-macos-opengl.zip
iOS-Simulator:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Clone Dependencies
uses: actions/checkout@v3
with:
path: apple-dependencies
repository: love2d/love-apple-dependencies
ref: 12.x
- name: Move Dependencies
run: |
mv apple-dependencies/iOS/libraries platform/xcode/ios
- name: Build
run:
xcodebuild -project platform/xcode/love.xcodeproj -scheme love-ios -configuration Release -destination 'platform=iOS Simulator,name=iPhone 11'