Skip to content

Commit dc36ddc

Browse files
committed
fix tests and rework test workflow
1 parent 71531bb commit dc36ddc

File tree

2 files changed

+120
-47
lines changed

2 files changed

+120
-47
lines changed

.github/workflows/build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Tests
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
python-version:
10+
required: true
11+
type: string
12+
extra-requirements:
13+
required: false
14+
type: string
15+
16+
jobs:
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Set up Python ${{ inputs.python-version }}
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: ${{ inputs.python-version }}
27+
- name: Display Python version
28+
run: python -c "import sys; print(sys.version)"
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install pytest pytest-cov codecov beautifulsoup4 ${{ inputs.extra-requirements }} -e .
33+
- name: Test with pytest
34+
run: |
35+
pytest --cov=autodocsumm --cov-report=xml tests
36+
- name: Upload codecov
37+
env:
38+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
39+
run: |
40+
codecov

.github/workflows/python-app.yml

Lines changed: 80 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -8,62 +8,95 @@ on:
88
pull_request:
99

1010
jobs:
11-
build:
1211

13-
runs-on: ubuntu-latest
12+
build-sphinx-80plus:
13+
name: Build
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: [ "3.10", "3.11", "3.12" ]
18+
sphinx-version: [
19+
"8.0.*", "8.*" # 8.0.x and latest
20+
]
21+
uses: ./.github/workflows/build.yml
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
extra-requirements: '\
25+
"sphinx==${{ matrix.sphinx-version }}"'
26+
27+
28+
build-legacy-sphinx-45plus:
29+
name: Build
1430

1531
strategy:
32+
fail-fast: false
1633
matrix:
17-
python-version: ["3.8", "3.9"]
34+
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
1835
sphinx-version: [
19-
"7.0.*", "7.1.*", "7.2.*",
36+
"7.0.*", "7.1.*", "7.2.*",
2037
"6.0.*",
2138
"5.0.*",
22-
"4.5", "4.4", "4.3", "4.2", "4.1", "4.0.*",
23-
"3.5.*", "3.4.*", "3.2.*", "3.1.*", "3.0.*",
39+
"4.5.*"
2440
]
25-
include:
26-
- python-version: "3.7"
27-
sphinx-version: ""
28-
- python-version: "3.7"
29-
sphinx-version: "3.5"
30-
- python-version: "3.10"
31-
sphinx-version: ""
32-
- python-version: "3.10"
33-
sphinx-version: "4.5"
34-
- python-version: "3.11"
35-
sphinx-version: ""
36-
- python-version: "3.11"
37-
sphinx-version: "4.5"
3841
exclude:
3942
- python-version: "3.8"
4043
sphinx-version: "7.2.*"
44+
uses: ./.github/workflows/build.yml
45+
with:
46+
python-version: ${{ matrix.python-version }}
47+
extra-requirements: '\
48+
"sphinx==${{ matrix.sphinx-version }}"
49+
"sphinxcontrib-applehelp<1.0.8"
50+
"sphinxcontrib-devhelp<1.0.6"
51+
"sphinxcontrib-htmlhelp<2.0.5"
52+
"sphinxcontrib-jsmath<1.0.1"
53+
"sphinxcontrib-qthelp<1.0.7"
54+
"sphinxcontrib-serializinghtml<1.1.10"'
55+
56+
57+
build-legacy-sphinx-40plus:
58+
name: Build
4159

42-
steps:
43-
- uses: actions/checkout@v2
44-
- name: Set up Python ${{ matrix.python-version }}
45-
uses: actions/setup-python@v2
46-
with:
47-
python-version: ${{ matrix.python-version }}
48-
- name: Display Python version
49-
run: python -c "import sys; print(sys.version)"
50-
- name: Install dependencies
51-
env:
52-
SPHINX_VERSION: ${{ matrix.sphinx-version }}
53-
run: |
54-
python -m pip install --upgrade pip
55-
SPHINX=Sphinx
56-
JINJA2=jinja2
57-
if [[ $SPHINX_VERSION != "" ]]; then
58-
SPHINX="${SPHINX}==${SPHINX_VERSION}";
59-
JINJA2="${JINJA2}<3.1";
60-
fi
61-
pip install pytest pytest-cov codecov "${SPHINX}" "${JINJA2}" beautifulsoup4 -e .
62-
- name: Test with pytest
63-
run: |
64-
pytest --cov=autodocsumm --cov-report=xml tests
65-
- name: Upload codecov
66-
env:
67-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
68-
run: |
69-
codecov
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
python-version: [ "3.8", "3.9" ]
64+
sphinx-version: [
65+
"4.4.*", "4.3.*", "4.2.*", "4.1.*", "4.0.*"
66+
]
67+
uses: ./.github/workflows/build.yml
68+
with:
69+
python-version: ${{ matrix.python-version }}
70+
extra-requirements: '\
71+
"sphinx==${{ matrix.sphinx-version }}"
72+
"sphinxcontrib-applehelp<1.0.8"
73+
"sphinxcontrib-devhelp<1.0.6"
74+
"sphinxcontrib-htmlhelp<2.0.5"
75+
"sphinxcontrib-jsmath<1.0.1"
76+
"sphinxcontrib-qthelp<1.0.7"
77+
"sphinxcontrib-serializinghtml<1.1.10"'
78+
79+
80+
build-legacy-sphinx-30plus:
81+
name: Build
82+
83+
strategy:
84+
fail-fast: false
85+
matrix:
86+
python-version: [ "3.7", "3.8", "3.9" ]
87+
sphinx-version: [
88+
"3.5.*", "3.4.*", "3.2.*", "3.1.*", "3.0.*",
89+
]
90+
uses: ./.github/workflows/build.yml
91+
with:
92+
python-version: ${{ matrix.python-version }}
93+
extra-requirements: '\
94+
"sphinx==${{ matrix.sphinx-version }}"
95+
"jinja2<3.1"
96+
"alabaster<0.7.14"
97+
"sphinxcontrib-applehelp<1.0.8"
98+
"sphinxcontrib-devhelp<1.0.6"
99+
"sphinxcontrib-htmlhelp<2.0.5"
100+
"sphinxcontrib-jsmath<1.0.1"
101+
"sphinxcontrib-qthelp<1.0.7"
102+
"sphinxcontrib-serializinghtml<1.1.10"'

0 commit comments

Comments
 (0)