Add coverge reporting in CI and upload to codecov

This commit is contained in:
Tomasz Hemperek
2020-12-03 15:37:10 +01:00
committed by Alex Forencich
parent ece1bd430d
commit 435b9c9282
3 changed files with 27 additions and 1 deletions

View File

@@ -30,3 +30,8 @@ jobs:
- name: Test with tox - name: Test with tox
run: tox run: tox
- name: Upload coverage to codecov
run: |
pip install codecov
codecov

1
.gitignore vendored
View File

@@ -11,3 +11,4 @@ __pycache__/
.tox .tox
sim_build_* sim_build_*
.coverage

View File

@@ -53,10 +53,30 @@ python =
3.9: py39 3.9: py39
[testenv] [testenv]
setenv =
COVERAGE=1
deps = deps =
pytest pytest
pytest-xdist pytest-xdist
cocotb-test cocotb-test
coverage
pytest-cov
commands = commands =
pytest -n auto pytest --cov=cocotbext --cov=tests --cov-branch -n auto
bash -c 'find . -type f -name "\.coverage" | xargs coverage combine --append'
whitelist_externals =
bash
# combine if paths are different
[coverage:paths]
source =
cocotbext/
/*/cocotbext
# do not report dependencies
[coverage:report]
omit =
.tox/*