-
Notifications
You must be signed in to change notification settings - Fork 54
512 lines (485 loc) · 22.7 KB
/
emscripten.yml
File metadata and controls
512 lines (485 loc) · 22.7 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
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
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
name: Emscripten
on:
pull_request:
branches: [main]
push:
branches: [main]
release:
types: [published]
schedule:
- cron: '30 20 * * *' # Warning: Timezone dep - 20:00 is 1:00
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: ubu24-arm-clang-repl-20-emscripten
os: ubuntu-24.04-arm
clang-runtime: '20'
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "4.0.9"
build_static_library: On
micromamba_shell_init: bash
- name: osx26-arm-clang-repl-20-emscripten
os: macos-26
clang-runtime: '20'
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "4.0.9"
build_static_library: On
micromamba_shell_init: bash
- name: ubu24-x86-clang-repl-20-emscripten
os: ubuntu-24.04
clang-runtime: '20'
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "4.0.9"
build_static_library: On
micromamba_shell_init: bash
- name: win2025-x86-clang-repl-20-emscripten
os: windows-2025
clang-runtime: '20'
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "4.0.9"
build_static_library: On
micromamba_shell_init: powershell
- name: ubu24-arm-clang-repl-21-emscripten
os: ubuntu-24.04-arm
clang-runtime: '21'
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "4.0.9"
build_static_library: On
micromamba_shell_init: bash
- name: osx26-arm-clang-repl-21-emscripten
os: macos-26
clang-runtime: '21'
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "4.0.9"
build_static_library: On
micromamba_shell_init: bash
- name: ubu24-x86-clang-repl-21-emscripten
os: ubuntu-24.04
clang-runtime: '21'
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "4.0.9"
build_static_library: On
micromamba_shell_init: bash
- name: win2025-x86-clang-repl-21-emscripten
os: windows-2025
clang-runtime: '21'
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "4.0.9"
build_static_library: On
micromamba_shell_init: powershell
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Save PR Info
uses: ./.github/actions/Miscellaneous/Save_PR_Info
- name: Restore cached LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build (Unix like systems emscripten)
uses: actions/cache/restore@v4
id: cache
with:
path: |
llvm-project
${{ matrix.cling=='On' && 'cling' || '' }}
key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-clang-${{ matrix.clang-runtime }}.x-emscripten
- name: Setup emsdk
run: |
git clone --depth=1 https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install ${{ matrix.emsdk_ver }}
- name: Setup default Build Type
uses: ./.github/actions/Miscellaneous/Select_Default_Build_Type
- name: Install deps on Windows
if: ${{ runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true' }}
run: |
choco install findutils ninja
$env:PATH="C:\Program Files (x86)\GnuWin32\bin;$env:PATH"
$env:PATH="C:\Program Files (x86)\Ninja\bin;$env:PATH"
- name: Install deps on MacOS
if: ${{ runner.os == 'macOS' && steps.cache.outputs.cache-hit != 'true' }}
run: |
brew update
export ARCHITECHURE=$(uname -m)
if [[ "$ARCHITECHURE" != "x86_64" ]]; then
brew remove unxip
fi
# workaround for https://github.com/actions/setup-python/issues/577
for pkg in $(brew list | grep '^python@'); do
brew unlink "$pkg"
brew link --overwrite "$pkg"
done
brew install ninja
- name: Install deps on Linux
if: ${{ runner.os == 'Linux' && steps.cache.outputs.cache-hit != 'true' }}
run: |
# Install deps
sudo apt-get update
sudo apt-get install ninja-build
sudo apt-get autoremove
sudo apt-get clean
- name: Build LLVM/Cling on Unix systems if the cache is invalid (emscripten)
if: ${{ runner.os != 'windows' && steps.cache.outputs.cache-hit != 'true' }}
run: |
./emsdk/emsdk activate ${{matrix.emsdk_ver}}
source ./emsdk/emsdk_env.sh
cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]')
if [[ "${cling_on}" == "ON" ]]; then
git clone https://github.com/root-project/cling.git
cd ./cling
git checkout tags/v${{ matrix.cling-version }}
git apply -v ../patches/llvm/cling1.2-LookupHelper.patch
cd ..
git clone --depth=1 -b cling-llvm${{ matrix.clang-runtime }} https://github.com/root-project/llvm-project.git
else # repl
git clone --depth=1 -b release/${{ matrix.clang-runtime }}.x https://github.com/llvm/llvm-project.git
fi
cd llvm-project
# Build
mkdir native_build
cd native_build
cmake -DLLVM_ENABLE_PROJECTS=clang -DLLVM_TARGETS_TO_BUILD=host -DCMAKE_BUILD_TYPE=Release ../llvm/
cmake --build . --target llvm-tblgen clang-tblgen --parallel $(nproc --all)
export NATIVE_DIR=$PWD/bin/
cd ..
mkdir build
if [[ "${cling_on}" == "ON" ]]; then
cd build
emcmake cmake -DLLVM_EXTERNAL_PROJECTS=cling \
-DLLVM_EXTERNAL_CLING_SOURCE_DIR=../../cling \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_HOST_TRIPLE=wasm32-unknown-emscripten \
-DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" \
-DLLVM_ENABLE_LIBEDIT=OFF \
-DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects }}" \
-DLLVM_ENABLE_ZSTD=OFF \
-DLLVM_ENABLE_LIBXML2=OFF \
-DCLANG_ENABLE_STATIC_ANALYZER=OFF \
-DCLANG_ENABLE_ARCMT=OFF \
-DCLANG_ENABLE_BOOTSTRAP=OFF \
-DCMAKE_CXX_FLAGS="-Dwait4=__syscall_wait4" \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_ENABLE_THREADS=OFF \
-G Ninja \
-DLLVM_BUILD_TOOLS=OFF \
-DLLVM_ENABLE_LIBPFM=OFF \
-DCLANG_BUILD_TOOLS=OFF \
-DLLVM_NATIVE_TOOL_DIR=$NATIVE_DIR \
-DCMAKE_C_FLAGS_RELEASE="-Oz -g0 -DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELEASE="-Oz -g0 -DNDEBUG" \
-DLLVM_ENABLE_LTO=Full \
../llvm
EMCC_CFLAGS="-fwasm-exceptions" emmake ninja clang cling lld gtest_main
else
# Apply patches
llvm_vers=$(echo "${{ matrix.clang-runtime }}" | tr '[:lower:]' '[:upper:]')
if [[ "${llvm_vers}" == "19" || "${llvm_vers}" == "20" || "${llvm_vers}" == "21" ]]; then
git apply -v ../patches/llvm/emscripten-clang${{ matrix.clang-runtime }}-*.patch
echo "Apply emscripten-clang${{ matrix.clang-runtime }}-*.patch patches:"
fi
cd build
emcmake cmake -DCMAKE_BUILD_TYPE=Release \
-DLLVM_HOST_TRIPLE=wasm32-unknown-emscripten \
-DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" \
-DLLVM_ENABLE_LIBEDIT=OFF \
-DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects }}" \
-DLLVM_ENABLE_ZSTD=OFF \
-DLLVM_ENABLE_LIBXML2=OFF \
-DCLANG_ENABLE_STATIC_ANALYZER=OFF \
-DCLANG_ENABLE_ARCMT=OFF \
-DCLANG_ENABLE_BOOTSTRAP=OFF \
-DCMAKE_CXX_FLAGS="-Dwait4=__syscall_wait4" \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_ENABLE_THREADS=OFF \
-DLLVM_BUILD_TOOLS=OFF \
-DLLVM_ENABLE_LIBPFM=OFF \
-DCLANG_BUILD_TOOLS=OFF \
-G Ninja \
-DLLVM_NATIVE_TOOL_DIR=$NATIVE_DIR \
-DCMAKE_C_FLAGS_RELEASE="-Oz -g0 -DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELEASE="-Oz -g0 -DNDEBUG" \
-DLLVM_ENABLE_LTO=Full \
../llvm
EMCC_CFLAGS="-fwasm-exceptions" emmake ninja libclang clangInterpreter clangStaticAnalyzerCore
fi
cd ../
rm -rf $(find . -maxdepth 1 ! -name "build" ! -name "llvm" ! -name "clang" ! -name ".")
if [[ "${cling_on}" == "ON" ]]; then
cd ./llvm/
rm -rf $(find . -maxdepth 1 ! -name "include" ! -name "lib" ! -name "cmake" ! -name "utils" ! -name ".")
cd ../clang/
rm -rf $(find . -maxdepth 1 ! -name "include" ! -name "lib" ! -name "cmake" ! -name "utils" ! -name ".")
cd ../..
else # repl
cd ./llvm/
rm -rf $(find . -maxdepth 1 ! -name "include" ! -name "lib" ! -name "cmake" ! -name ".")
cd ../clang/
rm -rf $(find . -maxdepth 1 ! -name "include" ! -name "lib" ! -name "cmake" ! -name ".")
cd ../..
fi
- name: Build LLVM/Cling on Windows systems if the cache is invalid (emscripten)
if: ${{ runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true' }}
run: |
.\emsdk\emsdk activate ${{matrix.emsdk_ver}}
.\emsdk\emsdk_env.ps1
if ( "${{ matrix.cling }}" -imatch "On" )
{
git clone https://github.com/root-project/cling.git
cd ./cling
git checkout tags/v${{ matrix.cling-version }}
git apply -v ../patches/llvm/cling1.2-LookupHelper.patch
cd ..
git clone --depth=1 -b cling-llvm${{ matrix.clang-runtime }} https://github.com/root-project/llvm-project.git
$env:PWD_DIR= $PWD.Path
$env:CLING_DIR="$env:PWD_DIR\cling"
echo "CLING_DIR=$env:CLING_DIR"
}
else
{
git clone --depth=1 -b release/${{ matrix.clang-runtime }}.x https://github.com/llvm/llvm-project.git
}
cd llvm-project
# Build
mkdir native_build
cd native_build
cmake -DLLVM_ENABLE_PROJECTS=clang -DLLVM_TARGETS_TO_BUILD=host -DCMAKE_BUILD_TYPE=Release -G Ninja ../llvm/
cmake --build . --target llvm-tblgen clang-tblgen --parallel $(nproc --all)
$env:PWD_DIR= $PWD.Path
$env:NATIVE_DIR="$env:PWD_DIR/bin/"
cd ..
mkdir build
if ( "${{ matrix.cling }}" -imatch "On" )
{
cd build
emcmake cmake -DLLVM_EXTERNAL_PROJECTS=cling `
-DLLVM_EXTERNAL_CLING_SOURCE_DIR=../../cling `
-DCMAKE_BUILD_TYPE=Release `
-DLLVM_HOST_TRIPLE=wasm32-unknown-emscripten `
-DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" `
-DLLVM_ENABLE_LIBEDIT=OFF `
-DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects }}" `
-DLLVM_ENABLE_ZSTD=OFF `
-DLLVM_ENABLE_LIBXML2=OFF `
-DCLANG_ENABLE_STATIC_ANALYZER=OFF `
-DCLANG_ENABLE_ARCMT=OFF `
-DCLANG_ENABLE_BOOTSTRAP=OFF `
-DCMAKE_CXX_FLAGS="-Dwait4=__syscall_wait4" `
-DLLVM_INCLUDE_BENCHMARKS=OFF `
-DLLVM_INCLUDE_EXAMPLES=OFF `
-DLLVM_INCLUDE_TESTS=OFF `
-DLLVM_ENABLE_THREADS=OFF `
-G Ninja `
-DLLVM_BUILD_TOOLS=OFF `
-DLLVM_ENABLE_LIBPFM=OFF `
-DCLANG_BUILD_TOOLS=OFF `
-DCMAKE_C_FLAGS_RELEASE="-Oz -g0 -DNDEBUG" `
-DCMAKE_CXX_FLAGS_RELEASE="-Oz -g0 -DNDEBUG" `
-DLLVM_ENABLE_LTO=Full `
-DLLVM_NATIVE_TOOL_DIR="$env:NATIVE_DIR" `
..\llvm
$env:EMCC_CFLAGS="-fwasm-exceptions"
emmake make clang cling lld gtest_main
$env:EMCC_CFLAGS=""
}
else
{
cp -r ..\patches\llvm\emscripten-clang${{ matrix.clang-runtime }}*
#FIXME: Apply patches without hardcoding
if ( "${{ matrix.clang-runtime }}" -imatch "19" )
{
git apply -v emscripten-clang19-2-shift-temporary-files-to-tmp-dir.patch
git apply -v emscripten-clang19-3-remove-zdefs.patch
git apply -v emscripten-clang19-4-enable_exception_handling.patch
}
elseif ( "${{ matrix.clang-runtime }}" -imatch "20" )
{
git apply -v emscripten-clang20-2-shift-temporary-files-to-tmp-dir.patch
git apply -v emscripten-clang20-3-enable_exception_handling.patch
}
elseif ( "${{ matrix.clang-runtime }}" -imatch "21" )
{
git apply -v emscripten-clang21-1-shift-temporary-files-to-tmp-dir.patch
git apply -v emscripten-clang21-2-enable_exception_handling.patch
git apply -v emscripten-clang21-3-webassembly_target_machine_reordering.patch
}
cd build
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
emcmake cmake -DCMAKE_BUILD_TYPE=Release `
-DLLVM_HOST_TRIPLE=wasm32-unknown-emscripten `
-DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build }}" `
-DLLVM_ENABLE_LIBEDIT=OFF `
-DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects }}" `
-DLLVM_ENABLE_ZSTD=OFF `
-DLLVM_ENABLE_LIBXML2=OFF `
-DCLANG_ENABLE_STATIC_ANALYZER=OFF `
-DCLANG_ENABLE_ARCMT=OFF `
-DCLANG_ENABLE_BOOTSTRAP=OFF `
-DCMAKE_CXX_FLAGS="-Dwait4=__syscall_wait4" `
-DLLVM_INCLUDE_BENCHMARKS=OFF `
-DLLVM_INCLUDE_EXAMPLES=OFF `
-DLLVM_INCLUDE_TESTS=OFF `
-DLLVM_ENABLE_THREADS=OFF `
-DLLVM_BUILD_TOOLS=OFF `
-DLLVM_ENABLE_LIBPFM=OFF `
-DCLANG_BUILD_TOOLS=OFF `
-DCMAKE_C_FLAGS_RELEASE="-Oz -g0 -DNDEBUG" `
-DCMAKE_CXX_FLAGS_RELEASE="-Oz -g0 -DNDEBUG" `
-DLLVM_ENABLE_LTO=Full `
-G Ninja `
-DLLVM_NATIVE_TOOL_DIR="$env:NATIVE_DIR" `
..\llvm
$env:EMCC_CFLAGS="-fwasm-exceptions"
emmake ninja libclang clangInterpreter clangStaticAnalyzerCore
$env:EMCC_CFLAGS=""
}
cd ..\
rm -r -force $(find.exe . -maxdepth 1 ! -name "build" ! -name "llvm" ! -name "clang" ! -name ".")
if ( "${{ matrix.cling }}" -imatch "On" )
{
cd .\llvm\
rm -r -force $(find.exe . -maxdepth 1 ! -name "include" ! -name "lib" ! -name "cmake" ! -name "utils" ! -name ".")
cd ..\clang\
rm -r -force $(find.exe . -maxdepth 1 ! -name "include" ! -name "lib" ! -name "cmake" ! -name "utils" ! -name ".")
cd ..\..
}
else
{
cd .\llvm\
rm -r -force $(find.exe . -maxdepth 1 ! -name "include" ! -name "lib" ! -name "cmake" ! -name ".")
cd ..\clang\
rm -r -force $(find.exe . -maxdepth 1 ! -name "include" ! -name "lib" ! -name "cmake" ! -name ".")
cd ..\..
}
- name: Cache LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build
uses: actions/cache/save@v4
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
with:
path: |
llvm-project
${{ matrix.cling=='On' && 'cling' || '' }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- name: install mamba
uses: mamba-org/setup-micromamba@main
with:
init-shell: >-
${{ matrix.micromamba_shell_init }}
- name: micromamba shell hook
if: runner.os == 'Windows'
shell: powershell
run: |
micromamba shell hook -s cmd.exe --root-prefix C:\Users\runneradmin\micromamba-root
- name: Build and test CppInterOp
uses: ./.github/actions/Build_and_Test_CppInterOp
- name: Build xeus-cpp on Unix Systems
if: ${{ runner.os != 'windows' }}
shell: bash -l {0}
run: |
./emsdk/emsdk activate ${{matrix.emsdk_ver}}
source ./emsdk/emsdk_env.sh
micromamba activate CppInterOp-wasm
git clone --depth=1 https://github.com/compiler-research/xeus-cpp.git
cd ./xeus-cpp
mkdir build
pushd build
export CMAKE_PREFIX_PATH=${{ env.PREFIX }}
export CMAKE_SYSTEM_PREFIX_PATH=${{ env.PREFIX }}
emcmake cmake \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DCMAKE_PREFIX_PATH=${{ env.PREFIX }} \
-DCMAKE_INSTALL_PREFIX=${{ env.PREFIX }} \
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
-DXEUS_CPP_RESOURCE_DIR=${{ env.LLVM_BUILD_DIR }}/lib/clang/${{ matrix.clang-runtime }} \
-DSYSROOT_PATH=${{ env.SYSROOT_PATH }} \
..
emmake make -j ${{ env.ncpus }} install
- name: Build xeus-cpp on Windows systems
if: ${{ runner.os == 'windows' }}
shell: powershell
run: |
.\emsdk\emsdk activate ${{matrix.emsdk_ver}}
.\emsdk\emsdk_env.ps1
micromamba activate CppInterOp-wasm
git clone --depth=1 https://github.com/compiler-research/xeus-cpp.git
cd .\xeus-cpp
mkdir build
pushd build
$env:CMAKE_PREFIX_PATH="${{ env.PREFIX }}"
$env:CMAKE_SYSTEM_PREFIX_PATH="${{ env.PREFIX }}"
emcmake cmake `
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} `
-DCMAKE_PREFIX_PATH=${{ env.PREFIX }} `
-DCMAKE_INSTALL_PREFIX=${{ env.PREFIX }} `
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON `
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON `
-DXEUS_CPP_RESOURCE_DIR=${{ env.LLVM_BUILD_DIR }}\lib\clang\${{ matrix.clang-runtime }} `
-DSYSROOT_PATH=${{ env.SYSROOT_PATH }} `
..
emmake make -j ${{ env.ncpus }} install
- name: Test xeus-cpp C++ Emscripten on Unix Systems
if: ${{ runner.os != 'windows' }}
shell: bash -l {0}
run: |
set -e
micromamba activate CppInterOp-wasm
cd ./xeus-cpp/build/test
node test_xeus_cpp.js
- name: Test xeus-cpp C++ Emscripten on Windows Systems
if: ${{ runner.os == 'windows' }}
shell: powershell
run: |
function Error-OnFailure {
param (
[Parameter(Mandatory)]
[ScriptBlock]$Command
)
& $Command
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
}
micromamba activate CppInterOp-wasm
cd .\xeus-cpp\build\test
node test_xeus_cpp.js
echo "Running test_xeus_cpp in Firefox"
Error-OnFailure { emrun.bat --browser="firefox.exe" --kill_exit --timeout 60 --browser-args="--headless" test_xeus_cpp.html }
echo "Running test_xeus_cpp in Chromium"
Error-OnFailure { emrun.bat --browser="chrome.exe" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" test_xeus_cpp.html }
- name: Jupyter Lite integration
if: ${{ runner.os != 'windows' }}
shell: bash -l {0}
run: |
cd ./xeus-cpp/
micromamba create -n xeus-lite-host jupyterlite-core jupyterlite-xeus jupyter_server jupyterlab notebook python-libarchive-c -c conda-forge
micromamba activate xeus-lite-host
jupyter lite build --XeusAddon.prefix=${{ env.PREFIX }} --contents notebooks/xeus-cpp-lite-demo.ipynb --contents notebooks/tinyraytracer.ipynb --contents notebooks/images/marie.png --contents notebooks/audio/audio.wav --output-dir dist
- name: Jupyter Lite integration
if: ${{ runner.os == 'windows' }}
shell: powershell
run: |
cd .\xeus-cpp\
micromamba create -n xeus-lite-host jupyterlite-core jupyterlite-xeus jupyter_server jupyterlab notebook python-libarchive-c -c conda-forge
micromamba activate xeus-lite-host
jupyter lite build --XeusAddon.prefix=${{ env.PREFIX }} --contents notebooks/xeus-cpp-lite-demo.ipynb --contents notebooks/tinyraytracer.ipynb --contents notebooks/images/marie.png --contents notebooks/audio/audio.wav --output-dir dist