@@ -175,153 +175,3 @@ jobs:
175175 uses : mxschmitt/action-tmate@v3
176176 # When debugging increase to a suitable value!
177177 timeout-minutes : 30
178-
179- emscripten_wasm :
180-
181- runs-on : ${{ matrix.os }}
182-
183- strategy :
184- fail-fast : false
185- matrix :
186- include :
187- - name : ubu24
188- os : ubuntu-24.04
189- - name : osx15-arm
190- os : macos-15
191-
192- steps :
193- - uses : actions/checkout@v5
194- with :
195- fetch-depth : 0
196-
197- - name : install mamba
198- uses : mamba-org/setup-micromamba@main
199- with :
200- environment-file : environment-wasm-build.yml
201- init-shell : bash
202- environment-name : xeus-cpp-wasm-build
203-
204- - name : Setup default Build Type on *nux
205- if : ${{ runner.os != 'windows' }}
206- run : |
207- os="${{ matrix.os }}"
208- if [[ "${os}" == "macos"* ]]; then
209- echo "ncpus=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
210- else
211- echo "ncpus=$(nproc --all)" >> $GITHUB_ENV
212- fi
213-
214- - name : Build and test xeus-cpp in node, then install
215- shell : bash -l {0}
216- run : |
217- micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32
218-
219- mkdir build
220- pushd build
221-
222- export BUILD_PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-build
223- echo "BUILD_PREFIX=$BUILD_PREFIX" >> $GITHUB_ENV
224- export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-host
225- echo "PREFIX=$PREFIX" >> $GITHUB_ENV
226- export SYSROOT_PATH=$BUILD_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot
227-
228- emcmake cmake \
229- -DCMAKE_BUILD_TYPE=Release \
230- -DCMAKE_INSTALL_PREFIX=$PREFIX \
231- -DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \
232- -DCMAKE_FIND_ROOT_PATH=$PREFIX \
233- -DSYSROOT_PATH=$SYSROOT_PATH \
234- -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
235- ..
236-
237- micromamba create -n node-env -c conda-forge nodejs=22
238- export PATH="$MAMBA_ROOT_PREFIX/envs/node-env/bin:$PATH"
239-
240- make check-xeus-cpp
241- emmake make -j ${{ env.ncpus }} install
242-
243- - name : Test Emscripten xeus-cpp in browser
244- shell : bash -l {0}
245- run : |
246- set -e
247- cd build/test
248- # Fresh install browsers, and run Emscripten tests in them
249- # This is to match the Emscripten build instructions, where
250- # we run in a fresh browser, to stop any extra installed
251- # stuff interferring with the running of the tests
252- # Explaination of options for emrun
253- # --browser (name of browser on path)
254- # --kill_exit makes it so that when emrun finishes,
255- # that the headless browser we create is killed along with it
256- # --timeout 60 is such that emrun is killed after 60 seconds if
257- # still running. emrun should have finished long before then,
258- # so if it is still running, something went wrong (such as a test
259- # which crashed the html file). This will cause the ci to fail,
260- # as a non 0 value of will be returned.
261- # In the case of Chrome we have the extra --no-sandbox flag, as on
262- # Ubuntu Chrome will refuse to run otherwise, as it expects to have
263- # been installed with admin privileges. This flag allows it to run
264- # in userspace.
265- os="${{ matrix.os }}"
266- if [[ "${os}" == "macos"* ]]; then
267- # Install Firefox
268- wget "https://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US" -O Firefox-latest.dmg
269- hdiutil attach Firefox-latest.dmg
270- cp -r /Volumes/Firefox/Firefox.app $PWD
271- hdiutil detach /Volumes/Firefox
272- cd ./Firefox.app/Contents/MacOS/
273- export PATH="$PWD:$PATH"
274- cd -
275-
276- # Install Google Chrome
277- wget https://dl.google.com/chrome/mac/stable/accept_tos%3Dhttps%253A%252F%252Fwww.google.com%252Fintl%252Fen_ph%252Fchrome%252Fterms%252F%26_and_accept_tos%3Dhttps%253A%252F%252Fpolicies.google.com%252Fterms/googlechrome.pkg
278- pkgutil --expand-full googlechrome.pkg google-chrome
279- cd ./google-chrome/GoogleChrome.pkg/Payload/Google\ Chrome.app/Contents/MacOS/
280- export PATH="$PWD:$PATH"
281- cd -
282-
283- # Run tests in browsers
284- echo "Running test_xeus_cpp in Firefox"
285- python ${{ env.BUILD_PREFIX }}/bin/emrun.py --browser="firefox" --kill_exit --timeout 60 --browser-args="--headless" test_xeus_cpp.html
286- echo "Running test_xeus_cpp in Google Chrome"
287- python ${{ env.BUILD_PREFIX }}/bin/emrun.py --browser="Google Chrome" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" test_xeus_cpp.html
288- sudo safaridriver --enable
289- python -m pip install selenium
290- echo "Running test_xeus_cpp in Safari"
291- python ${{ env.BUILD_PREFIX }}/bin/emrun.py --no_browser --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" test_xeus_cpp.html &
292- python ../../scripts/browser_tests_safari.py test_xeus_cpp.html
293- else
294- # Install Google Chrome
295- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
296- dpkg-deb -x google-chrome-stable_current_amd64.deb $PWD/chrome
297- cd ./chrome/opt/google/chrome/
298- export PATH="$PWD:$PATH"
299- cd -
300-
301- # Install Firefox
302- wget https://ftp.mozilla.org/pub/firefox/releases/138.0.1/linux-x86_64/en-GB/firefox-138.0.1.tar.xz
303- tar -xJf firefox-138.0.1.tar.xz
304- cd ./firefox
305- export PATH="$PWD:$PATH"
306- cd -
307-
308- # Run tests in browsers
309- echo "Running test_xeus_cpp in Firefox"
310- python ${{ env.BUILD_PREFIX }}/bin/emrun.py --browser="firefox" --kill_exit --timeout 60 --browser-args="--headless" test_xeus_cpp.html
311- echo "Running test_xeus_cpp in Google Chrome"
312- python ${{ env.BUILD_PREFIX }}/bin/emrun.py --browser="google-chrome" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" test_xeus_cpp.html
313- fi
314- timeout-minutes : 4
315-
316- - name : Jupyter Lite integration
317- shell : bash -l {0}
318- run : |
319- micromamba create -n xeus-lite-host jupyterlite-core=0.6 jupyterlite-xeus -c conda-forge
320- micromamba activate xeus-lite-host
321- jupyter lite build --XeusAddon.prefix=${{ env.PREFIX }}
322-
323- - name : Setup tmate session
324- if : ${{ failure() && runner.debug }}
325- uses : mxschmitt/action-tmate@v3
326- # When debugging increase to a suitable value!
327- timeout-minutes : 30
0 commit comments