-
Notifications
You must be signed in to change notification settings - Fork 56
132 lines (114 loc) · 4.26 KB
/
deploy-pages.yml
File metadata and controls
132 lines (114 loc) · 4.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Build and Deploy
on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: '30 20 * * *' # Warning: Timezone dep - 20:00 is 1:00
permissions:
contents: read
pages: write
id-token: write
env:
EMSDK_VER: "4.0.9"
BUILD_STATIC_LIBRARY: Off
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# micromamba_shell_init is derived below from runner.os.
include:
- { name: osx26-arm-emscr-llvm22, os: macos-26, clang-runtime: '22', wasm: true }
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Save PR Info
uses: ./.github/actions/Miscellaneous/Save_PR_Info
- name: Setup default Build Type
uses: ./.github/actions/Miscellaneous/Select_Default_Build_Type
- name: install mamba
uses: mamba-org/setup-micromamba@main
with:
init-shell: >-
${{ runner.os == 'Windows' && 'powershell' || 'bash' }}
- name: Setup emsdk
shell: bash -l {0}
run: |
git clone --depth=1 https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install ${{ env.EMSDK_VER }}
- name: Restore cached LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build
uses: actions/cache/restore@v4
id: cache
with:
path: |
llvm-project
${{ matrix.cling=='On' && 'cling' || '' }}
key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-clang-${{ matrix.clang-runtime }}.x-emscripten
- name: Build and test CppInterOp
uses: ./.github/actions/Build_and_Test_CppInterOp
- name: Build xeus-cpp
shell: bash -l {0}
run: |
./emsdk/emsdk activate ${{ env.EMSDK_VER }}
source ./emsdk/emsdk_env.sh
micromamba activate CppInterOp-wasm
git clone --depth=1 https://github.com/compiler-research/xeus-cpp.git
cd ./xeus-cpp
mkdir build
pushd build
export CMAKE_PREFIX_PATH=${{ env.PREFIX }}
export CMAKE_SYSTEM_PREFIX_PATH=${{ env.PREFIX }}
emcmake cmake \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DCMAKE_PREFIX_PATH=${{ env.PREFIX }} \
-DCMAKE_INSTALL_PREFIX=${{ env.PREFIX }} \
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
-DXEUS_CPP_RESOURCE_DIR=${{ env.LLVM_BUILD_DIR }}/lib/clang/${{ matrix.clang-runtime }} \
-DSYSROOT_PATH=${{ env.SYSROOT_PATH }} \
..
EMCC_CFLAGS="-sSUPPORT_LONGJMP=wasm -fwasm-exceptions" emmake make -j ${{ env.ncpus }} install
- name: Test xeus-cpp C++ Emscripten
shell: bash -l {0}
run: |
set -e
micromamba activate CppInterOp-wasm
cd ./xeus-cpp/build/test
node test_xeus_cpp.js
- name: Jupyter Lite integration
shell: bash -l {0}
run: |
cd ./xeus-cpp/
micromamba create -n xeus-lite-host jupyterlite-core jupyterlite-xeus jupyter_server jupyterlab notebook python-libarchive-c -c conda-forge
micromamba activate xeus-lite-host
jupyter lite build --XeusAddon.prefix=${{ env.PREFIX }} \
--contents notebooks/xeus-cpp-lite-demo.ipynb \
--contents notebooks/tinyraytracer.ipynb \
--contents notebooks/images/marie.png \
--contents notebooks/audio/audio.wav \
--XeusAddon.mounts="${{ env.PREFIX }}/share/xeus-cpp/tagfiles:/share/xeus-cpp/tagfiles" \
--XeusAddon.mounts="${{ env.PREFIX }}/etc/xeus-cpp/tags.d:/etc/xeus-cpp/tags.d" --output-dir dist
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./xeus-cpp/dist/
deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-22.04
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4