Skip to content

Commit

Permalink
chore(ci): enable deepsource testcov reporting and transformers (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
eshaan7 committed Sep 28, 2022
1 parent 2c43840 commit 8bf94f0
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 14 deletions.
9 changes: 4 additions & 5 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

[run]
branch = True
source = django-rest-durin
omit =
durin/models.py
parallel = true
source =
durin
tests

[report]
exclude_lines =
Expand All @@ -12,5 +13,3 @@ exclude_lines =
raise NotImplementedError
if __name__ == .__main__.:
ignore_errors = True
omit =
tests/*
15 changes: 14 additions & 1 deletion .deepsource.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
version = 1

test_patterns = [
"tests/**",
"test_*.py"
]

[[analyzers]]
name = "secrets"
enabled = true
Expand All @@ -13,4 +18,12 @@ name = "python"
enabled = true

[analyzers.meta]
runtime_version = "3.x.x"
runtime_version = "3.x.x"

[[transformers]]
name = "black"
enabled = true

[[transformers]]
name = "isort"
enabled = true
18 changes: 15 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Linter & Tests

on: [push, pull_request]
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
Expand All @@ -13,6 +17,9 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand All @@ -29,5 +36,10 @@ jobs:
# run tests with coverage
tox
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
- name: Report test coverage to DeepSource
uses: deepsourcelabs/test-coverage-action@master
with:
key: python
coverage-file: coverage.xml
dsn: ${{ secrets.DEEPSOURCE_DSN }}
fail-ci-on-error: true
8 changes: 3 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ commands = isort --check-only --diff \
commands =
python manage.py migrate
coverage run manage.py test tests --noinput
coverage combine
coverage report -m
coverage xml
setenv =
DJANGO_SETTINGS_MODULE = example_project.settings
PIP_INDEX_URL = https://pypi.python.org/simple/
Expand All @@ -54,8 +57,3 @@ python =
3.8: py38
3.9: py39
3.10: py310, flake8, black, isort

[testenv:codecov]
passenv = TOXENV CI CODECOV_*
commands = codecov -e TOXENV
deps = codecov>=2.1.10

0 comments on commit 8bf94f0

Please sign in to comment.