@@ -14,6 +14,30 @@ defaults:
14
14
shell : bash
15
15
16
16
jobs :
17
+ # Run "pre-commit run --all-files"
18
+ pre-commit :
19
+ runs-on : ubuntu-20.04
20
+ timeout-minutes : 2
21
+
22
+ steps :
23
+ - uses : actions/checkout@v2
24
+ - uses : actions/setup-python@v2
25
+ with :
26
+ python-version : 3.8
27
+
28
+ # ref: https://github.com/pre-commit/action
29
+ -
uses :
pre-commit/[email protected]
30
+ - name : Help message if pre-commit fail
31
+ if : ${{ failure() }}
32
+ run : |
33
+ echo "You can install pre-commit hooks to automatically run formatting"
34
+ echo "on each commit with:"
35
+ echo " pre-commit install"
36
+ echo "or you can run by hand on staged files with"
37
+ echo " pre-commit run"
38
+ echo "or after-the-fact on already committed files with"
39
+ echo " pre-commit run --all-files"
40
+
17
41
build :
18
42
runs-on : ${{ matrix.os }}
19
43
strategy :
@@ -29,114 +53,114 @@ jobs:
29
53
- os : macos-latest
30
54
python-version : " 3.8"
31
55
steps :
32
- - name : Checkout
33
- uses : actions/checkout@v2
34
-
35
- - name : Base Setup
36
- uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
37
-
38
- - name : Install the Python dependencies
39
- run : |
40
- pip install .[test] codecov
41
-
42
- - name : Install matplotlib
43
- if : ${{ !startsWith(matrix.os, 'macos') && !startsWith(matrix.python-version, 'pypy') }}
44
- run : |
45
- pip install matplotlib || echo 'failed to install matplotlib'
46
-
47
- - name : Install alternate event loops
48
- if : ${{ !startsWith(matrix.os, 'windows') }}
49
- run : |
50
- pip install curio || echo 'ignoring curio install failure'
51
- pip install trio || echo 'ignoring trio install failure'
52
-
53
- - name : List installed packages
54
- run : |
55
- pip uninstall pipx -y
56
- pip install pipdeptree
57
- pipdeptree
58
- pipdeptree --reverse
59
- pip freeze
60
- pip check
61
-
62
- - name : Run the tests
63
- timeout-minutes : 15
64
- if : ${{ !startsWith( matrix.python-version, 'pypy' ) && !startsWith(matrix.os, 'windows') }}
65
- run : |
66
- cmd="python -m pytest -vv -raXs -- cov ipykernel --cov-branch --cov-report term-missing:skip-covered --durations 10 --color=yes "
67
- $cmd || $cmd --lf
68
-
69
- - name : Run the tests on pypy and windows
70
- timeout-minutes : 15
71
- if : ${{ startsWith( matrix.python-version, 'pypy' ) || startsWith(matrix.os, 'windows') }}
72
- run : |
73
- cmd="python -m pytest -vv -raXs --durations 10 --color=yes "
74
- $cmd || $cmd --lf
75
-
76
- - name : Coverage
77
- run : |
78
- codecov
56
+ - name : Checkout
57
+ uses : actions/checkout@v2
58
+
59
+ - name : Base Setup
60
+ uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
61
+
62
+ - name : Install the Python dependencies
63
+ run : |
64
+ pip install .[test] codecov
65
+
66
+ - name : Install matplotlib
67
+ if : ${{ !startsWith(matrix.os, 'macos') && !startsWith(matrix.python-version, 'pypy') }}
68
+ run : |
69
+ pip install matplotlib || echo 'failed to install matplotlib'
70
+
71
+ - name : Install alternate event loops
72
+ if : ${{ !startsWith(matrix.os, 'windows') }}
73
+ run : |
74
+ pip install curio || echo 'ignoring curio install failure'
75
+ pip install trio || echo 'ignoring trio install failure'
76
+
77
+ - name : List installed packages
78
+ run : |
79
+ pip uninstall pipx -y
80
+ pip install pipdeptree
81
+ pipdeptree
82
+ pipdeptree --reverse
83
+ pip freeze
84
+ pip check
85
+
86
+ - name : Run the tests
87
+ timeout-minutes : 15
88
+ if : ${{ !startsWith( matrix.python-version, 'pypy' ) && !startsWith(matrix.os, 'windows') }}
89
+ run : |
90
+ cmd="python -m pytest -vv -- cov ipykernel --cov-branch --cov-report term-missing:skip-covered"
91
+ $cmd || $cmd --lf
92
+
93
+ - name : Run the tests on pypy and windows
94
+ timeout-minutes : 15
95
+ if : ${{ startsWith( matrix.python-version, 'pypy' ) || startsWith(matrix.os, 'windows') }}
96
+ run : |
97
+ cmd="python -m pytest -vv"
98
+ $cmd || $cmd --lf
99
+
100
+ - name : Coverage
101
+ run : |
102
+ codecov
79
103
80
104
test_docs :
81
105
runs-on : ${{ matrix.os }}
82
106
strategy :
83
107
fail-fast : false
84
108
matrix :
85
109
os : [ubuntu-latest]
86
- python-version : [ ' 3.9' ]
110
+ python-version : [" 3.9" ]
87
111
exclude :
88
- - os : windows-latest
89
- python-version : pypy-3.7
112
+ - os : windows-latest
113
+ python-version : pypy-3.7
90
114
steps :
91
- - name : Checkout
92
- uses : actions/checkout@v2
115
+ - name : Checkout
116
+ uses : actions/checkout@v2
93
117
94
- - name : Base Setup
95
- uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
118
+ - name : Base Setup
119
+ uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
96
120
97
- - name : Build the docs
98
- run : |
99
- cd docs
100
- pip install -r requirements.txt
101
- make html SPHINXOPTS="-W"
121
+ - name : Build the docs
122
+ run : |
123
+ cd docs
124
+ pip install -r requirements.txt
125
+ make html SPHINXOPTS="-W"
102
126
103
- - name : Install the Python dependencies
104
- run : |
105
- pip install .
106
- pip install velin
127
+ - name : Install the Python dependencies
128
+ run : |
129
+ pip install .
130
+ pip install velin
107
131
108
- - name : Check Docstrings
109
- run : |
110
- velin . --check --compact
132
+ - name : Check Docstrings
133
+ run : |
134
+ velin . --check --compact
111
135
112
136
test_without_debugpy :
113
- runs-on : ${{ matrix.os }}-latest
137
+ runs-on : ${{ matrix.os }}
114
138
strategy :
115
139
fail-fast : false
116
140
matrix :
117
- os : [ubuntu]
118
- python-version : [ ' 3.9' ]
141
+ os : [ubuntu-latest ]
142
+ python-version : [" 3.9" ]
119
143
steps :
120
- - name : Checkout
121
- uses : actions/checkout@v2
144
+ - name : Checkout
145
+ uses : actions/checkout@v2
122
146
123
- - name : Base Setup
124
- uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
147
+ - name : Base Setup
148
+ uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
125
149
126
- - name : Install the Python dependencies without debugpy
127
- run : |
128
- pip install .[test]
129
- pip uninstall --yes debugpy
150
+ - name : Install the Python dependencies without debugpy
151
+ run : |
152
+ pip install .[test]
153
+ pip uninstall --yes debugpy
130
154
131
- - name : List installed packages
132
- run : |
133
- pip freeze
155
+ - name : List installed packages
156
+ run : |
157
+ pip freeze
134
158
135
- - name : Run the tests
136
- timeout-minutes : 10
137
- run : |
138
- cmd="python -m pytest -vv -raXxs --durations 10 --color=yes "
139
- $cmd || $cmd --lf
159
+ - name : Run the tests
160
+ timeout-minutes : 10
161
+ run : |
162
+ cmd="python -m pytest -vv -raXxs"
163
+ $cmd || $cmd --lf
140
164
141
165
test_miniumum_versions :
142
166
name : Test Minimum Versions
@@ -152,7 +176,7 @@ jobs:
152
176
uses : jupyterlab/maintainer-tools/.github/actions/install-minimums@v1
153
177
- name : Run the unit tests
154
178
run : |
155
- cmd="python -m pytest -vv -raXxs --durations 10 --color=yes "
179
+ cmd="python -m pytest -vv -raXxs"
156
180
$cmd || $cmd --lf
157
181
158
182
test_prereleases :
@@ -173,7 +197,7 @@ jobs:
173
197
pip check
174
198
- name : Run the tests
175
199
run : |
176
- cmd="python -m pytest -vv -raXs --durations 10 --color=yes "
200
+ cmd="python -m pytest -vv"
177
201
$cmd || $cmd --lf
178
202
179
203
make_sdist :
@@ -214,5 +238,5 @@ jobs:
214
238
- name : Run Test
215
239
run : |
216
240
cd sdist/test
217
- cmd="python -m pytest -vv -raXs --durations 10 --color=yes "
241
+ cmd="python -m pytest -vv"
218
242
$cmd || $cmd --lf
0 commit comments