7
7
schedule :
8
8
- cron : " 0 8 * * *"
9
9
10
+ defaults :
11
+ run :
12
+ shell : bash -eux {0}
13
+
10
14
jobs :
11
15
test :
12
16
name : ${{ matrix.os }} ${{ matrix.python-version }}
24
28
python-version : " 3.9"
25
29
- os : ubuntu-latest
26
30
python-version : " pypy-3.7"
31
+ - os : ubuntu-latest
32
+ python-version : " 3.11-dev"
27
33
- os : macos-latest
28
34
python-version : " 3.8"
29
35
steps :
@@ -37,59 +43,31 @@ jobs:
37
43
- name : Run the tests
38
44
if : ${{ !startsWith(matrix.python-version, 'pypy') && !startsWith(matrix.os, 'windows') }}
39
45
run : |
40
- args="-vv -raXs --cov jupyterlab_server --cov-branch --cov-report term-missing:skip-covered --durations 10 --color=yes --cov-fail-under 65"
41
- python -m pytest $args || python -m pytest $args --lf
46
+ hatch run cov:test || hatch run test:test --lf
42
47
- name : Run the tests on pypy and windows
43
48
if : ${{ startsWith(matrix.python-version, 'pypy') || startsWith(matrix.os, 'windows') }}
44
49
run : |
45
- python -m pytest -vv -raXs || python -m pytest -vv -raXs --lf
50
+ hatch run test:test || hatch run test:test --lf
46
51
- name : Upload coverage
47
52
run : |
53
+ pip install codecov
48
54
codecov
49
55
50
- pre-commit :
51
- name : Run pre-commit hook
56
+ pre_commit :
52
57
runs-on : ubuntu-latest
53
58
timeout-minutes : 5
54
59
steps :
55
60
- name : Checkout
56
61
uses : actions/checkout@v3
57
62
- uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
58
- - name : Run pre-commit
59
- uses :
pre-commit/[email protected]
60
- - name : Help message if pre-commit fail
61
- if : ${{ failure() }}
62
- run : |
63
- echo "You can install pre-commit hooks to automatically run formatting"
64
- echo "on each commit with:"
65
- echo " pre-commit install"
66
- echo "or you can run by hand on staged files with"
67
- echo " pre-commit run"
68
- echo "or after-the-fact on already committed files with"
69
- echo " pre-commit run --all-files --hook-stage=manual"
63
+ - uses : jupyterlab/maintainer-tools/.github/actions/pre-commit@v1
70
64
71
65
docs :
72
- name : Docs Build
73
66
runs-on : ubuntu-latest
74
67
steps :
75
- - name : Checkout
76
- uses : actions/checkout@v3
77
- - name : Base Setup
78
- uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
79
- - uses : conda-incubator/setup-miniconda@v2
80
- with :
81
- auto-update-conda : true
82
- activate-environment : jupyterlab_server_documentation
83
- environment-file : docs/environment.yml
84
- - name : Install lib
85
- shell : bash -l {0}
86
- run : |
87
- pip install .
88
- - name : Build docs
89
- shell : bash -l {0}
90
- run : |
91
- pushd docs
92
- make html SPHINXOPTS="-W"
68
+ - uses : actions/checkout@v3
69
+ - uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
70
+ - run : hatch run docs:build
93
71
94
72
check_release :
95
73
runs-on : ubuntu-latest
119
97
- name : Install miniumum versions
120
98
uses : jupyterlab/maintainer-tools/.github/actions/install-minimums@v1
121
99
- name : Run the unit tests
122
- run : python -m pytest -vv -raXs - W default || python -m pytest -vv -raXs -W default --lf
100
+ run : pytest -vv -W default || pytest -vv -W default --lf
123
101
124
102
test_prereleases :
125
103
name : Test Prereleases
@@ -138,47 +116,29 @@ jobs:
138
116
pip freeze
139
117
pip check
140
118
- name : Run the tests
141
- run : python -m pytest -vv -raXs - W default || python -m pytest -vv -raXs -W default --lf
119
+ run : pytest -W default || pytest -W default --lf
142
120
143
121
make_sdist :
144
122
name : Make SDist
145
123
runs-on : ubuntu-latest
146
- timeout-minutes : 20
124
+ timeout-minutes : 10
147
125
steps :
148
- - uses : actions/checkout@v3
149
- - name : Base Setup
150
- uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
151
- - name : Build SDist
152
- run : |
153
- pip install build
154
- python -m build --sdist
155
- - uses : actions/upload-artifact@v3
156
- with :
157
- name : " sdist"
158
- path : dist/*.tar.gz
126
+ - uses : actions/checkout@v2
127
+ - uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
128
+ - uses : jupyterlab/maintainer-tools/.github/actions/make-sdist@v1
159
129
160
130
test_sdist :
161
131
runs-on : ubuntu-latest
162
132
needs : [make_sdist]
163
133
name : Install from SDist and Test
164
134
timeout-minutes : 20
165
135
steps :
166
- - name : Base Setup
167
- uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
168
- - name : Download sdist
169
- uses : actions/download-artifact@v3
170
- - name : Install From SDist
171
- run : |
172
- set -ex
173
- cd sdist
174
- mkdir test
175
- tar --strip-components=1 -zxvf *.tar.gz -C ./test
176
- cd test
177
- pip install .[test]
178
- - name : Run Test
179
- run : |
180
- cd sdist/test
181
- python -m pytest -vv -raXs || python -m pytest -vv -raXs --lf
136
+ - uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
137
+ - uses : jupyterlab/maintainer-tools/.github/actions/test-sdist@v1
138
+ with :
139
+ package_spec : .
140
+ test_command : hatch run test:test || hatch run test:test --lf
141
+ - run :
182
142
# Ensure that the pytest plugin is importable.
183
143
python -c "from jupyterlab_server import pytest_plugin"
184
144
@@ -189,3 +149,21 @@ jobs:
189
149
- uses : actions/checkout@v3
190
150
- uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
191
151
- uses : jupyterlab/maintainer-tools/.github/actions/check-links@v1
152
+
153
+ tests_check : # This job does nothing and is only used for the branch protection
154
+ if : always()
155
+ needs :
156
+ - test
157
+ - pre_commit
158
+ - check_links
159
+ - docs
160
+ - check_release
161
+ - test_miniumum_verisons
162
+ - test_prereleases
163
+ - test_sdist
164
+ runs-on : ubuntu-latest
165
+ steps :
166
+ - name : Decide whether the needed jobs succeeded or failed
167
+ uses : re-actors/alls-green@release/v1
168
+ with :
169
+ jobs : ${{ toJSON(needs) }}
0 commit comments