Skip to content

Remove codecov, solely use coverage. #1542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .coveragerc

This file was deleted.

52 changes: 43 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ jobs:
DB_HOST: 127.0.0.1
DB_PORT: 3306

- name: Upload coverage
uses: codecov/codecov-action@v1
- name: Upload coverage data
uses: actions/upload-artifact@v2
with:
name: Python ${{ matrix.python-version }}
name: coverage-data
path: ".coverage.*"

postgres:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -137,10 +138,11 @@ jobs:
DB_HOST: localhost
DB_PORT: 5432

- name: Upload coverage
uses: codecov/codecov-action@v1
- name: Upload coverage data
uses: actions/upload-artifact@v2
with:
name: Python ${{ matrix.python-version }}
name: coverage-data
path: ".coverage.*"

sqlite:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -183,10 +185,42 @@ jobs:
DB_BACKEND: sqlite3
DB_NAME: ":memory:"

- name: Upload coverage
uses: codecov/codecov-action@v1
- name: Upload coverage data
uses: actions/upload-artifact@v2
with:
name: Python ${{ matrix.python-version }}
name: coverage-data
path: ".coverage.*"

coverage:
name: Check coverage.
runs-on: "ubuntu-latest"
needs: [sqlite, mysql, postgres]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
# Use latest, so it understands all syntax.
python-version: "3.10"

- run: python -m pip install --upgrade coverage

- name: Download coverage data.
uses: actions/download-artifact@v2
with:
name: coverage-data

- name: Combine coverage & check percentage
run: |
python -m coverage combine
python -m coverage html
python -m coverage report

- name: Upload HTML report if check failed.
uses: actions/upload-artifact@v2
with:
name: html-report
path: htmlcov
if: ${{ failure() }}

lint:
runs-on: ubuntu-latest
Expand Down
19 changes: 19 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,25 @@ exclude =
tests
tests.*


[coverage.html]
skip_covered = True
skip_empty = True

[coverage:run]
branch = True
parallel = True
source = debug_toolbar

[coverage:paths]
source =
src
.tox/*/site-packages

[coverage:report]
fail_under = 89
show_missing = True

[flake8]
extend-ignore = E203, E501

Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ deps =
sqlparse
passenv=
CI
COVERAGE_ARGS
DB_BACKEND
DB_NAME
DB_USER
Expand All @@ -39,9 +40,10 @@ setenv =
DB_USER = {env:DB_USER:debug_toolbar}
DB_HOST = {env:DB_HOST:localhost}
DB_PASSWORD = {env:DB_PASSWORD:debug_toolbar}
DJANGO_SETTINGS_MODULE = tests.settings
whitelist_externals = make
pip_pre = True
commands = make coverage TEST_ARGS='{posargs:tests}'
commands = python -b -W always -m coverage run -m django test -v2 {posargs:tests}

[testenv:py{36,37,38,39,310}-dj{22,31,32}-postgresql]
setenv =
Expand Down