@@ -179,7 +179,7 @@ jobs:
179179 if : ${{ success() && (matrix.coverage == true) }}
180180 uses : codecov/codecov-action@v5
181181 with :
182- file : ./coverage.info
182+ files : ./coverage.info
183183 fail_ci_if_error : true
184184 verbose : true
185185 token : ${{ secrets.CODECOV_TOKEN }}
@@ -234,6 +234,7 @@ jobs:
234234 pushd build
235235
236236 export BUILD_PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-build
237+ echo "BUILD_PREFIX=$BUILD_PREFIX" >> $GITHUB_ENV
237238 export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-host
238239 echo "PREFIX=$PREFIX" >> $GITHUB_ENV
239240 export SYSROOT_PATH=$BUILD_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot
@@ -244,24 +245,86 @@ jobs:
244245 -DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \
245246 -DCMAKE_FIND_ROOT_PATH=$PREFIX \
246247 -DSYSROOT_PATH=$SYSROOT_PATH \
248+ -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
247249 ..
248250 emmake make -j ${{ env.ncpus }} install
249251
250252 - name : Test xeus-cpp C++ Emscripten
251253 shell : bash -l {0}
252254 run : |
255+ export BUILD_PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-build
253256 set -e
254- micromamba create -n xeus-lite-host jupyterlite-core
257+ micromamba create -n xeus-lite-host jupyterlite-core=0.6 jupyterlite-xeus
255258 micromamba activate xeus-lite-host
256259 cd build/test
260+ # Fresh install browsers, and run Emscripten tests in them
261+ # This is to match the Emscripten build instructions, where
262+ # we run in a fresh browser, to stop any extra installed
263+ # stuff interferring with the running of the tests
264+ # Explaination of options for emrun
265+ # --browser (name of browser on path)
266+ # --kill_exit makes it so that when emrun finishes,
267+ # that the headless browser we create is killed along with it
268+ # --timeout 60 is such that emrun is killed after 60 seconds if
269+ # still running. emrun should have finished long before then,
270+ # so if it is still running, something went wrong (such as a test
271+ # which crashed the html file). This will cause the ci to fail,
272+ # as a non 0 value of will be returned.
273+ # In the case of Chrome we have the extra --no-sandbox flag, as on
274+ # Ubuntu Chrome will refuse to run otherwise, as it expects to have
275+ # been installed with admin privileges. This flag allows it to run
276+ # in userspace.
277+ os="${{ matrix.os }}"
278+ if [[ "${os}" == "macos"* ]]; then
279+ # Install Firefox
280+ wget "https://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US" -O Firefox-latest.dmg
281+ hdiutil attach Firefox-latest.dmg
282+ cp -r /Volumes/Firefox/Firefox.app $PWD
283+ hdiutil detach /Volumes/Firefox
284+ cd ./Firefox.app/Contents/MacOS/
285+ export PATH="$PWD:$PATH"
286+ cd -
287+
288+ # Install Google Chrome
289+ 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
290+ pkgutil --expand-full googlechrome.pkg google-chrome
291+ cd ./google-chrome/GoogleChrome.pkg/Payload/Google\ Chrome.app/Contents/MacOS/
292+ export PATH="$PWD:$PATH"
293+ cd -
294+
295+ # Run tests in browsers
296+ echo "Running test_xeus_cpp in Firefox"
297+ python ${{ env.BUILD_PREFIX }}/bin/emrun.py --browser="firefox" --kill_exit --timeout 60 --browser-args="--headless" test_xeus_cpp.html
298+ echo "Running test_xeus_cpp in Google Chrome"
299+ python ${{ env.BUILD_PREFIX }}/bin/emrun.py --browser="Google Chrome" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" test_xeus_cpp.html
300+ else
301+ # Install Google Chrome
302+ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
303+ dpkg-deb -x google-chrome-stable_current_amd64.deb $PWD/chrome
304+ cd ./chrome/opt/google/chrome/
305+ export PATH="$PWD:$PATH"
306+ cd -
307+
308+ # Install Firefox
309+ wget https://ftp.mozilla.org/pub/firefox/releases/138.0.1/linux-x86_64/en-GB/firefox-138.0.1.tar.xz
310+ tar -xJf firefox-138.0.1.tar.xz
311+ cd ./firefox
312+ export PATH="$PWD:$PATH"
313+ cd -
314+
315+ # Run tests in browsers
316+ echo "Running test_xeus_cpp in Firefox"
317+ python ${{ env.BUILD_PREFIX }}/bin/emrun.py --browser="firefox" --kill_exit --timeout 60 --browser-args="--headless" test_xeus_cpp.html
318+ echo "Running test_xeus_cpp in Google Chrome"
319+ python ${{ env.BUILD_PREFIX }}/bin/emrun.py --browser="google-chrome" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" test_xeus_cpp.html
320+ fi
257321 node test_xeus_cpp.js
258322 timeout-minutes : 4
259323
260324 - name : Jupyter Lite integration
261325 shell : bash -l {0}
262326 run : |
263327 micromamba activate xeus-lite-host
264- python -m pip install jupyterlite-xeus
265328 jupyter lite build --XeusAddon.prefix=${{ env.PREFIX }}
266329
267330 - name : Setup tmate session
0 commit comments