Split out coverage

This commit is contained in:
Adam Turner 2022-02-05 14:57:09 +00:00
parent 00a0e13292
commit 65ae948eca
3 changed files with 32 additions and 20 deletions

View File

@ -18,13 +18,10 @@ jobs:
docutils: du16
- python: "3.9"
docutils: du17
coverage: "--cov ./ --cov-append --cov-config setup.cfg"
- python: "3.10"
docutils: du18
- python: "3.11-dev"
docutils: py311
env:
PYTEST_ADDOPTS: ${{ matrix.coverage }}
steps:
- uses: actions/checkout@v3
@ -43,12 +40,9 @@ jobs:
- name: Install graphviz
run: sudo apt-get install graphviz
- name: Install dependencies
run: python -m pip install -U pip tox codecov
run: python -m pip install -U pip tox
- name: Run Tox
run: tox -e ${{ matrix.docutils }} -- -vv
- name: codecov
uses: codecov/codecov-action@v1
if: matrix.coverage
windows:
runs-on: windows-2019
@ -62,3 +56,32 @@ jobs:
run: python -m pip install -U pip tox
- name: Run Tox
run: tox -e py -- -vv
coverage:
# only run on pushes to branches in the sphinx-doc/sphinx repo
if: github.repository_owner == 'sphinx-doc' && github.event_name == 'push'
runs-on: ubuntu-latest
env:
PYTEST_ADDOPTS: "--cov ./ --cov-append --cov-config setup.cfg"
steps:
- uses: actions/checkout@v3
- name: Set up Python 3
uses: actions/setup-python@v3
with:
python-version: 3
- name: Check Python version
run: python --version
- name: Install graphviz
run: sudo apt-get install graphviz
- name: Install dependencies
run: python -m pip install -U tox pip codecov pytest-cov
- name: Run Tox
run: tox -e py -- -vv
- name: codecov
uses: codecov/codecov-action@v3

View File

@ -47,8 +47,7 @@ extras_require = {
"types-requests",
],
'test': [
'pytest',
'pytest-cov',
'pytest>=4.6',
'html5lib',
"typed_ast; python_version < '3.8'",
'cython',

12
tox.ini
View File

@ -1,6 +1,6 @@
[tox]
minversion = 2.4.0
envlist = docs,flake8,mypy,twine,coverage,py{36,37,38,39,310},du{14,15,16,17,18}
envlist = docs,flake8,mypy,twine,py{36,37,38,39,310},du{14,15,16,17,18}
[testenv]
usedevelop = True
@ -58,16 +58,6 @@ extras =
commands =
isort --check-only --diff .
[testenv:coverage]
basepython = python3
description =
Run code coverage checks.
setenv =
PYTEST_ADDOPTS = --cov sphinx --cov-config "{toxinidir}/setup.cfg"
commands =
{[testenv]commands}
coverage report
[testenv:mypy]
basepython = python3
description =