Skip to content

Commit 62f4571

Browse files
committed
Add Windows Emscripten build of xeus-cpp to ci
1 parent 55c93cd commit 62f4571

File tree

1 file changed

+57
-3
lines changed

1 file changed

+57
-3
lines changed

.github/workflows/emscripten.yml

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,13 @@ jobs:
744744
.\emsdk\emsdk_env.ps1
745745
$env:PWD_DIR= $PWD.Path
746746
$env:SYSROOT_PATH="$env:EMSDK/upstream/emscripten/cache/sysroot"
747-
$env:PREFIX="%CONDA_PREFIX%/envs/CppInterOp-wasm"
747+
echo "SYSROOT_PATH=$env:SYSROOT_PATH"
748+
echo "SYSROOT_PATH=$env:SYSROOT_PATH" >> $env:GITHUB_ENV
749+
750+
$env:PREFIX="$env:MAMBA_ROOT_PREFIX/envs/CppInterOp-wasm"
751+
echo "PREFIX=$env:PREFIX"
752+
echo "PREFIX=$env:PREFIX" >> $env:GITHUB_ENV
753+
748754
$env:CMAKE_PREFIX_PATH=$env:PREFIX
749755
$env:CMAKE_SYSTEM_PREFIX_PATH=$env:PREFIX
750756
@@ -835,6 +841,11 @@ jobs:
835841
emrun.bat --browser="chrome.exe" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" DynamicLibraryManagerTests.html
836842
cd ..\..
837843
emmake make -j ${{ env.ncpus }} install
844+
echo "SYSROOT_PATH=$env:SYSROOT_PATH" >> $GITHUB_ENV
845+
echo "CPPINTEROP_DIR=$env:CPPINTEROP_DIR" >> $GITHUB_ENV
846+
echo "LLVM_BUILD_DIR=$env:LLVM_BUILD_DIR" >> $GITHUB_ENV
847+
echo "CPLUS_INCLUDE_PATH=$env:CPLUS_INCLUDE_PATH" >> $GITHUB_ENV
848+
echo "PREFIX=$env:PREFIX" >> $GITHUB_ENV
838849
839850
- name: Build and Test/Install CppInterOp on Windows systems (static library)
840851
if: ${{ runner.os == 'windows' }}
@@ -926,7 +937,7 @@ jobs:
926937
echo "Running DynamicLibraryManagerTests in Chromium"
927938
emrun.bat --browser="chrome.exe" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" DynamicLibraryManagerTests.html
928939
929-
- name: Build xeus-cpp
940+
- name: Build xeus-cpp on Unix Systems
930941
if: ${{ runner.os != 'windows' }}
931942
shell: bash -l {0}
932943
run: |
@@ -950,7 +961,32 @@ jobs:
950961
..
951962
emmake make -j ${{ env.ncpus }} install
952963
953-
- name: Test xeus-cpp C++ Emscripten
964+
- name: Build xeus-cpp on Windows systems
965+
if: ${{ runner.os == 'windows' }}
966+
shell: powershell
967+
run: |
968+
.\emsdk\emsdk activate ${{matrix.emsdk_ver}}
969+
.\emsdk\emsdk_env.ps1
970+
micromamba activate CppInterOp-wasm
971+
git clone https://github.com/mcbarton/xeus-cpp.git
972+
cd .\xeus-cpp
973+
git checkout Enable-Windows-Emscripten-build
974+
mkdir build
975+
pushd build
976+
$env:CMAKE_PREFIX_PATH="${{ env.PREFIX }}"
977+
$env:CMAKE_SYSTEM_PREFIX_PATH="${{ env.PREFIX }}"
978+
emcmake cmake `
979+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} `
980+
-DCMAKE_PREFIX_PATH=${{ env.PREFIX }} `
981+
-DCMAKE_INSTALL_PREFIX=${{ env.PREFIX }} `
982+
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON `
983+
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON `
984+
-DXEUS_CPP_RESOURCE_DIR=${{ env.LLVM_BUILD_DIR }}\lib\clang\${{ matrix.clang-runtime }} `
985+
-DSYSROOT_PATH=${{ env.SYSROOT_PATH }} `
986+
..
987+
emmake make -j ${{ env.ncpus }} install
988+
989+
- name: Test xeus-cpp C++ Emscripten on Unix Systems
954990
if: ${{ runner.os != 'windows' }}
955991
shell: bash -l {0}
956992
run: |
@@ -959,6 +995,15 @@ jobs:
959995
cd ./xeus-cpp/build/test
960996
node test_xeus_cpp.js
961997
998+
- name: Test xeus-cpp C++ Emscripten on Windows Systems
999+
if: ${{ runner.os == 'windows' }}
1000+
shell: powershell
1001+
run: |
1002+
$ErrorActionPreference = "Stop"
1003+
micromamba activate CppInterOp-wasm
1004+
cd .\xeus-cpp\build\test
1005+
node test_xeus_cpp.js
1006+
9621007
- name: Jupyter Lite integration
9631008
if: ${{ runner.os != 'windows' }}
9641009
shell: bash -l {0}
@@ -967,3 +1012,12 @@ jobs:
9671012
micromamba create -n xeus-lite-host jupyterlite-core=0.6 jupyterlite-xeus jupyter_server jupyterlab notebook python-libarchive-c -c conda-forge
9681013
micromamba activate xeus-lite-host
9691014
jupyter lite build --XeusAddon.prefix=${{ env.PREFIX }} --contents notebooks/xeus-cpp-lite-demo.ipynb --contents notebooks/smallpt.ipynb --contents notebooks/images/marie.png --contents notebooks/audio/audio.wav --output-dir dist
1015+
1016+
- name: Jupyter Lite integration
1017+
if: ${{ runner.os == 'windows' }}
1018+
shell: powershell
1019+
run: |
1020+
cd .\xeus-cpp\
1021+
micromamba create -n xeus-lite-host jupyterlite-core=0.6 jupyterlite-xeus jupyter_server jupyterlab notebook python-libarchive-c -c conda-forge
1022+
micromamba activate xeus-lite-host
1023+
jupyter lite build --XeusAddon.prefix=${{ env.PREFIX }} --contents notebooks/xeus-cpp-lite-demo.ipynb --contents notebooks/smallpt.ipynb --contents notebooks/images/marie.png --contents notebooks/audio/audio.wav --output-dir dist

0 commit comments

Comments
 (0)