-
Notifications
You must be signed in to change notification settings - Fork 148
439 lines (382 loc) · 13.3 KB
/
job.test.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
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
name: CI
on:
push:
branches:
- main
- 3.x
- 4.x
pull_request:
branches:
- main
- 3.x
- 4.x
workflow_dispatch:
# TODO: might need to tweak `group`
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
env:
JULIA_NUM_THREADS: 2
MAMBA_NO_BANNER: 1
PIP_DISABLE_PIP_VERSION_CHECK: 1
PYTHONUNBUFFERED: 1
ATEST_PROCESSES: 2
ATEST_RETRIES: 3
JLPM_CMD: jlpm install
# Increase this value to reset all caches
CACHE_EPOCH: 4
JULIA_LANGSERVER: 4.1.0
jobs:
lint:
name: jstest/lint
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu]
nodejs: ['>=16,<17.0.0a0']
lab: ['>=4.0.5,<5.0.0a0']
r: ['>=4']
steps:
- uses: actions/checkout@v3
- uses: cschleiden/replace-tokens@v1
with:
tokenPrefix: '{'
tokenSuffix: '}'
files: '["requirements/github-actions.yml"]'
env:
lab: '${{ matrix.lab }}'
nodejs: '${{ matrix.nodejs }}'
- name: Set up Python and mamba
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: requirements/github-actions.yml
miniforge-variant: Mambaforge
use-mamba: true
- name: Install linting dependencies
run: mamba env update -n test --file requirements/lint.yml
- name: Check integrity of package versions
run: python scripts/integrity.py
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: '**/node_modules'
key: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-node-build-${{ hashFiles('yarn.lock', 'requirements/github-actions.yml') }}
- name: Cache yarn packages
id: cache-yarn-packages
if: steps.cache-node-modules.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: '.yarn/cache'
key: |
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-
${{ env.CACHE_EPOCH }}-yarn-
- name: Install npm dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: ${{ env.JLPM_CMD }}
- name: Build frontend
run: jlpm build
- name: Run frontend unit tests
run: jlpm test --no-bail
- name: Lint backend
run: python scripts/lint.py
- name: 'Revert templated file (TODO: remove)'
run: git checkout requirements/github-actions.yml
- name: Lint frontend
run: jlpm lint:check
- name: Check distributions
run: python scripts/distcheck.py
- name: Rename uncached conda packages
shell: bash
run: mv "${CONDA_PKGS_DIR}" "${CONDA_PKGS_DIR}_do_not_cache"
build:
name: build
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu]
nodejs: ['>=16,<17.0.0a0']
lab: ['>=4.0.0,<5.0.0a0']
r: ['>=4']
steps:
- uses: actions/checkout@v3
- uses: cschleiden/replace-tokens@v1
with:
tokenPrefix: '{'
tokenSuffix: '}'
files: '["requirements/github-actions.yml"]'
env:
lab: '${{ matrix.lab }}'
nodejs: '${{ matrix.nodejs }}'
- name: Set up Python and mamba
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
use-mamba: true
- name: Install minimal build deps
run: mamba install -n test -c conda-forge setuptools wheel 'jupyterlab${{ matrix.lab }}' 'nodejs${{ matrix.nodejs }}'
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: '**/node_modules'
key: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-node-build-${{ hashFiles('yarn.lock', 'requirements/github-actions.yml') }}
- name: Cache yarn packages
id: cache-yarn-packages
if: steps.cache-node-modules.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: '.yarn/cache'
key: |
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-
${{ env.CACHE_EPOCH }}-yarn-
- name: install npm dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: ${{ env.JLPM_CMD }}
- name: Build frontend
run: |
jlpm build
jlpm bundle
- name: Build python distributions
run: |
set -eux
cp README.md python_packages/jupyterlab_lsp
cd python_packages/jupyter_lsp
python setup.py sdist bdist_wheel
cd ../jupyterlab_lsp
python setup.py sdist bdist_wheel
cd ../klingon_ls_specification
python setup.py sdist bdist_wheel
- name: Collect distributions
run: |
set -eux
mkdir dist
cp python_packages/*/dist/* packages/*/*.tgz dist/
cd dist
sha256sum * | tee SHA256SUMS
- name: Publish builds
uses: actions/upload-artifact@v3
with:
name: jupyterlab-lsp dist ${{ github.run_number }}
path: ./dist
- name: Rename uncached conda packages
shell: bash
run: mv "${CONDA_PKGS_DIR}" "${CONDA_PKGS_DIR}_do_not_cache"
acceptance:
runs-on: ${{ matrix.os }}-latest
name: atest ${{ matrix.os }} py${{ matrix.python }} r${{ matrix.r }}
needs: [build]
strategy:
# TODO: maybe turn back on
fail-fast: false
matrix:
os: ['ubuntu', 'macos', 'windows']
python: ['3.8', '3.11']
include:
- python: '3.8'
# Node 16 end-of-life: 2023-09-11
nodejs: '>=16,<17.0.0.a0'
r: '>=4'
lab: '>=4,<5'
- python: '3.11'
# Node 18 end-of-life: 2025-04-30
nodejs: '>=18,<19.0.0.a0'
r: '>=4'
lab: '>=4,<5'
steps:
- uses: actions/checkout@v3
- name: Set JupyterLab and Node versions
uses: cschleiden/replace-tokens@v1
with:
tokenPrefix: '{'
tokenSuffix: '}'
files: '["requirements/github-actions.yml"]'
env:
lab: '${{ matrix.lab }}'
nodejs: '${{ matrix.nodejs }}'
- name: Set up Python and mamba
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python }}
environment-file: requirements/github-actions.yml
miniforge-variant: Mambaforge
use-mamba: true
- name: List all packages
run: conda list
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: '**/node_modules'
key: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-node-atest-${{ hashFiles('yarn.lock') }}
- name: Cache yarn packages
id: cache-yarn-packages
if: steps.cache-node-modules.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: '.yarn/cache'
key: |
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ env.CACHE_EPOCH }}-yarn-${{ runner.os }}-
${{ env.CACHE_EPOCH }}-yarn-
- uses: actions/cache@v3
with:
path: ~/.julia/artifacts
key: |
${{ env.CACHE_EPOCH }}-julia-test-${{ runner.os }}-${{ env.JULIA_LANGSERVER }}
- uses: actions/download-artifact@v3
with:
name: jupyterlab-lsp dist ${{ github.run_number }}
path: ./dist
- name: Install python packages
run: python -m pip install --find-links=dist --no-index --ignore-installed --no-deps jupyter_lsp jupyterlab_lsp
- name: Install Klingon file type extension and server specification (for testing languages without language servers)
run: python -m pip install --find-links=dist --no-index --ignore-installed --no-deps klingon_ls_specification
- name: Pip check
run: |
python -m pip check
python -m pip list | grep -ie klingon-ls-specification
- name: List server extensions
run: |
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "jupyter_lsp.*enabled" -
- name: List frontend extensions
run: |
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "jupyterlab-lsp.*enabled" -
jupyter labextension list 2>&1 | grep -ie "jupyterlab-lsp-klingon-integration.*enabled" -
- name: install node-based language servers
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: ${{ env.JLPM_CMD }}
- name: Install Julia
uses: julia-actions/setup-julia@v1
- name: Install Julia language server
run: julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(;name="LanguageServer", version="${{ env.JULIA_LANGSERVER }}"))'
- name: Run python tests
run: python scripts/utest.py
- name: Run browser tests
run: python scripts/atest.py --exclude expect:fail
- name: Find and remove empty files
# https://github.com/actions/upload-artifact/issues/150
run: find ./atest/output -empty -delete
if: always()
shell: bash
- name: Publish browser test output
uses: actions/upload-artifact@v3
with:
name: ${{ job.status }} Robot ${{ matrix.os }} Python ${{ matrix.python }} ${{ github.run_number }}
path: ./atest/output
if: always()
- name: Rename uncached conda packages
shell: bash
run: mv "${CONDA_PKGS_DIR}" "${CONDA_PKGS_DIR}_do_not_cache"
smoke:
name: smoke ${{ matrix.os }} py${{ matrix.python }}
runs-on: ${{ matrix.os }}-latest
needs: [build, lint]
strategy:
fail-fast: false
max-parallel: 3
matrix:
os: ['ubuntu', 'macos', 'windows']
python: ['3.8', '3.11', 'pypy-3.8']
include:
- python: '3.8'
dist: 'jupyter*lsp*.whl'
lab: '>=4,<5'
- python: '3.8'
dist: 'jupyter*lsp*.tar.gz'
lab: '>=4,<5'
- python: '3.11'
dist: 'jupyter*lsp*.whl'
lab: '>=4,<5'
- python: 'pypy-3.8'
dist: 'jupyter*lsp*.tar.gz'
lab: '>=4,<5'
- os: 'windows'
py_cmd: python
- os: 'macos'
py_cmd: python3
- os: 'ubuntu'
py_cmd: python
steps:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: 'x64'
- uses: actions/download-artifact@v3
with:
name: jupyterlab-lsp dist ${{ github.run_number }}
path: ./dist
- name: Install the prerequisites
run: ${{ matrix.py_cmd }} -m pip install pip wheel
- name: Install the package
run: cd dist && ${{ matrix.py_cmd }} -m pip install -vv ${{ matrix.dist }} 'jupyterlab${{ matrix.lab }}'
- name: Validate environment
run: |
set -eux
${{ matrix.py_cmd }} -m pip freeze
${{ matrix.py_cmd }} -m pip check
- name: Validate the install
run: |
set -eux
${{ matrix.py_cmd }} -m jupyter labextension list
${{ matrix.py_cmd }} -m jupyter server extension list
${{ matrix.py_cmd }} -m jupyter labextension list 2>&1 | grep -ie "jupyterlab-lsp.*enabled.*ok" -
${{ matrix.py_cmd }} -m jupyter server extension list 2>&1 | grep -ie "jupyter_lsp.*enabled" -
source:
name: smoke source install ${{ matrix.os }} py${{ matrix.python }} lab${{ matrix.lab }}
runs-on: ${{ matrix.os }}-latest
needs: [build]
strategy:
fail-fast: false
matrix:
os: [ubuntu]
python: ['3.8', '3.11']
nodejs: ['18']
include:
- python: '3.8'
lab: '>=4,<5'
- python: '3.11'
lab: '>=4,<5'
steps:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: 'x64'
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.nodejs }}
- uses: actions/download-artifact@v3
with:
name: jupyterlab-lsp dist ${{ github.run_number }}
path: ./dist
- name: Install the prerequisites
run: python -m pip install --upgrade pip wheel setuptools
- name: Install JupyterLab
run: python -m pip install 'jupyterlab${{ matrix.lab }}'
- name: Install the server package
run: cd dist && python -m pip install -vv jupyter_lsp*.whl
- name: install the source extension
run: cd dist && jupyter labextension install jupyter-lsp-jupyterlab-lsp-*.tgz --log-level DEBUG
- name: Validate the install
run: |
set -eux
jupyter labextension list
jupyter server extension list
jupyter labextension list 2>&1 | grep -ie "jupyterlab-lsp.*enabled.*ok" -
jupyter server extension list 2>&1 | grep -ie "jupyter_lsp.*enabled" -