diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cc1647b..b7281a4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,15 +45,25 @@ jobs: - name: Install Dependencies run: | pip install -U pip - pip install -U wheel setuptools tox + pip install -U wheel setuptools tox coverage - name: Test run: tox -vv -p auto -f ${{ matrix.python.tox-prefix }} -- --cov-report=xml env: TOX_DISCOVER: "patch-for-windows-pypy3" - - - name: Upload coverage to Codecov + TOX_PARALLEL_NO_SPINNER: 1 + + - name: Combine Coverage + run: | + find . -name ".coverage.*" -exec mv {} ./ \; + coverage combine + coverage xml + + - name: Upload Coverage to Codecov uses: codecov/codecov-action@v1 + with: + files: coverage.xml + fail_ci_if_error: true - name: Lint run: tox -vv diff --git a/tox.ini b/tox.ini index ba80ad6..ae01c08 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,9 @@ envlist = commands = pytest --cov {posargs} passenv = NEW_RELIC_LICENSE_KEY +setenv = + COVERAGE_FILE={envdir}/.coverage.{envname} + COVERAGE_RCFILE={toxinidir}/tox.ini deps = # Base Dependencies pytest @@ -30,3 +33,19 @@ commands = sphinx-build -d "{toxinidir}/docs_doctree" "{toxinidir}/docs/" "{toxi deps = sphinx<8 sphinx_rtd_theme + +[coverage:run] +branch = True +source = newrelic_telemetry_sdk + +[coverage:paths] +source = + src/newrelic_telemetry_sdk/ + .tox/**/site-packages/newrelic_telemetry_sdk/ + /__w/**/site-packages/newrelic_telemetry_sdk/ + +[coverage:html] +directory = ${TOX_ENV_DIR-.}/htmlcov + +[coverage:xml] +output = ${TOX_ENV_DIR-.}/coverage.xml