-
Notifications
You must be signed in to change notification settings - Fork 0
212 lines (185 loc) · 8.22 KB
/
Copy pathci.yml
File metadata and controls
212 lines (185 loc) · 8.22 KB
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
name: MiniPixels CI
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
permissions:
contents: write
jobs:
linux:
name: Linux tests and examples
runs-on: ubuntu-24.04
steps:
- name: Checkout MiniPixels
uses: actions/checkout@v7
with:
path: MiniPixels
- name: Checkout MiniLangCompilerPy
uses: actions/checkout@v7
with:
repository: MiniLangProject/MiniLangCompilerPy
path: MiniLangCompilerPy
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install native runtime dependencies
run: |
sudo apt-get update && sudo apt-get install -y xvfb libx11-6 libasound2t64
python -m pip install -r MiniPixels/requirements.txt
- name: Run MiniPixels tests
working-directory: MiniPixels
run: python tests/run_tests.py --target linux-x64
- name: Upload Linux test report
if: always()
uses: actions/upload-artifact@v6
with:
name: minipixels-linux-test-report
path: MiniPixels/build/tests/foundation-results-linux.xml
if-no-files-found: ignore
- name: Build examples
working-directory: MiniPixels
run: python tools/build_examples.py --target linux-x64
- name: Smoke X11 presenter
working-directory: MiniPixels
run: |
python ../MiniLangCompilerPy/mlc_win64.py tests/window_renderer_smoke.ml build/tests/window_renderer_smoke -I src -I ../MiniLangCompilerPy --target linux-x64
xvfb-run -a build/tests/window_renderer_smoke
- name: Smoke optional GPU fallback
working-directory: MiniPixels
run: |
python ../MiniLangCompilerPy/mlc_win64.py tests/gpu_scene_smoke.ml build/tests/gpu_scene_smoke -I src -I ../MiniLangCompilerPy --target linux-x64
build/tests/gpu_scene_smoke
- name: Build and smoke native MiniLang CLI
working-directory: MiniPixels
run: |
mkdir -p build/tools
python ../MiniLangCompilerPy/mlc_win64.py tools/minipixels_cli.ml build/tools/minipixels -I src -I ../MiniLangCompilerPy --target linux-x64
build/tools/minipixels info
build/tools/minipixels doctor
build/tools/minipixels validate examples/moving-sprite/minipixels.json
build/tools/minipixels validate examples/scrolling-world/minipixels.json
build/tools/minipixels validate examples/pixel-effects/minipixels.json
build/tools/minipixels validate examples/jump-and-run/minipixels.json
build/tools/minipixels validate examples/tiled-platformer/minipixels.json
build/tools/minipixels generate examples/pixel-effects/minipixels.json build/native-generated/pixel-effects
build/tools/minipixels generate examples/jump-and-run/minipixels.json build/native-generated/jump-and-run/generated
- name: Smoke native MiniLang CLI templates
working-directory: MiniPixels
run: |
tmp=$(mktemp -d)
cp build/tools/minipixels "$tmp/minipixels"
cd "$tmp"
for tpl in basic platformer pixel-art; do
name="demo-$tpl"
./minipixels new "$name" "$tpl"
./minipixels validate "$name/minipixels.json"
./minipixels generate "$name/minipixels.json"
python "$GITHUB_WORKSPACE/MiniLangCompilerPy/mlc_win64.py" "$tmp/$name/src/main.ml" "$tmp/$name/$name" -I "$GITHUB_WORKSPACE/MiniPixels/src" -I "$GITHUB_WORKSPACE/MiniLangCompilerPy" --target linux-x64
done
windows:
name: Windows tests and examples
runs-on: windows-latest
steps:
- name: Checkout MiniPixels
uses: actions/checkout@v7
with:
path: MiniPixels
- name: Checkout MiniLangCompilerPy
uses: actions/checkout@v7
with:
repository: MiniLangProject/MiniLangCompilerPy
path: MiniLangCompilerPy
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Run MiniPixels tests
working-directory: MiniPixels
run: |
python -m pip install -r requirements.txt
python tests\run_tests.py
- name: Upload test report
if: always()
uses: actions/upload-artifact@v6
with:
name: minipixels-test-report
path: MiniPixels/build/tests/foundation-results.xml
if-no-files-found: ignore
- name: Build examples
working-directory: MiniPixels
run: python tools\build_examples.py
- name: Build optional GPU scene runtime
shell: pwsh
working-directory: MiniPixels
run: |
.\native\build-gpu.ps1 -OutputDirectory build\tests
python ..\MiniLangCompilerPy\mlc_win64.py tests\gpu_scene_smoke.ml build\tests\gpu_scene_smoke.exe -I src -I ..\MiniLangCompilerPy
- name: Build native MiniLang CLI
shell: pwsh
working-directory: MiniPixels
run: |
New-Item -ItemType Directory -Force build\tools | Out-Null
python ..\MiniLangCompilerPy\mlc_win64.py tools\minipixels_cli.ml build\tools\minipixels.exe -I src -I ..\MiniLangCompilerPy
.\build\tools\minipixels.exe info
.\build\tools\minipixels.exe doctor
.\build\tools\minipixels.exe validate examples\moving-sprite\minipixels.json
.\build\tools\minipixels.exe validate examples\scrolling-world\minipixels.json
.\build\tools\minipixels.exe validate examples\pixel-effects\minipixels.json
.\build\tools\minipixels.exe validate examples\jump-and-run\minipixels.json
.\build\tools\minipixels.exe validate examples\tiled-platformer\minipixels.json
.\build\tools\minipixels.exe generate examples\pixel-effects\minipixels.json build\native-generated\pixel-effects
.\build\tools\minipixels.exe generate examples\jump-and-run\minipixels.json build\native-generated\jump-and-run\generated
- name: Smoke native MiniLang CLI templates
shell: pwsh
working-directory: MiniPixels
run: |
$tmp = Join-Path $env:TEMP "minipixels-native-cli-smoke"
if (Test-Path $tmp) { Remove-Item -LiteralPath $tmp -Recurse -Force }
New-Item -ItemType Directory -Force $tmp | Out-Null
Copy-Item build\tools\minipixels.exe $tmp\minipixels.exe
Push-Location $tmp
try {
foreach ($tpl in @("basic", "platformer", "pixel-art")) {
$name = "demo-$tpl"
.\minipixels.exe new $name $tpl
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
.\minipixels.exe validate "$name\minipixels.json"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
.\minipixels.exe generate "$name\minipixels.json"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Copy-Item "$env:GITHUB_WORKSPACE\MiniPixels\build\tests\minipixels_audio.dll" "$tmp\$name\minipixels_audio.dll"
python "$env:GITHUB_WORKSPACE\MiniLangCompilerPy\mlc_win64.py" "$tmp\$name\src\main.ml" "$tmp\$name\$name.exe" -I "$env:GITHUB_WORKSPACE\MiniPixels\src" -I "$env:GITHUB_WORKSPACE\MiniLangCompilerPy"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
} finally {
Pop-Location
}
- name: Package SDK
working-directory: MiniPixels
run: python tools\package_sdk.py
- name: Upload SDK artifact
uses: actions/upload-artifact@v6
with:
name: minipixels-sdk
path: |
MiniPixels/dist/*-sdk.zip
MiniPixels/dist/*.sha256
compression-level: 0
- name: Publish GitHub release
if: startsWith(github.ref, 'refs/tags/v')
shell: pwsh
working-directory: MiniPixels
env:
GH_TOKEN: ${{ github.token }}
run: |
$tag = "${{ github.ref_name }}"
$assets = @("dist/*-sdk.zip", "dist/*.sha256")
gh release view $tag *> $null
if ($LASTEXITCODE -eq 0) {
gh release upload $tag @assets --clobber
} else {
gh release create $tag @assets --title "MiniPixels $tag" --generate-notes
}