Skip to content

Commit ef9d57d

Browse files
anutosh491mcbarton
andauthored
Use emsdk from emscripten-forge for deploy build (#232)
Co-authored-by: mcbarton <[email protected]>
1 parent a8c460b commit ef9d57d

File tree

4 files changed

+24
-31
lines changed

4 files changed

+24
-31
lines changed

.github/workflows/deploy-github-page.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ name: Build and Deploy
22

33
on:
44
workflow_dispatch:
5+
pull_request:
56
push:
67
branches:
78
- main
8-
9+
910
permissions:
1011
contents: read
1112
pages: write
1213
id-token: write
13-
14+
1415
jobs:
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 \
@@ -66,9 +60,9 @@ jobs:
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

.github/workflows/main.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -191,19 +191,7 @@ jobs:
191191
matrix:
192192
include:
193193
- name: ubu24
194-
os: ubuntu-24.04
195-
emsdk_ver: "3.1.45"
196-
micromamba_shell_init: bash
197-
- name: ubu22
198-
os: ubuntu-22.04
199-
emsdk_ver: "3.1.45"
200-
micromamba_shell_init: bash
201-
- name: osx13-x86
202-
os: macos-13
203-
emsdk_ver: "3.1.45"
204-
micromamba_shell_init: bash
205-
- name: osx14-arm
206-
os: macos-14
194+
os: ubuntu-24.04-arm
207195
emsdk_ver: "3.1.45"
208196
micromamba_shell_init: bash
209197
- name: osx15-arm

environment-wasm-build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: xeus-cpp-wasm-build
2+
channels:
3+
- https://repo.mamba.pm/emscripten-forge
4+
- conda-forge
5+
dependencies:
6+
- cmake
7+
- emscripten_emscripten-wasm32==3.1.45

environment-wasm-host.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ channels:
33
- https://repo.mamba.pm/emscripten-forge
44
- https://repo.mamba.pm/conda-forge
55
dependencies:
6+
- emscripten-abi==3.1.45
67
- nlohmann_json
78
- xeus-lite
89
- xeus

0 commit comments

Comments
 (0)