From 435b9c9282200df4b55a810ad330a018ee20a9f9 Mon Sep 17 00:00:00 2001 From: Tomasz Hemperek Date: Thu, 3 Dec 2020 15:37:10 +0100 Subject: [PATCH] Add coverge reporting in CI and upload to codecov --- .github/workflows/regression-tests.yml | 5 +++++ .gitignore | 1 + setup.cfg | 22 +++++++++++++++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml index 5232da5..600a752 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests.yml @@ -30,3 +30,8 @@ jobs: - name: Test with tox run: tox + + - name: Upload coverage to codecov + run: | + pip install codecov + codecov diff --git a/.gitignore b/.gitignore index 284c9a3..199c12c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ __pycache__/ .tox sim_build_* +.coverage diff --git a/setup.cfg b/setup.cfg index b983c31..1be1612 100644 --- a/setup.cfg +++ b/setup.cfg @@ -53,10 +53,30 @@ python = 3.9: py39 [testenv] +setenv = + COVERAGE=1 + deps = pytest pytest-xdist cocotb-test + coverage + pytest-cov 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/*