@@ -14,6 +14,30 @@ defaults:
1414 shell : bash
1515
1616jobs :
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/action@v2.0.0
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+
1741 build :
1842 runs-on : ${{ matrix.os }}
1943 strategy :
@@ -29,114 +53,114 @@ jobs:
2953 - os : macos-latest
3054 python-version : " 3.8"
3155 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
79103
80104 test_docs :
81105 runs-on : ${{ matrix.os }}
82106 strategy :
83107 fail-fast : false
84108 matrix :
85109 os : [ubuntu-latest]
86- python-version : [ ' 3.9' ]
110+ python-version : [" 3.9" ]
87111 exclude :
88- - os : windows-latest
89- python-version : pypy-3.7
112+ - os : windows-latest
113+ python-version : pypy-3.7
90114 steps :
91- - name : Checkout
92- uses : actions/checkout@v2
115+ - name : Checkout
116+ uses : actions/checkout@v2
93117
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
96120
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"
102126
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
107131
108- - name : Check Docstrings
109- run : |
110- velin . --check --compact
132+ - name : Check Docstrings
133+ run : |
134+ velin . --check --compact
111135
112136 test_without_debugpy :
113- runs-on : ${{ matrix.os }}-latest
137+ runs-on : ${{ matrix.os }}
114138 strategy :
115139 fail-fast : false
116140 matrix :
117- os : [ubuntu]
118- python-version : [ ' 3.9' ]
141+ os : [ubuntu-latest ]
142+ python-version : [" 3.9" ]
119143 steps :
120- - name : Checkout
121- uses : actions/checkout@v2
144+ - name : Checkout
145+ uses : actions/checkout@v2
122146
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
125149
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
130154
131- - name : List installed packages
132- run : |
133- pip freeze
155+ - name : List installed packages
156+ run : |
157+ pip freeze
134158
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
140164
141165 test_miniumum_versions :
142166 name : Test Minimum Versions
@@ -152,7 +176,7 @@ jobs:
152176 uses : jupyterlab/maintainer-tools/.github/actions/install-minimums@v1
153177 - name : Run the unit tests
154178 run : |
155- cmd="python -m pytest -vv -raXxs --durations 10 --color=yes "
179+ cmd="python -m pytest -vv -raXxs"
156180 $cmd || $cmd --lf
157181
158182 test_prereleases :
@@ -173,7 +197,7 @@ jobs:
173197 pip check
174198 - name : Run the tests
175199 run : |
176- cmd="python -m pytest -vv -raXs --durations 10 --color=yes "
200+ cmd="python -m pytest -vv"
177201 $cmd || $cmd --lf
178202
179203 make_sdist :
@@ -214,5 +238,5 @@ jobs:
214238 - name : Run Test
215239 run : |
216240 cd sdist/test
217- cmd="python -m pytest -vv -raXs --durations 10 --color=yes "
241+ cmd="python -m pytest -vv"
218242 $cmd || $cmd --lf
0 commit comments