-
Notifications
You must be signed in to change notification settings - Fork 8
305 lines (263 loc) · 9.59 KB
/
main.yml
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
name: CI
on:
workflow_dispatch:
pull_request:
push:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
jobs:
unix:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: install mamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: .github/ci_env.yml
- name: create project with cookiecutter
shell: bash -l {0}
run:
cookiecutter . --config-file .github/ci_context_no_wasm.yml --no-input -f
- name: create and activate env
shell: bash -l {0}
run: |
cd xeus-mylang
$HOME/micromamba-bin/micromamba create -f environment-dev.yml -y --name xeus_cookiecutter_test_env
micromamba activate xeus_cookiecutter_test_env
- name: install cxx compiler
shell: bash -l {0}
run: |
micromamba activate xeus_cookiecutter_test_env
$HOME/micromamba-bin/micromamba install cxx-compiler -c conda-forge -y
- name: cmake configure
shell: bash -l {0}
run: |
micromamba activate xeus_cookiecutter_test_env
cd xeus-mylang
mkdir -p bld
cd bld
cmake .. \
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
- name: build
shell: bash -l {0}
run: |
cd xeus-mylang/bld
make -j8
- name: install
shell: bash -l {0}
run: |
cd xeus-mylang/bld
make install
- name: test
shell: bash -l {0}
run: |
micromamba activate xeus_cookiecutter_test_env
cd xeus-mylang/test
pytest . --reruns 5
win:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest]
steps:
- uses: actions/checkout@v4
- name: install mamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: .github/ci_env.yml
- name: micromamba shell hook
shell: powershell
run: |
micromamba shell hook -s cmd.exe -p C:\Users\runneradmin\micromamba-root
- name: debug windows cookiecutter
shell: powershell
run: |
micromamba shell hook -s cmd.exe -p C:\Users\runneradmin\micromamba-root
cookiecutter . --no-input -f
- name: create project with cookiecutter
shell: powershell
run:
cookiecutter . --no-input -f
- name: create and activate env
shell: powershell
run: |
micromamba create -f xeus-mylang\environment-dev.yml -y --name xeus_cookiecutter_test_env
micromamba activate xeus_cookiecutter_test_env
- name: install cxx compiler
shell: cmd
run: |
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus_cookiecutter_test_env
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat install cxx-compiler -c conda-forge -y
- name: cmake configure
shell: cmd
run: |
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus_cookiecutter_test_env
cd xeus-mylang
mkdir -p bld
cd bld
cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DXEUS_BUILD_TESTS=ON -DDEPENDENCY_SEARCH_PREFIX="%CONDA_PREFIX%\Library" -DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" -DCMAKE_INSTALL_PREFIX="%CONDA_PREFIX%"
- name: build
shell: cmd
run: |
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus_cookiecutter_test_env
cd xeus-mylang/bld
set CL=/MP
nmake install
- name: test
shell: cmd
run: |
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus_cookiecutter_test_env
cd xeus-mylang/test
pytest . --reruns 5
emscripten_wasm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
emsdk_ver: ["2.0.34", "3.1.3", "latest"]
# os: [ubuntu-latest, "macos-latest"]
steps:
- uses: actions/checkout@v4
- name: make_install_dir
shell: bash -l {0}
run: |
mkdir -p $GITHUB_WORKSPACE/custom_sysroot
- name: install emsdk
shell: bash -l {0}
run: |
git clone https://github.com/emscripten-core/emsdk.git /opt/emsdk
cd /opt/emsdk
./emsdk install ${{matrix.emsdk_ver}}
- name: install mamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: .github/ci_env.yml
- name: create project with cookiecutter
shell: bash -l {0}
run:
cookiecutter . --config-file .github/ci_context_wasm.yml --no-input -f
- name: "install xtl"
run: |
cd /opt/emsdk
./emsdk activate ${{matrix.emsdk_ver}}
source "/opt/emsdk/emsdk_env.sh"
mkdir -p /opt/xtl/build
git clone https://github.com/xtensor-stack/xtl.git /opt/xtl/src
cd /opt/xtl/src
git checkout 0.7.2
cd /opt/xtl/build
emcmake cmake ../src/ -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/custom_sysroot
emmake make -j2 install
- name: "install nlohmann-json"
run: |
cd /opt/emsdk
./emsdk activate ${{matrix.emsdk_ver}}
source "/opt/emsdk/emsdk_env.sh"
mkdir -p /opt/nlohmannjson/build
git clone https://github.com/nlohmann/json.git /opt/nlohmannjson/src
cd /opt/nlohmannjson/src
git checkout v3.9.0
cd /opt/nlohmannjson/build
emcmake cmake ../src/ -DJSON_BuildTests=OFF -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/custom_sysroot
emmake make -j2 install
- name: "install xeus"
run: |
cd /opt/emsdk
./emsdk activate ${{matrix.emsdk_ver}}
source "/opt/emsdk/emsdk_env.sh"
mkdir -p /opt/xeus/build
git clone https://github.com/jupyter-xeus/xeus.git /opt/xeus/src
cd /opt/xeus/src
git checkout 3.0.5
cd /opt/xeus/build
emcmake cmake ../src \
-DXEUS_EMSCRIPTEN_WASM_BUILD=ON \
-DXEUS_BUILD_TESTS=OFF \
-Dxtl_DIR=$GITHUB_WORKSPACE/custom_sysroot/share/cmake/xtl \
-Dnlohmann_json_DIR=$GITHUB_WORKSPACE/custom_sysroot/lib/cmake/nlohmann_json \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/custom_sysroot
emmake make -j2
emmake make -j2 install
- name: "install xeus-lite"
run: |
cd /opt/emsdk
./emsdk activate ${{matrix.emsdk_ver}}
source "/opt/emsdk/emsdk_env.sh"
mkdir -p /opt/xeus-lite/build
git clone https://github.com/jupyter-xeus/xeus-lite.git /opt/xeus-lite/src
cd /opt/xeus-lite/src
git checkout 1.0.1
cd /opt/xeus-lite/build
emcmake cmake ../src \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/custom_sysroot \
-Dnlohmann_json_DIR=$GITHUB_WORKSPACE/custom_sysroot/lib/cmake/nlohmann_json \
-Dxtl_DIR=$GITHUB_WORKSPACE/custom_sysroot/share/cmake/xtl \
-Dxeus_DIR=$GITHUB_WORKSPACE/custom_sysroot/lib/cmake/xeus
emmake make -j2
emmake make -j2 install
- name: cmake configure rendered project
shell: bash -l {0}
run: |
cd /opt/emsdk
./emsdk activate ${{matrix.emsdk_ver}}
source "/opt/emsdk/emsdk_env.sh"
cd $GITHUB_WORKSPACE/xeus-mylang
mkdir -p bld
cd bld
emcmake cmake .. \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/custom_sysroot \
-DXEUS_MYLANG_EMSCRIPTEN_WASM_BUILD=ON \
-Dxtl_DIR=$GITHUB_WORKSPACE/custom_sysroot/share/cmake/xtl \
-Dnlohmann_json_DIR=$GITHUB_WORKSPACE/custom_sysroot/lib/cmake/nlohmann_json \
-Dxeus_DIR=$GITHUB_WORKSPACE/custom_sysroot/lib/cmake/xeus \
-Dxeus-lite_DIR=$GITHUB_WORKSPACE/custom_sysroot/lib/cmake/xeus-lite
- name: build rendered project
shell: bash
run: |
cd /opt/emsdk
./emsdk activate ${{matrix.emsdk_ver}}
source "/opt/emsdk/emsdk_env.sh"
cd $GITHUB_WORKSPACE/xeus-mylang/bld
emmake make -j8
- name: install rendered project
shell: bash -l {0}
run: |
cd /opt/emsdk
./emsdk activate ${{matrix.emsdk_ver}}
source "/opt/emsdk/emsdk_env.sh"
cd $GITHUB_WORKSPACE/xeus-mylang/bld
make install
push:
needs: [unix, win, emscripten_wasm]
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: install mamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: .github/ci_env.yml
- name: create project with cookiecutter
shell: bash -l {0}
run:
cookiecutter . --config-file .github/ci_context_wasm.yml --no-input -f
- name: Push to rendered branch
if: github.repository == 'jupyter-xeus/xeus-cookiecutter' && github.ref == 'refs/heads/main'
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: rendered
FOLDER: xeus-mylang
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MESSAGE: "added rendered: ({sha}) {msg}"
# GITHUB_TOKEN permissions cannot be changed for forks
continue-on-error: true