@@ -2,15 +2,16 @@ name: Build and Deploy
2
2
3
3
on :
4
4
workflow_dispatch :
5
+ pull_request :
5
6
push :
6
7
branches :
7
8
- main
8
-
9
+
9
10
permissions :
10
11
contents : read
11
12
pages : write
12
13
id-token : write
13
-
14
+
14
15
jobs :
15
16
build :
16
17
runs-on : ${{ matrix.os }}
@@ -20,44 +21,37 @@ jobs:
20
21
matrix :
21
22
include :
22
23
- name : Github-page
23
- os : macos-15
24
+ os : ubuntu-24.04
24
25
emsdk_ver : " 3.1.45"
25
26
steps :
26
27
- uses : actions/checkout@v4
27
28
with :
28
29
fetch-depth : 0
29
-
30
+
30
31
- name : install mamba
31
32
uses : mamba-org/setup-micromamba@main
32
33
with :
34
+ environment-file : environment-wasm-build.yml
33
35
init-shell : bash
36
+ environment-name : xeus-cpp-wasm-build
34
37
35
38
- name : Setup default Build Type on *nux
36
39
if : ${{ runner.os != 'windows' }}
37
40
run : |
38
41
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 }}
47
42
48
43
- name : Build xeus-cpp
49
44
shell : bash -l {0}
50
45
run : |
51
- $HOME/emsdk/emsdk activate ${{matrix.emsdk_ver}}
52
- source $HOME/emsdk/emsdk_env.sh
53
46
micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32
54
-
47
+
55
48
mkdir build
56
49
pushd build
57
50
51
+ export BUILD_PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-build
58
52
export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-host
59
53
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
61
55
62
56
emcmake cmake \
63
57
-DCMAKE_BUILD_TYPE=Release \
66
60
-DCMAKE_FIND_ROOT_PATH=$PREFIX \
67
61
-DSYSROOT_PATH=$SYSROOT_PATH \
68
62
..
69
- emmake make -j ${{ env.ncpus }} install
63
+ emmake make -j ${{ env.ncpus }} install
70
64
71
- - name : Jupyter Lite integration
65
+ - name : Jupyter Lite integration
72
66
shell : bash -l {0}
73
67
run : |
74
68
micromamba create -n xeus-lite-host jupyterlite-core jupyter_server
@@ -89,12 +83,15 @@ jobs:
89
83
90
84
deploy :
91
85
needs : build
86
+ if : github.ref == 'refs/heads/main'
92
87
permissions :
93
88
pages : write
94
89
id-token : write
90
+
95
91
environment :
96
92
name : github-pages
97
93
url : ${{ steps.deployment.outputs.page_url }}
94
+
98
95
runs-on : ubuntu-24.04
99
96
steps :
100
97
- name : Deploy to GitHub Pages
0 commit comments