Skip to content

Commit

Permalink
Drop using codecov for coverage reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
hmpf committed Aug 11, 2023
1 parent 4b5411c commit 579c6db
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 29 deletions.
57 changes: 31 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -32,7 +32,6 @@ commands =
-coverage erase

[testenv:coverage-html]
basepython = python3.9
deps =
coverage
setenv =
Expand All @@ -41,7 +40,6 @@ commands =
coverage html --include="./src/*" --omit="*/test*"

[testenv:coverage-xml]
basepython = python3.9
deps =
coverage
setenv =
Expand All @@ -64,6 +62,7 @@ commands =

[coverage:run]
source = ./src/.
parallel=True

[coverage:report]
exclude_lines =
Expand Down

0 comments on commit 579c6db

Please sign in to comment.