-
Notifications
You must be signed in to change notification settings - Fork 10
281 lines (238 loc) · 8.68 KB
/
ci.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
name: CI
on:
push:
branches:
- master
- develop
pull_request:
branches: '*'
env:
CACHE_EPOCH: 4
jobs:
build:
name: build
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: ['ubuntu']
python-version: ['3.10']
node-version: ['16.x']
lab-version: ['3.3']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Select Node ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Select Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Cache (Python)
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.lab-version }}-pip-build-${{ hashFiles('setup.py', 'setup.cfg') }}
restore-keys: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.lab-version }}-pip-build-
- name: Install Python packaging dependencies
run: pip3 install -U --user pip wheel setuptools
- name: Install Python dev dependencies
run: pip3 install "jupyterlab==${{ matrix.lab-version }}.*"
- name: Validate Python Environment
run: |
set -eux
pip3 freeze | tee .pip-frozen
pip3 check
- name: Cache (JS)
uses: actions/cache@v3
with:
path: '**/node_modules'
key: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-${{ matrix.node-version }}-${{ matrix.lab-version }}-node-build-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-${{ matrix.node-version }}-${{ matrix.lab-version }}-node-build-
- name: Install JS dependencies
run: jlpm --ignore-optional --frozen-lockfile
- name: Build npm tarball
run: |
set -eux
mkdir dist
jlpm build
mv $(npm pack) dist
- name: Build Python distributions
run: python3 setup.py sdist bdist_wheel
- name: Generate distribution hashes
run: |
set -eux
cd dist
sha256sum * | tee SHA256SUMS
- name: Upload distributions
uses: actions/upload-artifact@v3
with:
name: jupyter-videochat ${{ github.run_number }} dist
path: ./dist
- name: Upload labextension
uses: actions/upload-artifact@v3
with:
name: jupyter-videochat ${{ github.run_number }} labextension
path: ./jupyter_videochat/labextension
lint:
needs: [build]
name: lint
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: ['ubuntu']
python-version: ['3.10']
node-version: ['16.x']
lab-version: ['3.3']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Select Node ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Select Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Cache (Python)
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.lab-version }}-pip-lint-${{ hashFiles('setup.cfg') }}
restore-keys: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.lab-version }}-pip-lint-
- name: Install Python packaging dependencies
run: pip3 install -U --user pip wheel setuptools
- name: Install Python dev dependencies
run: pip3 install "jupyterlab==${{ matrix.lab-version }}.*"
- name: Cache (JS)
uses: actions/cache@v3
with:
path: '**/node_modules'
key: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-${{ matrix.node-version }}-${{ matrix.lab-version }}-node-build-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-${{ matrix.node-version }}-${{ matrix.lab-version }}-node-build-
- name: Install JS dependencies
run: jlpm --ignore-optional --frozen-lockfile
- name: Download built labextension
uses: actions/download-artifact@v3
with:
name: jupyter-videochat ${{ github.run_number }} labextension
path: ./jupyter_videochat/labextension
- name: Python Dev Install
run: |
set -eux
pip3 install -e .[lint]
- name: Lint Lab Extension, etc.
run: jlpm run lint:check
- name: Lint Python
run: |-
isort --check setup.py docs jupyter_videochat
black --check setup.py docs jupyter_videochat
test:
needs: [build]
name: test ${{ matrix.os }} py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
strategy:
# fail-fast: false
matrix:
python-version: ['3.7', '3.10']
os: ['ubuntu', 'windows', 'macos']
include:
# use python as marker for node/distribution test coverage
- python-version: '3.7'
artifact-glob: '*.tar.gz'
lab-version: '3.0'
- python-version: '3.10'
artifact-glob: '*.whl'
lab-version: '3.3'
# os-specific settings
- os: windows
python-cmd: python
pip-cache: ~\AppData\Local\pip\Cache
- os: ubuntu
python-cmd: python3
pip-cache: ~/.cache/pip
- os: macos
python-cmd: python3
pip-cache: ~/Library/Caches/pip
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Select Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Cache (Python)
uses: actions/cache@v3
with:
path: ${{ matrix.pip-cache }}
key: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.lab-version }}-pip-test-${{ hashFiles('setup.py', 'setup.cfg') }}
restore-keys: |
${{ env.CACHE_EPOCH }}-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.lab-version }}-pip-test-
- name: Install Python packaging dependencies
run: |
set -eux
pip3 install -U --user pip wheel setuptools
- name: Download distributions
uses: actions/download-artifact@v3
with:
name: jupyter-videochat ${{ github.run_number }} dist
path: ./dist
- name: Install Python distribution
run: |
set -eux
cd dist
pip3 install -v ${{ matrix.artifact-glob }} "jupyterlab==${{ matrix.lab-version }}.*" notebook
- name: Validate Python environment
run: set -eux pip3 freeze | tee .pip-frozen pip3 check
- name: Import smoke test
run: |
set -eux
cd dist
${{ matrix.python-cmd }} -c "import jupyter_videochat; print(jupyter_videochat.__version__)"
- name: Validate Server Extension (server)
run: |
set -eux
jupyter server extension list --debug 1>serverextensions 2>&1
cat serverextensions
cat serverextensions | grep -i "jupyter_videochat.*OK"
- name: Validate Server Extension (notebook)
run: |
set -eux
jupyter serverextension list --debug 1>server_extensions 2>&1
cat server_extensions
cat server_extensions | grep -i "jupyter_videochat.*OK"
- name: Validate Lab Extension
run: |
set -eux
jupyter labextension list --debug 1>labextensions 2>&1
cat labextensions
cat labextensions | grep -i "jupyterlab-videochat.*OK"
- name: Install (docs)
if: matrix.python-version == '3.10' && matrix.os == 'ubuntu'
run: pip install -r docs/requirements.txt
- name: Build (docs)
if: matrix.python-version == '3.10' && matrix.os == 'ubuntu'
env:
DOCS_IN_CI: 1
run: sphinx-build -W -b html docs docs/_build
- name: Check (links)
if: matrix.python-version == '3.10' && matrix.os == 'ubuntu'
run: |
pytest-check-links docs/_build -p no:warnings --links-ext=html --check-anchors --check-links-ignore "^https?://"