From 579c6db20ec7f3391189a09ccba41efac60fa573 Mon Sep 17 00:00:00 2001 From: Hanne Moa Date: Fri, 11 Aug 2023 12:34:34 +0200 Subject: [PATCH] Drop using codecov for coverage reporting --- .github/workflows/ci.yml | 57 ++++++++++++++++++++++------------------ tox.ini | 5 ++-- 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78baf23..4fdedee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,10 +50,9 @@ jobs: run: | python -m tox -e flake8-critical - test: name: "Python ${{ matrix.python-version }}" - needs: lint + needs: [lint, build-package] runs-on: ubuntu-latest strategy: @@ -89,33 +88,39 @@ jobs: - name: "Test with tox for ${{ matrix.python-version }}" run: | python -m tox + ls .cov* - - name: "Combine coverage" - run: | - set -xe - python -m coverage xml + - name: Upload coverage data + uses: actions/upload-artifact@v3 + with: + name: coverage-data + path: ".coverage*" + if-no-files-found: ignore - - name: "Upload to Codecov" - uses: codecov/codecov-action@v1 + coverage-report: + name: "Combined coverage" + runs-on: ubuntu-latest + needs: test + steps: + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + with: + name: coverage-data + - uses: actions/setup-python@v4 with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true + python-version: "3.11" + - run: python -Im pip install --upgrade tox coverage[toml] - package: - name: "Build & verify package" - runs-on: "ubuntu-latest" + - name: "Combine coverage" + run: | + set -xe + python -m tox -e coverage-html - steps: - - uses: "actions/checkout@v2" - - uses: "actions/setup-python@v2" - with: - python-version: "3.11" + # Report and write to summary. + python -Im coverage report --skip-covered --skip-empty | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY - - name: "Install build and twine" - run: "python -m pip install build twine" - - name: "Build package" - run: "python -m build" - - name: "List result" - run: "ls -l dist" - - name: "Check long_description" - run: "python -m twine check dist/*" + - name: "Upload HTML report" + uses: actions/upload-artifact@v3 + with: + name: html-report + path: htmlcov diff --git a/tox.ini b/tox.ini index 80af463..5b74b21 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,7 @@ envlist = py{37,38,39,310,311} coverage-html skip_missing_interpreters = True -basepython = python3.8 +basepython = python3.11 isolated_build = True [gh-actions] @@ -32,7 +32,6 @@ commands = -coverage erase [testenv:coverage-html] -basepython = python3.9 deps = coverage setenv = @@ -41,7 +40,6 @@ commands = coverage html --include="./src/*" --omit="*/test*" [testenv:coverage-xml] -basepython = python3.9 deps = coverage setenv = @@ -64,6 +62,7 @@ commands = [coverage:run] source = ./src/. +parallel=True [coverage:report] exclude_lines =