1
- # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3
-
4
- name : Python package
5
-
1
+ name : Tests
6
2
on :
7
3
push :
4
+ branches : ["main"]
8
5
pull_request :
9
6
schedule :
10
7
- cron : " 0 8 * * *"
11
8
12
- concurrency :
13
- group : >-
14
- ${{ github.workflow }}-
15
- ${{ github.ref_type }}-
16
- ${{ github.event.pull_request.number || github.sha }}
17
- cancel-in-progress : true
9
+ defaults :
10
+ run :
11
+ shell : bash -eux {0}
18
12
19
13
jobs :
20
14
build :
@@ -23,62 +17,56 @@ jobs:
23
17
fail-fast : false
24
18
matrix :
25
19
os : [ubuntu-latest, windows-latest, macos-latest]
26
- python-version : ["3.7 ", "3.10 "]
20
+ python-version : ["3.8 ", "3.11 "]
27
21
include :
28
22
- os : windows-latest
29
23
python-version : " 3.9"
30
24
- os : ubuntu-latest
31
25
python-version : " pypy-3.8"
32
26
- os : macos-latest
33
- python-version : " 3.8 "
27
+ python-version : " 3.10 "
34
28
steps :
35
29
- uses : actions/checkout@v2
36
30
- uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
37
- - name : Install dependencies
38
- run : |
39
- pip install -e ".[test]"
40
- - name : Test with pytest
41
- run : |
42
- python -m pytest -vv --timeout 60 --cov jupyter_core --cov-report term-missing:skip-covered
43
- - name : Check CLI
31
+ - name : Run the tests
32
+ run : hatch run cov:test || hatch run test:test --lf
33
+ - name : Coverage
44
34
run : |
45
- cd $HOME
46
- jupyter troubleshoot
35
+ pip install codecov coverage[toml]
36
+ codecov
47
37
48
- test_miniumum_versions :
38
+ test_docs :
39
+ runs-on : ubuntu-latest
40
+ steps :
41
+ - uses : actions/checkout@v3
42
+ - uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
43
+ - run : hatch run docs:build
44
+
45
+ test_minimum_versions :
49
46
name : Test Minimum Versions
47
+ timeout-minutes : 20
50
48
runs-on : ubuntu-latest
51
- timeout-minutes : 10
52
49
steps :
53
- - uses : actions/checkout@v2
54
- - name : Base Setup
55
- uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
50
+ - uses : actions/checkout@v3
51
+ - uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
56
52
with :
57
- python_version : " 3.7"
58
- - name : Install miniumum versions
59
- uses : jupyterlab/maintainer-tools/.github/actions/install-minimums@v1
53
+ dependency_type : minimum
60
54
- name : Run the unit tests
61
- run : pytest -vv -W default || pytest -vv -W default --lf
55
+ run : |
56
+ hatch run test:nowarn || hatch run test:nowarn --lf
62
57
63
58
test_prereleases :
64
59
name : Test Prereleases
65
- timeout-minutes : 10
66
60
runs-on : ubuntu-latest
61
+ timeout-minutes : 20
67
62
steps :
68
- - name : Checkout
69
- uses : actions/checkout@v2
70
- - name : Base Setup
71
- uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
72
- - name : Install the Python dependencies
73
- run : |
74
- pip install --upgrade --upgrade-strategy eager --pre -e ".[test]"
75
- - name : List installed packages
76
- run : |
77
- pip freeze
78
- pip check
63
+ - uses : actions/checkout@v3
64
+ - uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
65
+ with :
66
+ dependency_type : pre
79
67
- name : Run the tests
80
68
run : |
81
- pytest -vv || pytest -vv --lf
69
+ hatch run test:nowarn || hatch run test:nowarn --lf
82
70
83
71
make_sdist :
84
72
name : Make SDist
@@ -98,22 +86,52 @@ jobs:
98
86
- uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
99
87
- uses : jupyterlab/maintainer-tools/.github/actions/test-sdist@v1
100
88
101
- pre-commit :
89
+ pre_commit :
102
90
name : pre-commit
103
91
runs-on : ubuntu-latest
104
92
steps :
105
93
- uses : actions/checkout@v2
106
- - uses : actions/setup-python@v2
107
- -
uses :
pre-commit/[email protected]
108
- with :
109
- extra_args : --all-files --hook-stage=manual
110
- - name : Help message if pre-commit fail
111
- if : ${{ failure() }}
94
+ - uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
95
+ - uses : jupyterlab/maintainer-tools/.github/actions/pre-commit@v1
96
+
97
+ check_release :
98
+ runs-on : ubuntu-latest
99
+ steps :
100
+ - name : Checkout
101
+ uses : actions/checkout@v3
102
+ - name : Base Setup
103
+ uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
104
+ - name : Install Dependencies
112
105
run : |
113
- echo "You can install pre-commit hooks to automatically run formatting"
114
- echo "on each commit with:"
115
- echo " pre-commit install"
116
- echo "or you can run by hand on staged files with"
117
- echo " pre-commit run"
118
- echo "or after-the-fact on already committed files with"
119
- echo " pre-commit run --all-files --hook-stage=manual"
106
+ pip install -e .
107
+ - name : Check Release
108
+ uses : jupyter-server/jupyter_releaser/.github/actions/check-release@v2
109
+ with :
110
+ token : ${{ secrets.GITHUB_TOKEN }}
111
+
112
+ check_links :
113
+ name : Check Links
114
+ runs-on : ubuntu-latest
115
+ timeout-minutes : 15
116
+ steps :
117
+ - uses : actions/checkout@v3
118
+ - uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
119
+ - uses : jupyterlab/maintainer-tools/.github/actions/check-links@v1
120
+
121
+ tests_check : # This job does nothing and is only used for the branch protection
122
+ if : always()
123
+ needs :
124
+ - build
125
+ - pre_commit
126
+ - test_docs
127
+ - test_minimum_versions
128
+ - test_prereleases
129
+ - check_links
130
+ - check_release
131
+ - test_sdist
132
+ runs-on : ubuntu-latest
133
+ steps :
134
+ - name : Decide whether the needed jobs succeeded or failed
135
+ uses : re-actors/alls-green@release/v1
136
+ with :
137
+ jobs : ${{ toJSON(needs) }}
0 commit comments