@@ -195,15 +195,14 @@ jobs:
195195 emscripten_wasm :
196196
197197 runs-on : ${{ matrix.os }}
198+ name : ${{ matrix.os}}-${{ matrix.notebook }}-${{ matrix.kernel }}
198199
199200 strategy :
200201 fail-fast : false
201202 matrix :
202- include :
203- - name : ubu24
204- os : ubuntu-24.04
205- - name : osx15-arm
206- os : macos-15
203+ os : [ubuntu-24.04, macos-15]
204+ notebook : [smallpt.ipynb, xeus-cpp-lite-demo.ipynb]
205+ kernel : [C++17,C++20,C++23]
207206
208207 steps :
209208 - uses : actions/checkout@v5
@@ -329,12 +328,69 @@ jobs:
329328 fi
330329 timeout-minutes : 4
331330
332- - name : Jupyter Lite integration
331+ - name : Jupyter Lite integration test
333332 shell : bash -l {0}
334333 run : |
334+ set -e
335335 micromamba create -n xeus-lite-host jupyterlite-core=0.6 jupyterlite-xeus -c conda-forge
336336 micromamba activate xeus-lite-host
337- jupyter lite build --XeusAddon.prefix=${{ env.PREFIX }}
337+ if [[ "${{ matrix.os }}" == "macos"* ]]; then
338+ brew install coreutils
339+ export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"
340+ fi
341+ export INPUT_TEXT=""
342+ if [[ "${{ matrix.notebook }}" == "xeus-cpp-lite-demo.ipynb"* ]]; then
343+ export INPUT_TEXT="--stdin Test_Name"
344+ fi
345+ timeout 900 jupyter lite serve --settings-overrides=overrides.json --XeusAddon.prefix=${{ env.PREFIX }} \
346+ --XeusAddon.mounts="${{ env.PREFIX }}/share/xeus-cpp/tagfiles:/share/xeus-cpp/tagfiles" \
347+ --XeusAddon.mounts="${{ env.PREFIX }}/etc/xeus-cpp/tags.d:/etc/xeus-cpp/tags.d" \
348+ --contents README.md \
349+ --contents notebooks/xeus-cpp-lite-demo.ipynb \
350+ --contents notebooks/smallpt.ipynb \
351+ --contents notebooks/images/marie.png \
352+ --contents notebooks/audio/audio.wav &
353+ # There is a bug in nbdime after 3.2.0 where it will show the filenames as if there was a diff
354+ # but there is no diff with the options chosen below (the latest doesn't show a diff, just the filenames with +++
355+ # and --- as if it was planning to show a diff. This only happens for xeus-cpp-lite-demo.ipynb.
356+ python -m pip install nbdime==3.2.0
357+ python -m pip install selenium
358+ # This sleep is to force enough time for the jupyter site to build before trying
359+ # to run notebooks in it. If you try to run the notebooks before the website is
360+ # ready the ci python script will crash saying ti cannot access the url
361+ sleep 10
362+ echo "Running xeus-cpp in Jupter Lite in Chrome"
363+ python -u scripts/automated-notebook-run-script.py --driver chrome --notebook ${{ matrix.notebook }} --kernel ${{ matrix.kernel }} $INPUT_TEXT
364+ nbdiff notebooks/${{ matrix.notebook }} $HOME/Downloads/${{ matrix.notebook }} --ignore-id --ignore-metadata >> chrome_diff.txt
365+ export CHROME_TESTS_RETURN_VALUE=$( [ -s chrome_diff.txt ] && echo 1 || echo 0 )
366+ echo "Running xeus-cpp in Jupter Lite in Firefox"
367+ python -u scripts/automated-notebook-run-script.py --driver firefox --notebook ${{ matrix.notebook }} --kernel ${{ matrix.kernel }} $INPUT_TEXT
368+ nbdiff notebooks/${{ matrix.notebook }} $HOME/Downloads/${{ matrix.notebook }} --ignore-id --ignore-metadata >> firefox_diff.txt
369+ export FIREFOX_TESTS_RETURN_VALUE=$( [ -s firefox_diff.txt ] && echo 1 || echo 0 )
370+ rm $HOME/Downloads/${{ matrix.notebook }}
371+ export SAFARI_TESTS_RETURN_VALUE=0
372+ touch safari_diff.txt
373+ if [[ "${{ matrix.os }}" == "macos"* ]]; then
374+ python -m pip install PyAutoGUI
375+ python scripts/enable-downloads-safari-github-ci.py
376+ echo "Running xeus-cpp in Jupter Lite in Safari"
377+ python -u scripts/automated-notebook-run-script.py --driver safari --notebook ${{ matrix.notebook }} --kernel ${{ matrix.kernel }} $INPUT_TEXT
378+ nbdiff notebooks/${{ matrix.notebook }} $HOME/Downloads/${{ matrix.notebook }} --ignore-id --ignore-metadata >> safari_diff.txt
379+ export SAFARI_TESTS_RETURN_VALUE=$( [ -s safari_diff.txt ] && echo 1 || echo 0 )
380+ rm $HOME/Downloads/${{ matrix.notebook }}
381+ fi
382+ if [[ $SAFARI_TESTS_RETURN_VALUE -ne 0 || $FIREFOX_TESTS_RETURN_VALUE -ne 0 || $CHROME_TESTS_RETURN_VALUE -ne 0 ]]; then
383+ if [[ "${{ matrix.os }}" == "macos"* ]]; then
384+ echo "Diff Safari (blank means no diff)"
385+ cat safari_diff.txt
386+ fi
387+ echo "Diff Firefox (blank means no diff)"
388+ cat firefox_diff.txt
389+ echo "Diff Chrome (blank means no diff)"
390+ cat chrome_diff.txt
391+ exit 1
392+ fi
393+ timeout-minutes : 15
338394
339395 - name : Setup tmate session
340396 if : ${{ failure() && runner.debug }}
0 commit comments