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