@@ -2,15 +2,16 @@ name: Build and Deploy
22
33on :
44 workflow_dispatch :
5+ pull_request :
56 push :
67 branches :
78 - main
8-
9+
910permissions :
1011 contents : read
1112 pages : write
1213 id-token : write
13-
14+
1415jobs :
1516 build :
1617 runs-on : ${{ matrix.os }}
@@ -20,44 +21,37 @@ jobs:
2021 matrix :
2122 include :
2223 - name : Github-page
23- os : macos-15
24+ os : ubuntu-24.04
2425 emsdk_ver : " 3.1.45"
2526 steps :
2627 - uses : actions/checkout@v4
2728 with :
2829 fetch-depth : 0
29-
30+
3031 - name : install mamba
3132 uses : mamba-org/setup-micromamba@main
3233 with :
34+ environment-file : environment-wasm-build.yml
3335 init-shell : bash
36+ environment-name : xeus-cpp-wasm-build
3437
3538 - name : Setup default Build Type on *nux
3639 if : ${{ runner.os != 'windows' }}
3740 run : |
3841 echo "ncpus=$(nproc --all)" >> $GITHUB_ENV
39-
40- - name : Setup emsdk
41- shell : bash -l {0}
42- run : |
43- cd $HOME
44- git clone --depth=1 https://github.com/emscripten-core/emsdk.git
45- cd emsdk
46- ./emsdk install ${{ matrix.emsdk_ver }}
4742
4843 - name : Build xeus-cpp
4944 shell : bash -l {0}
5045 run : |
51- $HOME/emsdk/emsdk activate ${{matrix.emsdk_ver}}
52- source $HOME/emsdk/emsdk_env.sh
5346 micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32
54-
47+
5548 mkdir build
5649 pushd build
5750
51+ export BUILD_PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-build
5852 export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-host
5953 echo "PREFIX=$PREFIX" >> $GITHUB_ENV
60- export SYSROOT_PATH=$HOME /emsdk/upstream/emscripten/cache/sysroot
54+ export SYSROOT_PATH=$BUILD_PREFIX/opt /emsdk/upstream/emscripten/cache/sysroot
6155
6256 emcmake cmake \
6357 -DCMAKE_BUILD_TYPE=Release \
6660 -DCMAKE_FIND_ROOT_PATH=$PREFIX \
6761 -DSYSROOT_PATH=$SYSROOT_PATH \
6862 ..
69- emmake make -j ${{ env.ncpus }} install
63+ emmake make -j ${{ env.ncpus }} install
7064
71- - name : Jupyter Lite integration
65+ - name : Jupyter Lite integration
7266 shell : bash -l {0}
7367 run : |
7468 micromamba create -n xeus-lite-host jupyterlite-core jupyter_server
@@ -89,12 +83,15 @@ jobs:
8983
9084 deploy :
9185 needs : build
86+ if : github.ref == 'refs/heads/main'
9287 permissions :
9388 pages : write
9489 id-token : write
90+
9591 environment :
9692 name : github-pages
9793 url : ${{ steps.deployment.outputs.page_url }}
94+
9895 runs-on : ubuntu-24.04
9996 steps :
10097 - name : Deploy to GitHub Pages
0 commit comments