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
62on :
73 push :
4+ branches : ["main"]
85 pull_request :
96 schedule :
107 - cron : " 0 8 * * *"
118
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}
1812
1913jobs :
2014 build :
@@ -23,62 +17,56 @@ jobs:
2317 fail-fast : false
2418 matrix :
2519 os : [ubuntu-latest, windows-latest, macos-latest]
26- python-version : ["3.7 ", "3.10 "]
20+ python-version : ["3.8 ", "3.11 "]
2721 include :
2822 - os : windows-latest
2923 python-version : " 3.9"
3024 - os : ubuntu-latest
3125 python-version : " pypy-3.8"
3226 - os : macos-latest
33- python-version : " 3.8 "
27+ python-version : " 3.10 "
3428 steps :
3529 - uses : actions/checkout@v2
3630 - 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
4434 run : |
45- cd $HOME
46- jupyter troubleshoot
35+ pip install codecov coverage[toml]
36+ codecov
4737
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 :
4946 name : Test Minimum Versions
47+ timeout-minutes : 20
5048 runs-on : ubuntu-latest
51- timeout-minutes : 10
5249 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
5652 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
6054 - 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
6257
6358 test_prereleases :
6459 name : Test Prereleases
65- timeout-minutes : 10
6660 runs-on : ubuntu-latest
61+ timeout-minutes : 20
6762 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
7967 - name : Run the tests
8068 run : |
81- pytest -vv || pytest -vv --lf
69+ hatch run test:nowarn || hatch run test:nowarn --lf
8270
8371 make_sdist :
8472 name : Make SDist
@@ -98,22 +86,52 @@ jobs:
9886 - uses : jupyterlab/maintainer-tools/.github/actions/base-setup@v1
9987 - uses : jupyterlab/maintainer-tools/.github/actions/test-sdist@v1
10088
101- pre-commit :
89+ pre_commit :
10290 name : pre-commit
10391 runs-on : ubuntu-latest
10492 steps :
10593 - 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
112105 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