Repository navigation
461 lines (396 loc) · 13.4 KB
/
Copy pathbuild.yml
File metadata and controls
461 lines (396 loc) · 13.4 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
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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
name: Test
on:
push:
branches: [main]
pull_request:
branches: '*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
test-backend-conda:
name: Server [Conda/Ubuntu] - Python ${{ matrix.python-version }} on JL ${{ matrix.jupyterlab-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.14']
jupyterlab-version: ['4.5']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
activate-environment: test_gator
channels: conda-forge
show-channel-urls: true
use-only-tar-bz2: false
- name: Install and enable Corepack
run: |
npm install -g corepack@0.33.0 --force
corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: |
conda info
conda install -c conda-forge -n test_gator nb_conda_kernels "jupyterlab=${{ matrix.jupyterlab-version }}" "notebook>=7"
conda activate test_gator
jupyter --version
jlpm install
shell: bash -l {0}
- name: Install Extension
run: pip install -e .[test,dev]
shell: bash -l {0}
- name: Test the server extension
run: python -m pytest -ra mamba_gator
shell: bash -l {0}
test-backend-mamba:
name: Server [Mamba/Ubuntu] - Python ${{ matrix.python-version }} on JL ${{ matrix.jupyterlab-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.14']
jupyterlab-version: ['4.5']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache conda
uses: actions/cache@v4
env:
# Increase this value to reset cache
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-mamba-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-mamba-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('pyproject.toml') }}
${{ runner.os }}-mamba-${{ matrix.python-version }}
- name: Setup Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: '24.11.3-2' # For Mamba 1.5.12
show-channel-urls: true
use-only-tar-bz2: false
- name: Install and enable Corepack
run: |
npm install -g corepack@0.33.0 --force
corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: |
mamba create -y -n test_gator -c conda-forge python=${{ matrix.python-version }} nb_conda_kernels
conda activate test_gator
pip install "jupyterlab==${{ matrix.jupyterlab-version }}.*" "notebook>=7"
jupyter --version
jlpm install
shell: bash -l {0}
- name: Install Extension
run: |
conda activate test_gator
pip install -e .[test,dev]
shell: bash -l {0}
- name: Test the server extension
run: |
conda activate test_gator
python -m pytest -ra mamba_gator
shell: bash -l {0}
test-frontend-unit:
name: Frontend Unit Tests on JL ${{ matrix.jupyterlab-version }}
runs-on: ubuntu-latest
# Note: Skipping setup-python - using runner's pre-installed Python for pip only.
# JupyterLab is installed just to get jlpm, not for Python code execution.
strategy:
matrix:
jupyterlab-version: ['4.5']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install and enable Corepack
run: |
npm install -g corepack@0.33.0 --force
corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install JupyterLab
run: pip install "jupyterlab==${{ matrix.jupyterlab-version }}.*"
- name: Install dependencies
run: jlpm install
- name: Run linter
run: jlpm run eslint:check
- name: Build packages
run: jlpm run build
- name: Run frontend tests
run: jlpm run test
# TODO: Enable when adding Playwright E2E tests
# test-frontend-e2e:
# name: Test E2E on ${{ matrix.os }} on ${{ matrix.jupyterlab-version }}
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# jupyterlab-version: ["4.5"]
# os:
# - ubuntu-latest
# - macos-latest
# - windows-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Install and enable Corepack
# run: |
# npm install -g corepack@0.33.0 --force
# corepack enable
# - name: Setup Node.js
# uses: actions/setup-node@v4
# with:
# node-version: '20'
# cache: 'yarn'
# - name: Install JupyterLab
# run: pip install "jupyterlab==${{ matrix.jupyterlab-version }}.*"
# - name: Install dependencies
# run: jlpm install
# - name: Build packages
# run: jlpm run build
# - name: Install Playwright browsers
# run: npx playwright install --with-deps chromium
# - name: Run E2E tests
# run: jlpm run test:e2e
test-backend-os-compat:
name: Server [Conda/${{ matrix.os }}] - Python 3.14 on JL ${{ matrix.jupyterlab-version }}
runs-on: ${{ matrix.os }}
continue-on-error: true
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os:
- 'macos-latest'
- 'windows-latest'
jupyterlab-version: ['4.5']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache conda
uses: actions/cache@v4
env:
# Increase this value to reset cache
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ matrix.os }}-conda-3.14-${{ env.CACHE_NUMBER }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ matrix.os }}-conda-3.14-${{ env.CACHE_NUMBER }}-${{ hashFiles('pyproject.toml') }}
${{ matrix.os }}-conda-3.14
- name: Setup Python 3.14
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_gator
channels: conda-forge
python-version: '3.14'
show-channel-urls: true
use-only-tar-bz2: false
- name: Install and enable Corepack
run: |
npm install -g corepack@0.33.0 --force
corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Create conda environment
run: |
conda info
conda install -c conda-forge -n test_gator nb_conda_kernels "jupyterlab=${{ matrix.jupyterlab-version }}" "notebook>=7"
- name: Upgrade conda dependencies on Windows (resolves OSError)
if: matrix.os == 'windows-latest'
run: >
conda install -c conda-forge -n test_gator
"websocket-client>=1.7"
"send2trash>=1.8.2"
"jupyter_server<3.0.0,>=2.0.0"
--yes
shell: bash -l {0}
- name: Install dependencies and Extension
run: |
conda activate test_gator
jlpm install
pip install -e .[test,dev]
shell: bash -l {0}
- name: Test the extension
env:
OS_RUNNER: ${{ matrix.os }}
run: |
conda activate test_gator
python -m pytest mamba_gator
shell: bash -l {0}
- name: Verify extension installation
run: |
conda activate test_gator
jupyter server extension list
jupyter labextension list
shell: bash -l {0}
- name: Browser check
if: matrix.os != 'windows-latest'
run: |
npx playwright install --with-deps chromium
conda activate test_gator
python -m jupyterlab.browser_check
shell: bash -l {0}
test-integration:
name: Full Suite [Mamba/Ubuntu] - Python 3.14 on JL ${{ matrix.jupyterlab-version }}
runs-on: ubuntu-latest
strategy:
matrix:
jupyterlab-version: ['4.5']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache conda
uses: actions/cache@v4
env:
# Increase this value to reset cache
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-mamba-3.14-${{ env.CACHE_NUMBER }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-mamba-3.14-${{ env.CACHE_NUMBER }}-${{ hashFiles('pyproject.toml') }}
${{ runner.os }}-mamba-3.14
- name: Setup Python 3.14
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: '24.11.3-2' # For Mamba 1.5.12
show-channel-urls: true
use-only-tar-bz2: false
- name: Install and enable Corepack
run: |
npm install -g corepack@0.33.0 --force
corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Create mamba environment
shell: bash -l {0}
run: |
mamba create -y -n test_gator -c conda-forge python=3.14 nb_conda_kernels
conda activate test_gator
pip install "jupyterlab==${{ matrix.jupyterlab-version }}.*" "notebook>=7"
python --version
jupyter --version
- name: Install Dependencies and Extension
run: |
conda activate test_gator
jlpm install
pip install -e .[test,dev]
# Check pip dependencies
pip check
shell: bash -l {0}
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
shell: bash -l {0}
- name: Run linters
run: |
conda activate test_gator
hatch run lint:check
jlpm run eslint:check
shell: bash -l {0}
- name: Test TypeScript frontend
run: |
conda activate test_gator
jlpm run test
shell: bash -l {0}
- name: Test Python backend with coverage
run: |
conda activate test_gator
coverage run -m pytest mamba_gator --junitxml=pytest-results.xml
coverage report
coverage xml -o coverage.xml
coverage json -o coverage.json
shell: bash -l {0}
- name: Generate coverage report summary
if: always()
run: |
conda activate test_gator
echo "## 🐍 Python Backend Test Coverage" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
coverage report >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
shell: bash -l {0}
- name: Upload coverage reports
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: |
coverage.xml
coverage.json
pytest-results.xml
.coverage
- name: Verify extension installation
run: |
conda activate test_gator
jupyter server extension list
jupyter server extension list 2>&1 | grep "mamba_gator.*OK"
jupyter labextension list
jupyter labextension list 2>&1 | grep "@mamba-org/gator-lab.*OK"
python -m jupyterlab.browser_check
shell: bash -l {0}
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
with:
python_version: '3.14'
- name: Build SDist
run: |
pip install build
python -m build --sdist
- name: Upload sdist Artifact
uses: actions/upload-artifact@v4
with:
name: 'sdist'
path: dist/*.tar.gz
test-offline-build:
name: Test building offline
runs-on: ubuntu-latest
needs: [make_sdist]
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Download sdist
uses: actions/download-artifact@v4
- name: Install From SDist
run: |
set -ex
cd sdist
mkdir test
tar --strip-components=1 -zxvf *.tar.gz -C ./test
- name: Test offline build with unshare
run: |
# Use unshare to create a network namespace that blocks network access
cd sdist/test
python -m venv .venv
.venv/bin/python -m pip install build jupyter-server hatch-jupyter-builder jupyterlab
sudo unshare --net bash -c ".venv/bin/python -m build --no-isolation --wheel"