@@ -2,103 +2,159 @@ name: Build
2
2
3
3
on :
4
4
push :
5
- branches : [" main"]
5
+ branches : main
6
6
pull_request :
7
- schedule :
8
- - cron : " 0 0 * * *"
7
+ branches : ' *'
9
8
10
- defaults :
11
- run :
12
- shell : bash -eux {0}
9
+ concurrency :
10
+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11
+ cancel-in-progress : true
13
12
14
13
jobs :
15
14
build :
16
15
runs-on : ubuntu-latest
17
- strategy :
18
- fail-fast : false
19
- matrix :
20
- os : [ubuntu-latest, macos-latest, windows-latest]
21
- python-version : ["3.8", "3.12"]
22
16
23
17
steps :
24
- - name : Checkout
25
- uses : actions/checkout@v4
18
+ - name : Checkout
19
+ uses : actions/checkout@v4
26
20
27
- - name : Base Setup
28
- uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
21
+ - name : Base Setup
22
+ uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
29
23
30
- - name : Install dependencies
31
- run : python -m pip install -U jupyter_server
24
+ - name : Install dependencies
25
+ run : python -m pip install -U "jupyterlab>=4.0.0,<5"
32
26
33
- - name : Build the extension
34
- run : |
35
- python -m pip install .
36
- jupyter server extension list 2>&1 | grep -ie "jupyter_server_nbmodel.*OK"
27
+ - name : Lint the extension
28
+ run : |
29
+ set -eux
30
+ jlpm
31
+ jlpm run lint:check
37
32
38
- pip install build
39
- python -m build --sdist
40
- cp dist/*.tar.gz my_server_extension.tar.gz
41
- pip uninstall -y "jupyter_server_nbmodel" jupyter_server
42
- rm -rf "jupyter_server_nbmodel"
33
+ - name : Test the extension
34
+ run : |
35
+ set -eux
36
+ jlpm run test
43
37
44
- - uses : actions/upload-artifact@v4
45
- if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
46
- with :
47
- name : my_server_extension-sdist
48
- path : my_server_extension.tar.gz
38
+ - name : Build the extension
39
+ run : |
40
+ set -eux
41
+ python -m pip install .[test]
49
42
50
- check_links :
43
+ pytest -vv -r ap --cov jupyter_server_nbmodel
44
+ jupyter server extension list
45
+ jupyter server extension list 2>&1 | grep -ie "jupyter_server_nbmodel.*OK"
46
+
47
+ jupyter labextension list
48
+ jupyter labextension list 2>&1 | grep -ie "jupyter-server-nbmodel.*OK"
49
+ python -m jupyterlab.browser_check
50
+
51
+ - name : Package the extension
52
+ run : |
53
+ set -eux
54
+
55
+ pip install build
56
+ python -m build
57
+ pip uninstall -y "jupyter_server_nbmodel" jupyterlab
58
+
59
+ - name : Upload extension packages
60
+ uses : actions/upload-artifact@v4
61
+ with :
62
+ name : extension-artifacts
63
+ path : dist/jupyter_server_nbmodel*
64
+ if-no-files-found : error
65
+
66
+ test_isolated :
67
+ needs : build
51
68
runs-on : ubuntu-latest
69
+
52
70
steps :
53
- - uses : actions/checkout@v4
54
- - uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
55
- - uses : jupyterlab/maintainer-tools/.github/actions/check-links@v1
71
+ - name : Install Python
72
+ uses : actions/setup-python@v5
73
+ with :
74
+ python-version : ' 3.9'
75
+ architecture : ' x64'
76
+ - uses : actions/download-artifact@v4
77
+ with :
78
+ name : extension-artifacts
79
+ - name : Install and Test
80
+ run : |
81
+ set -eux
82
+ # Remove NodeJS, twice to take care of system and locally installed node versions.
83
+ sudo rm -rf $(which node)
84
+ sudo rm -rf $(which node)
85
+
86
+ pip install "jupyterlab>=4.0.0,<5" jupyter_server_nbmodel*.whl
87
+
88
+
89
+ jupyter server extension list
90
+ jupyter server extension list 2>&1 | grep -ie "jupyter_server_nbmodel.*OK"
56
91
57
- test_lint :
92
+ jupyter labextension list
93
+ jupyter labextension list 2>&1 | grep -ie "jupyter-server-nbmodel.*OK"
94
+ python -m jupyterlab.browser_check --no-browser-test
95
+
96
+ integration-tests :
97
+ name : Integration tests
98
+ needs : build
58
99
runs-on : ubuntu-latest
100
+
101
+ env :
102
+ PLAYWRIGHT_BROWSERS_PATH : ${{ github.workspace }}/pw-browsers
103
+
59
104
steps :
60
- - uses : actions/checkout@v4
61
- - uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
62
- - name : Run Linters
63
- run : |
64
- bash ./.github/workflows/lint.sh
105
+ - name : Checkout
106
+ uses : actions/checkout@v4
107
+
108
+ - name : Base Setup
109
+ uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
110
+
111
+ - name : Download extension package
112
+ uses : actions/download-artifact@v4
113
+ with :
114
+ name : extension-artifacts
115
+
116
+ - name : Install the extension
117
+ run : |
118
+ set -eux
119
+ python -m pip install "jupyterlab>=4.0.0,<5" jupyter_server_nbmodel*.whl
120
+
121
+ - name : Install dependencies
122
+ working-directory : ui-tests
123
+ env :
124
+ YARN_ENABLE_IMMUTABLE_INSTALLS : 0
125
+ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD : 1
126
+ run : jlpm install
127
+
128
+ - name : Set up browser cache
129
+ uses : actions/cache@v4
130
+ with :
131
+ path : |
132
+ ${{ github.workspace }}/pw-browsers
133
+ key : ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}
134
+
135
+ - name : Install browser
136
+ run : jlpm playwright install chromium
137
+ working-directory : ui-tests
138
+
139
+ - name : Execute integration tests
140
+ working-directory : ui-tests
141
+ run : |
142
+ jlpm playwright test
65
143
66
- check_release :
144
+ - name : Upload Playwright Test report
145
+ if : always()
146
+ uses : actions/upload-artifact@v4
147
+ with :
148
+ name : jupyter_server_nbmodel-playwright-tests
149
+ path : |
150
+ ui-tests/test-results
151
+ ui-tests/playwright-report
152
+
153
+ check_links :
154
+ name : Check Links
67
155
runs-on : ubuntu-latest
156
+ timeout-minutes : 15
68
157
steps :
69
158
- uses : actions/checkout@v4
70
- - name : Base Setup
71
- uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
72
- - name : Install Dependencies
73
- run : |
74
- pip install -e .
75
- - name : Check Release
76
- uses : jupyter-server/jupyter_releaser/.github/actions/check-release@v2
77
- with :
78
- token : ${{ secrets.GITHUB_TOKEN }}
79
- - name : Upload Distributions
80
- uses : actions/upload-artifact@v4
81
- with :
82
- name : jupyter_server_nbmodel-releaser-dist-${{ github.run_number }}
83
- path : .jupyter_releaser_checkout/dist
84
-
85
- test_sdist :
86
- needs : build
87
- runs-on : ubuntu-latest
88
-
89
- steps :
90
- - name : Checkout
91
- uses : actions/checkout@v4
92
- - name : Install Python
93
- uses : actions/setup-python@v5
94
- with :
95
- python-version : " 3.8"
96
- architecture : " x64"
97
- - uses : actions/download-artifact@v4
98
- with :
99
- name : my_server_extension-sdist
100
- - name : Install and Test
101
- run : |
102
- pip install my_server_extension.tar.gz
103
- pip install jupyter_server
104
- jupyter server extension list 2>&1 | grep -ie "jupyter_server_nbmodel.*OK"
159
+ - uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
160
+ - uses : jupyterlab/maintainer-tools/.github/actions/check-links@v1
0 commit comments