Skip to content

Commit e5c0a2b

Browse files
authored
More CI updates (#663)
* CI: Make tests of sphinx minver more specific. * Simplify sphinx versions to test only the latest released patch for the v6 and v7 series. * Limit the Python versions to only those that have wheels for the old sphinx versions * Move windows test to a dedicated job. * CI: Add testing job for stable sphinx. * Run numpydoc test suite on all platforms with latest released sphinx * CI: Split coverage into dedicated job. * CI: Only run doc builds and CLI tests on linux. ---------
1 parent 3be1d9a commit e5c0a2b

File tree

1 file changed

+81
-21
lines changed

1 file changed

+81
-21
lines changed

.github/workflows/test.yml

Lines changed: 81 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,13 @@ on:
1111
branches: [main]
1212

1313
jobs:
14-
test:
14+
test-oldsphinx:
1515
runs-on: ${{ matrix.os }}-latest
1616
strategy:
1717
matrix:
1818
os: [Ubuntu]
19-
python-version: ["3.10", "3.11", "3.12", "3.13"]
20-
sphinx-version:
21-
["sphinx==6.0", "sphinx==6.2", "sphinx==7.0", "sphinx>=7.3"]
22-
include:
23-
- os: Windows
24-
python-version: "3.12"
25-
sphinx-version: "sphinx" # version shouldn't really matter here
19+
python-version: ["3.10", "3.11"]
20+
sphinx-version: ["sphinx<7", "sphinx<8"]
2621
defaults:
2722
run:
2823
shell: bash -eo pipefail {0}
@@ -37,7 +32,6 @@ jobs:
3732
- name: Setup environment
3833
run: |
3934
python -m pip install --upgrade pip wheel setuptools
40-
python -m pip install codecov
4135
python -m pip install "${{ matrix.sphinx-version }}"
4236
python -m pip list
4337
@@ -50,10 +44,6 @@ jobs:
5044
run: |
5145
pytest -v --pyargs .
5246
53-
- name: Test coverage
54-
run: |
55-
codecov
56-
5747
- name: Make sure CLI works
5848
run: |
5949
numpydoc render numpydoc.tests.test_main._capture_stdout
@@ -65,22 +55,68 @@ jobs:
6555
run: |
6656
sudo apt-get update
6757
sudo apt install texlive texlive-latex-extra latexmk dvipng
68-
if: runner.os == 'Linux'
6958
7059
- name: Build documentation
7160
run: |
7261
make -C doc html SPHINXOPTS="-nT"
7362
make -C doc latexpdf SPHINXOPTS="-nT"
63+
64+
test:
65+
runs-on: ${{ matrix.os }}-latest
66+
strategy:
67+
matrix:
68+
os: ["ubuntu", "macos", "windows"]
69+
python-version: ["3.12", "3.13", "3.14"]
70+
steps:
71+
- uses: actions/checkout@v5
72+
73+
- name: Python setup
74+
uses: actions/setup-python@v6
75+
with:
76+
python-version: ${{ matrix.python-version }}
77+
78+
- name: Setup environment
79+
run: |
80+
python -m pip install --upgrade pip wheel setuptools
81+
python -m pip list
82+
83+
- name: Install
84+
run: |
85+
python -m pip install . --group test --group doc
86+
pip list
87+
88+
- name: Run test suite
89+
run: |
90+
pytest -v --pyargs numpydoc
91+
92+
- name: Make sure CLI works
7493
if: runner.os == 'Linux'
94+
run: |
95+
numpydoc render numpydoc.tests.test_main._capture_stdout
96+
echo '! numpydoc render numpydoc.tests.test_main._invalid_docstring' | bash
97+
numpydoc validate numpydoc.tests.test_main._capture_stdout
98+
echo '! numpydoc validate numpydoc.tests.test_main._docstring_with_errors' | bash
99+
100+
- name: Setup for doc build
101+
if: runner.os == 'Linux'
102+
run: |
103+
sudo apt update
104+
sudo apt install -y texlive texlive-latex-extra latexmk dvipng
105+
106+
- name: Build documentation
107+
if: runner.os == 'Linux'
108+
run: |
109+
make -C doc html SPHINXOPTS="-nT"
110+
make -C doc latexpdf SPHINXOPTS="-nT"
75111
76112
prerelease:
77113
runs-on: ${{ matrix.os }}-latest
78114
strategy:
79115
matrix:
80116
os: [ubuntu]
81-
python-version: ["3.11", "3.12", "3.13", "3.14"]
117+
python-version: ["3.12", "3.13", "3.14"]
82118
steps:
83-
- uses: actions/checkout@v6
119+
- uses: actions/checkout@v5
84120

85121
- name: Python setup
86122
uses: actions/setup-python@v6
@@ -90,7 +126,6 @@ jobs:
90126
- name: Setup environment
91127
run: |
92128
python -m pip install --upgrade pip wheel setuptools
93-
python -m pip install codecov
94129
python -m pip list
95130
96131
- name: Install
@@ -102,10 +137,6 @@ jobs:
102137
run: |
103138
pytest -v --pyargs .
104139
105-
- name: Test coverage
106-
run: |
107-
codecov
108-
109140
- name: Make sure CLI works
110141
run: |
111142
numpydoc render numpydoc.tests.test_main._capture_stdout
@@ -122,3 +153,32 @@ jobs:
122153
run: |
123154
make -C doc html SPHINXOPTS="-nT"
124155
make -C doc latexpdf SPHINXOPTS="-nT"
156+
157+
coverage:
158+
runs-on: ubuntu-latest
159+
steps:
160+
- uses: actions/checkout@v6
161+
162+
- name: Python setup
163+
uses: actions/setup-python@v6
164+
with:
165+
python-version: "3.13"
166+
167+
- name: Setup environment
168+
run: |
169+
python -m pip install --upgrade pip wheel setuptools
170+
python -m pip install codecov
171+
python -m pip list
172+
173+
- name: Install
174+
run: |
175+
python -m pip install --pre . --group test --group doc
176+
pip list
177+
178+
- name: Run test suite
179+
run: |
180+
pytest -v --pyargs numpydoc
181+
182+
- name: Test coverage
183+
run: |
184+
codecov

0 commit comments

Comments
 (0)