-
Notifications
You must be signed in to change notification settings - Fork 1
340 lines (304 loc) · 15.1 KB
/
Copy pathci.yml
File metadata and controls
340 lines (304 loc) · 15.1 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
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
name: ci
on:
push:
branches:
- main
pull_request:
env:
PROTON_NO_UPDATE_CHECK: 1
PROTON_CEF_CACHE: ${{ github.workspace }}/.proton-global-cache
jobs:
format:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Install MoonBit
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash -s latest
echo "$HOME/.moon/bin" >> "$GITHUB_PATH"
- name: moon version
run: moon version --all
- name: Format check
run: moon fmt --check
moonbit:
needs: format
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
fail-fast: false
runs-on: ${{ matrix.os }}
timeout-minutes: 45
continue-on-error: false
steps:
- uses: actions/checkout@v6
- name: Cache MoonBit packages
uses: actions/cache@v4
with:
path: .mooncakes
key: ${{ runner.os }}-mooncakes-${{ hashFiles('**/moon.mod') }}
restore-keys: ${{ runner.os }}-mooncakes-
- name: Cache CEF downloads
uses: actions/cache@v4
with:
path: .proton-global-cache
key: ${{ runner.os }}-cef-global-${{ hashFiles('cli/cef/cef_platform.mbt') }}
- name: Install MoonBit
if: ${{ matrix.os != 'windows-latest' }}
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash -s latest
echo "$HOME/.moon/bin" >> $GITHUB_PATH
# moonc v0.10.5 bundles mimalloc in libmoonbitrun.o and interposes the
# malloc family in every native executable, but on Linux the interposed
# set misses the glibc extension malloc_usable_size. Libraries dlopen'd
# by such an executable (libcef.so's bundled sqlite in the doctor deep
# probe tests) then pair mimalloc's malloc() with glibc's
# malloc_usable_size() and segfault. libmoonbitrun.o contains only the
# allocator override, so an empty object restores plain glibc malloc.
# Drop this once the toolchain interposition is fixed upstream.
- name: Disable bundled mimalloc (moonc v0.10.5 Linux interposition bug)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
test -f "$HOME/.moon/lib/libmoonbitrun.o"
cc -c -x c /dev/null -o "$HOME/.moon/lib/libmoonbitrun.o"
- name: Install MoonBit on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser; irm https://cli.moonbitlang.com/install/powershell.ps1 | iex
"$env:USERPROFILE\.moon\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
- name: Install Linux native dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libgtk-3-dev libwebkit2gtk-4.1-dev xvfb openbox
- name: moon version
run: |
moon version --all
- name: moon update
run: |
moon update
- name: Setup MSVC
if: ${{ matrix.os == 'windows-latest' }}
uses: ilammy/msvc-dev-cmd@v1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
- name: Test prebuilt ABI verifier
run: node --test scripts/verify_prebuilt_abi_test.mjs
- name: Test bridge bootstrap JS
run: node --test native/tests/bridge_bootstrap.test.mjs
- name: Verify generated files
run: node scripts/verify_generated.mjs --skip-prebuilt-abi
- name: Verify Linux prebuilt ABI
if: ${{ matrix.os == 'ubuntu-latest' }}
run: node scripts/verify_prebuilt_abi.mjs linux-x64
- name: Verify macOS prebuilt ABI
if: ${{ matrix.os == 'macos-latest' }}
run: node scripts/verify_prebuilt_abi.mjs darwin-arm64
- name: Verify Windows prebuilt ABI
if: ${{ matrix.os == 'windows-latest' }}
run: node scripts/verify_prebuilt_abi.mjs win32-x64
- name: Build active Proton engine runtime on Unix
if: ${{ matrix.os != 'windows-latest' }}
run: |
moon -C cli run . -- -C .. cef setup
runtime="$PWD/$(node -p "require('./.proton/runtime.json').dist")"
cef_root=$(node -p "require('./.proton/runtime.json').cef")
cmake -S native -B native/build-engine \
-DCMAKE_INSTALL_PREFIX="$runtime" \
-DPROTON_WITH_ENGINE=ON \
-DPROTON_ENGINE_ROOT="$cef_root"
cmake --build native/build-engine
cmake --install native/build-engine
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
# The overlay titlebar path needs a real window manager for CEF to
# deliver draggable regions; Xvfb alone has none.
xvfb-run -a sh -c 'openbox & sleep 1; ctest --test-dir native/build-engine --output-on-failure'
else
# The raw C smoke is not an app bundle, so the macOS GUI lifecycle
# is covered by the bounded example e2e step below instead.
ctest --test-dir native/build-engine --output-on-failure
fi
node native/scripts/verify_link_config.mjs "$runtime"
echo "PROTON_NATIVE_DIST=$runtime" >> "$GITHUB_ENV"
echo "$runtime/bin" >> "$GITHUB_PATH"
- name: Build active Proton engine runtime on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true
moon -C cli run . -- -C .. cef setup
if (!(Test-Path .proton\runtime.json)) {
throw "missing .proton\runtime.json"
}
$manifest = Get-Content .proton\runtime.json | ConvertFrom-Json
$runtime = Join-Path $PWD $manifest.dist
$cefRoot = $manifest.cef
cmake -S native -B native\build-engine `
"-DCMAKE_INSTALL_PREFIX=$runtime" `
-DPROTON_WITH_ENGINE=ON `
"-DPROTON_ENGINE_ROOT=$cefRoot"
cmake --build native\build-engine --config Debug
cmake --install native\build-engine --config Debug
# windows-latest runners have no usable D3D device; force ANGLE's
# SwiftShader path so the engine's GPU process can start at all.
$env:ANGLE_DEFAULT_PLATFORM = "swiftshader"
"ANGLE_DEFAULT_PLATFORM=swiftshader" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
ctest --test-dir native\build-engine -C Debug --output-on-failure
if (!(Test-Path "$runtime\bin\proton.dll")) {
throw "missing active proton.dll"
}
$runtimePath = (Resolve-Path $runtime).Path
node native\scripts\verify_link_config.mjs $runtimePath
"PROTON_NATIVE_DIST=$runtimePath" | Out-File -FilePath $env:GITHUB_ENV -Append
(Resolve-Path "$runtimePath\bin").Path | Out-File -FilePath $env:GITHUB_PATH -Append
- name: Test native updater in Release mode
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
cmake -S native -B native/build-release-tests \
-DCMAKE_BUILD_TYPE=Release \
-DPROTON_WITH_ENGINE=OFF
cmake --build native/build-release-tests --target proton_update_test
ctest --test-dir native/build-release-tests \
--output-on-failure \
-R '^proton_update_test$'
- name: Check framework modules
if: ${{ matrix.os != 'windows-latest' }}
run: |
moon check --target native --deny-warn
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
xvfb-run -a env \
LD_LIBRARY_PATH="$PROTON_NATIVE_DIST/bin:$PROTON_NATIVE_DIST/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \
LD_PRELOAD="libcef.so${LD_PRELOAD:+:$LD_PRELOAD}" \
moon -C proton test native --target native --diagnostic-limit 80
xvfb-run -a moon -C cli test -p moonbit-community/proton_cli \
moonbit-community/proton_cli/arguments moonbit-community/proton_cli/build_cmd \
moonbit-community/proton_cli/cef moonbit-community/proton_cli/codegen \
moonbit-community/proton_cli/dev moonbit-community/proton_cli/doctor \
moonbit-community/proton_cli/fsutil moonbit-community/proton_cli/new \
moonbit-community/proton_cli/output moonbit-community/proton_cli/package \
--target native --no-parallelize --diagnostic-limit 80
else
moon -C proton test native --target native --diagnostic-limit 80
moon -C cli test -p moonbit-community/proton_cli \
moonbit-community/proton_cli/arguments moonbit-community/proton_cli/build_cmd \
moonbit-community/proton_cli/cef moonbit-community/proton_cli/codegen \
moonbit-community/proton_cli/dev moonbit-community/proton_cli/doctor \
moonbit-community/proton_cli/fsutil moonbit-community/proton_cli/new \
moonbit-community/proton_cli/output moonbit-community/proton_cli/package \
--target native --no-parallelize --diagnostic-limit 80
fi
moon -C e2e build --target native --diagnostic-limit 80
- name: Check framework modules on Windows
if: ${{ matrix.os == 'windows-latest' }}
env:
_CL_: /utf-8
run: |
$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true
moon check --target native --deny-warn
moon -C proton test native --target native --diagnostic-limit 80
moon -C cli test -p moonbit-community/proton_cli moonbit-community/proton_cli/arguments moonbit-community/proton_cli/build_cmd moonbit-community/proton_cli/cef moonbit-community/proton_cli/codegen moonbit-community/proton_cli/dev moonbit-community/proton_cli/doctor moonbit-community/proton_cli/fsutil moonbit-community/proton_cli/new moonbit-community/proton_cli/output moonbit-community/proton_cli/package --target native --no-parallelize --diagnostic-limit 80
moon -C e2e build --target native --diagnostic-limit 80
- name: Test extensions on Unix
if: ${{ matrix.os != 'windows-latest' }}
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
xvfb-run -a moon -C extensions test -p moonbit-community/proton_ext \
moonbit-community/proton_ext/auto_launch moonbit-community/proton_ext/clipboard \
moonbit-community/proton_ext/dialog moonbit-community/proton_ext/fs \
moonbit-community/proton_ext/global_hotkey moonbit-community/proton_ext/keepawake \
moonbit-community/proton_ext/metadata_check moonbit-community/proton_ext/microphone \
moonbit-community/proton_ext/notification moonbit-community/proton_ext/path \
moonbit-community/proton_ext/shell moonbit-community/proton_ext/tray \
--target native
xvfb-run -a moon test -p moonbit-community/proton_auto_launch moonbit-community/proton_clipboard \
moonbit-community/proton_global_hotkey moonbit-community/proton_keepawake moonbit-community/proton_microphone \
moonbit-community/proton_tray --target native
else
moon -C extensions test -p moonbit-community/proton_ext \
moonbit-community/proton_ext/auto_launch moonbit-community/proton_ext/clipboard \
moonbit-community/proton_ext/dialog moonbit-community/proton_ext/fs \
moonbit-community/proton_ext/global_hotkey moonbit-community/proton_ext/keepawake \
moonbit-community/proton_ext/metadata_check moonbit-community/proton_ext/microphone \
moonbit-community/proton_ext/notification moonbit-community/proton_ext/path \
moonbit-community/proton_ext/shell moonbit-community/proton_ext/tray \
--target native
moon test -p moonbit-community/proton_auto_launch moonbit-community/proton_clipboard \
moonbit-community/proton_global_hotkey moonbit-community/proton_keepawake moonbit-community/proton_microphone \
moonbit-community/proton_tray --target native
fi
- name: Test extensions on Windows
if: ${{ matrix.os == 'windows-latest' }}
env:
_CL_: /utf-8
PATH: ${{ github.workspace }}\lib;${{ env.PATH }}
run: |
$extensionPackages = @(
"moonbit-community/proton_ext"
"moonbit-community/proton_ext/auto_launch"
"moonbit-community/proton_ext/clipboard"
"moonbit-community/proton_ext/dialog"
"moonbit-community/proton_ext/fs"
"moonbit-community/proton_ext/global_hotkey"
"moonbit-community/proton_ext/keepawake"
"moonbit-community/proton_ext/metadata_check"
"moonbit-community/proton_ext/microphone"
"moonbit-community/proton_ext/notification"
"moonbit-community/proton_ext/path"
"moonbit-community/proton_ext/shell"
"moonbit-community/proton_ext/tray"
)
moon -C extensions test -p $extensionPackages --target native
$sysPackages = @(
"moonbit-community/proton_auto_launch"
"moonbit-community/proton_clipboard"
"moonbit-community/proton_global_hotkey"
"moonbit-community/proton_keepawake"
"moonbit-community/proton_microphone"
"moonbit-community/proton_tray"
)
moon test -p $sysPackages --target native
- name: Build examples
if: ${{ matrix.os != 'windows-latest' }}
run: |
moon -C examples build --target native
- name: Build examples on Windows
if: ${{ matrix.os == 'windows-latest' }}
env:
_CL_: /utf-8
run: |
moon -C examples build --target native
- name: List Windows example binaries
if: ${{ matrix.os == 'windows-latest' }}
run: Get-ChildItem -Path ".\examples\target" -Recurse -Filter "*.exe" | ForEach-Object { "{0} ({1} bytes)" -f $_.FullName, $_.Length }
- name: Run MoonBit CDP e2e on Windows
if: ${{ matrix.os == 'windows-latest' }}
timeout-minutes: 10
env:
_CL_: /utf-8
PROTON_BRIDGE_E2E_TIMEOUT_MS: 60000
run: |
$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true
moon -C e2e test -p moonbit-community/proton/e2e/test --target native --no-parallelize --diagnostic-limit 200
- name: Run MoonBit CDP e2e on Unix
if: ${{ matrix.os != 'windows-latest' }}
timeout-minutes: 10
env:
PROTON_BRIDGE_E2E_TIMEOUT_MS: 60000
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
xvfb-run -a moon -C e2e test -p moonbit-community/proton/e2e/test \
--target native --no-parallelize --diagnostic-limit 200
else
moon -C e2e test -p moonbit-community/proton/e2e/test \
--target native --no-parallelize --diagnostic-limit 200
fi
- name: List Unix example binaries
if: ${{ matrix.os != 'windows-latest' }}
run: find ./examples/target -type f | xargs ls -lh