@@ -2,35 +2,214 @@ name: Build
2
2
3
3
on :
4
4
push :
5
- branches : master
5
+ branches : main
6
6
pull_request :
7
7
branches : ' *'
8
8
9
9
jobs :
10
10
build :
11
11
runs-on : ubuntu-latest
12
+
12
13
steps :
13
14
- name : Checkout
14
- uses : actions/checkout@v2
15
- - name : Install node
16
- uses : actions/setup-node@v1
15
+ uses : actions/checkout@v3
16
+
17
+ - name : Base Setup
18
+ uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
19
+
20
+ - name : Install dependencies
21
+ run : python -m pip install -U "jupyterlab>=4.0.0,<5"
22
+
23
+ - name : Lint the extension
24
+ run : |
25
+ set -eux
26
+ jlpm
27
+ jlpm run lint:check
28
+
29
+ - name : Build the extension
30
+ run : |
31
+ set -eux
32
+ python -m pip install .[test]
33
+
34
+ pytest -vv -r ap --cov jupyter_archive
35
+ jupyter server extension list
36
+ jupyter server extension list 2>&1 | grep -ie "jupyter_archive.*OK"
37
+
38
+ jupyter labextension list
39
+ jupyter labextension list 2>&1 | grep -ie "@hadim/jupyter-archive.*OK"
40
+ python -m jupyterlab.browser_check
41
+
42
+ - name : Package the extension
43
+ run : |
44
+ set -eux
45
+
46
+ pip install build
47
+ python -m build
48
+ pip uninstall -y "jupyter-archive" jupyterlab
49
+
50
+ - name : Upload extension packages
51
+ uses : actions/upload-artifact@v3
17
52
with :
18
- node-version : ' 14.x'
53
+ name : extension-artifacts
54
+ path : dist/jupyter_archive*
55
+ if-no-files-found : error
56
+
57
+ test_isolated :
58
+ needs : build
59
+ runs-on : ubuntu-latest
60
+
61
+ steps :
19
62
- name : Install Python
20
- uses : actions/setup-python@v2
63
+ uses : actions/setup-python@v4
21
64
with :
22
65
python-version : ' 3.9'
23
66
architecture : ' x64'
24
- - name : Install dependencies
25
- run : python -m pip install jupyterlab pytest "pytest-jupyter[server]>=0.6.0"
26
- - name : Build the extension
67
+ - uses : actions/download-artifact@v3
68
+ with :
69
+ name : extension-artifacts
70
+ - name : Install and Test
27
71
run : |
28
- jlpm
29
- jlpm run eslint:check
30
- python -m pip install .
31
- pytest jupyter_archive
72
+ set -eux
73
+ # Remove NodeJS, twice to take care of system and locally installed node versions.
74
+ sudo rm -rf $(which node)
75
+ sudo rm -rf $(which node)
76
+
77
+ pip install "jupyterlab>=4.0.0,<5" jupyter_archive*.whl
78
+
32
79
80
+ jupyter server extension list
33
81
jupyter server extension list 2>&1 | grep -ie "jupyter_archive.*OK"
34
82
83
+ jupyter labextension list
35
84
jupyter labextension list 2>&1 | grep -ie "@hadim/jupyter-archive.*OK"
36
- python -m jupyterlab.browser_check
85
+ python -m jupyterlab.browser_check --no-browser-test
86
+
87
+ integration-tests-lab :
88
+ name : Integration tests for JupyterLab
89
+ strategy :
90
+ fail-fast : false
91
+ matrix :
92
+ jupyterlab : ['3.6', '4.0']
93
+ needs : build
94
+ runs-on : ubuntu-latest
95
+
96
+ env :
97
+ PLAYWRIGHT_BROWSERS_PATH : ${{ github.workspace }}/pw-browsers
98
+
99
+ steps :
100
+ - name : Checkout
101
+ uses : actions/checkout@v3
102
+
103
+ - name : Base Setup
104
+ uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
105
+
106
+ - name : Download extension package
107
+ uses : actions/download-artifact@v3
108
+ with :
109
+ name : extension-artifacts
110
+
111
+ - name : Install the extension
112
+ run : |
113
+ set -eux
114
+ python -m pip install "jupyterlab~=${{ matrix.jupyterlab }}" jupyter_archive*.whl
115
+
116
+ - name : Install dependencies
117
+ working-directory : ui-tests
118
+ env :
119
+ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD : 1
120
+ run : |
121
+ if [[ "${{ matrix.jupyterlab }}" == "3.6" ]]; then
122
+ jlpm add -D "@jupyterlab/galata@^4.0.0"
123
+ fi
124
+ jlpm install
125
+
126
+ - name : Set up browser cache
127
+ uses : actions/cache@v3
128
+ with :
129
+ path : |
130
+ ${{ github.workspace }}/pw-browsers
131
+ key : ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}
132
+
133
+ - name : Install browser
134
+ run : jlpm playwright install chromium
135
+ working-directory : ui-tests
136
+
137
+ - name : Execute integration tests
138
+ working-directory : ui-tests
139
+ run : |
140
+ jlpm playwright test --output test-results-${{ matrix.jupyterlab }}
141
+
142
+ - name : Upload Playwright Test report
143
+ if : always()
144
+ uses : actions/upload-artifact@v3
145
+ with :
146
+ name : jupyter-archive-playwright-tests
147
+ path : |
148
+ ui-tests/test-results*
149
+ ui-tests/playwright-report
150
+
151
+ integration-tests-nb :
152
+ name : Integration tests for Notebook
153
+ needs : build
154
+ runs-on : ubuntu-latest
155
+
156
+ env :
157
+ PLAYWRIGHT_BROWSERS_PATH : ${{ github.workspace }}/pw-browsers
158
+
159
+ steps :
160
+ - name : Checkout
161
+ uses : actions/checkout@v3
162
+
163
+ - name : Base Setup
164
+ uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
165
+
166
+ - name : Download extension package
167
+ uses : actions/download-artifact@v3
168
+ with :
169
+ name : extension-artifacts
170
+
171
+ - name : Install the extension
172
+ run : |
173
+ set -eux
174
+ python -m pip install "notebook~=7.0" jupyter_archive*.whl
175
+
176
+ - name : Install dependencies
177
+ working-directory : ui-tests
178
+ env :
179
+ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD : 1
180
+ run : |
181
+ jlpm install
182
+
183
+ - name : Set up browser cache
184
+ uses : actions/cache@v3
185
+ with :
186
+ path : |
187
+ ${{ github.workspace }}/pw-browsers
188
+ key : ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}
189
+
190
+ - name : Install browser
191
+ run : jlpm playwright install chromium
192
+ working-directory : ui-tests
193
+
194
+ - name : Execute integration tests
195
+ working-directory : ui-tests
196
+ run : |
197
+ jlpm playwright test -c playwright-notebook.config.js
198
+
199
+ - name : Upload Playwright Test report
200
+ if : always()
201
+ uses : actions/upload-artifact@v3
202
+ with :
203
+ name : notebook-tour-playwright-tests
204
+ path : |
205
+ ui-tests/test-results
206
+ ui-tests/playwright-report
207
+
208
+ check_links :
209
+ name : Check Links
210
+ runs-on : ubuntu-latest
211
+ timeout-minutes : 15
212
+ steps :
213
+ - uses : actions/checkout@v3
214
+ - uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
215
+ - uses : jupyterlab/maintainer-tools/.github/actions/check-links@v1
0 commit comments