-
Notifications
You must be signed in to change notification settings - Fork 25
226 lines (184 loc) · 5.75 KB
/
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
name: Test
on:
push:
branches:
- main
- 0.1.x
pull_request:
branches:
- '*'
env:
EXPECT_BUILD: |-
_output/extensions/@jupyterlite/pyodide-kernel-extension/static/pypi/all.json
JUPYTERLITE_NO_LIBARCHIVE: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
with:
node_version: '20.x'
python_version: '3.11'
- name: Install dependencies
run: python -m pip install -U pip
- name: Install Python dependencies
run: python -m pip install -v -e ".[dev,lint]"
- name: Install JS dependencies
run: jlpm --immutable
- name: Lint the JS
run: jlpm lint:js:check
- name: Lint the Python
run: jlpm lint:py:check
- name: Build the JS extension
run: jlpm build
- name: Package the extension
run: jlpm dist:pypi
- name: Hash distributions
run: |-
set -eux
cd dist
sha256sum * > SHA256SUMS
cat SHA256SUMS
- name: Build requirements files
run: |-
set -eux
cd dist
echo "./dist/$(ls *.whl)" >> requirements-wheel.txt
echo "./dist/$(ls *.tar.gz)" >> requirements-sdist.txt
cat *.txt
- name: Upload extension packages
uses: actions/upload-artifact@v3
with:
name: jupyterlite-pyodide-kernel-dist-${{ github.run_number }}
path: dist
if-no-files-found: error
- name: Upload test config
uses: actions/upload-artifact@v3
with:
name: pyproject-toml
path: pyproject.toml
if-no-files-found: error
test:
needs: build
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
python-version: ['3.8', '3.11']
steps:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v3
with:
path: dist
name: jupyterlite-pyodide-kernel-dist-${{ github.run_number }}
# Remove NodeJS, twice to take care of system and locally installed node versions.
- name: Clean out nodejs
if: matrix.os != 'windows'
run: |
set -eux
sudo rm -rf $(which node)
sudo rm -rf $(which node)
- name: Install Built Package (wheel)
if: matrix.python-version == '3.11'
run: |-
python -m pip install -v -r dist/requirements-wheel.txt
- name: Install Built Package (sdist)
if: matrix.python-version == '3.8'
run: |-
python -m pip install -v -r dist/requirements-sdist.txt
- name: Make temp dir
run: |-
mkdir tmp || md tmp
- name: Smoke test (CLI)
run: |-
cd tmp
jupyter piplite --version || exit 1
jupyter piplite --help || exit 1
- name: Smoke test (status)
run: |-
cd tmp
jupyter lite status || exit 1
- name: Smoke test (build)
run: |-
cd tmp
jupyter lite build
ls ${{ env.EXPECT_BUILD }} || dir ${{ env.EXPECT_BUILD }} || exit 1
- name: Smoke test archive
run: |-
cd tmp
jupyter lite archive || exit 1
- name: Smoke test (check)
run: |-
cd tmp
jupyter lite check || exit 1
- uses: actions/download-artifact@v3
with:
name: pyproject-toml
- name: Install test deps
run: |-
python -m pip install jupyterlite-pyodide-kernel[test] jupyterlite-core[lab] --upgrade-strategy only-if-needed
- name: Check extension
run: |-
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "@jupyterlite/pyodide-kernel.*OK"
- name: Run the tests
run: pytest
- name: Upload reports
if: always()
uses: actions/upload-artifact@v2
with:
name: |-
jupyterlite-pyodide-kernel-pytest-${{ github.run_number }}-${{ matrix.os }}-${{ matrix.python-version}}
path: build/reports
if-no-files-found: error
integration-tests:
name: Integration tests
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
project: ['default', 'crossoriginisolated']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: actions/download-artifact@v3
with:
path: dist
name: jupyterlite-pyodide-kernel-dist-${{ github.run_number }}
- name: Install the extension
run: |
set -eux
python -m pip install "jupyterlab>=4.2.4,<4.3.0" dist/jupyterlite_pyodide_kernel*.whl
- name: Install dependencies
working-directory: ui-tests
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: |
jlpm install
jlpm run build
- name: Install browser
run: jlpm playwright install chromium
working-directory: ui-tests
- name: Execute integration tests
working-directory: ui-tests
run: |
jlpm playwright test --project ${{ matrix.project }}
- name: Upload Playwright Test report
if: always()
uses: actions/upload-artifact@v3
with:
name: jupyterlite-pyodide-kernel-playwright-tests
path: |
ui-tests/test-results
ui-tests/playwright-report