Skip to content

Commit 8e8716f

Browse files
committed
Add Windows Emscripten build of xeus-cpp to ci
1 parent 2585d0d commit 8e8716f

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
@@ -818,6 +824,11 @@ jobs:
818824
}
819825
emmake make -j ${{ env.ncpus }} check-cppinterop
820826
emmake make -j ${{ env.ncpus }} install
827+
echo "SYSROOT_PATH=$env:SYSROOT_PATH" >> $GITHUB_ENV
828+
echo "CPPINTEROP_DIR=$env:CPPINTEROP_DIR" >> $GITHUB_ENV
829+
echo "LLVM_BUILD_DIR=$env:LLVM_BUILD_DIR" >> $GITHUB_ENV
830+
echo "CPLUS_INCLUDE_PATH=$env:CPLUS_INCLUDE_PATH" >> $GITHUB_ENV
831+
echo "PREFIX=$env:PREFIX" >> $GITHUB_ENV
821832
822833
- name: Build and Test/Install CppInterOp on Windows systems (static library)
823834
if: ${{ runner.os == 'windows' }}
@@ -900,7 +911,7 @@ jobs:
900911
}
901912
emmake make -j ${{ env.ncpus }} check-cppinterop
902913
903-
- name: Build xeus-cpp
914+
- name: Build xeus-cpp on Unix Systems
904915
if: ${{ runner.os != 'windows' }}
905916
shell: bash -l {0}
906917
run: |
@@ -924,7 +935,32 @@ jobs:
924935
..
925936
emmake make -j ${{ env.ncpus }} install
926937
927-
- name: Test xeus-cpp C++ Emscripten
938+
- name: Build xeus-cpp on Windows systems
939+
if: ${{ runner.os == 'windows' }}
940+
shell: powershell
941+
run: |
942+
.\emsdk\emsdk activate ${{matrix.emsdk_ver}}
943+
.\emsdk\emsdk_env.ps1
944+
micromamba activate CppInterOp-wasm
945+
git clone https://github.com/mcbarton/xeus-cpp.git
946+
cd .\xeus-cpp
947+
git checkout Enable-Windows-Emscripten-build
948+
mkdir build
949+
pushd build
950+
$env:CMAKE_PREFIX_PATH="${{ env.PREFIX }}"
951+
$env:CMAKE_SYSTEM_PREFIX_PATH="${{ env.PREFIX }}"
952+
emcmake cmake `
953+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} `
954+
-DCMAKE_PREFIX_PATH=${{ env.PREFIX }} `
955+
-DCMAKE_INSTALL_PREFIX=${{ env.PREFIX }} `
956+
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON `
957+
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON `
958+
-DXEUS_CPP_RESOURCE_DIR=${{ env.LLVM_BUILD_DIR }}\lib\clang\${{ matrix.clang-runtime }} `
959+
-DSYSROOT_PATH=${{ env.SYSROOT_PATH }} `
960+
..
961+
emmake make -j ${{ env.ncpus }} install
962+
963+
- name: Test xeus-cpp C++ Emscripten on Unix Systems
928964
if: ${{ runner.os != 'windows' }}
929965
shell: bash -l {0}
930966
run: |
@@ -933,6 +969,15 @@ jobs:
933969
cd ./xeus-cpp/build/test
934970
node test_xeus_cpp.js
935971
972+
- name: Test xeus-cpp C++ Emscripten on Windows Systems
973+
if: ${{ runner.os == 'windows' }}
974+
shell: powershell
975+
run: |
976+
$ErrorActionPreference = "Stop"
977+
micromamba activate CppInterOp-wasm
978+
cd .\xeus-cpp\build\test
979+
node test_xeus_cpp.js
980+
936981
- name: Jupyter Lite integration
937982
if: ${{ runner.os != 'windows' }}
938983
shell: bash -l {0}
@@ -941,3 +986,12 @@ jobs:
941986
micromamba create -n xeus-lite-host jupyterlite-core=0.6 jupyterlite-xeus jupyter_server jupyterlab notebook python-libarchive-c -c conda-forge
942987
micromamba activate xeus-lite-host
943988
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
989+
990+
- name: Jupyter Lite integration
991+
if: ${{ runner.os == 'windows' }}
992+
shell: powershell
993+
run: |
994+
cd .\xeus-cpp\
995+
micromamba create -n xeus-lite-host jupyterlite-core=0.6 jupyterlite-xeus jupyter_server jupyterlab notebook python-libarchive-c -c conda-forge
996+
micromamba activate xeus-lite-host
997+
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)