Skip to content

Commit

Permalink
feat: coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
likeinlife committed Jul 22, 2024
1 parent 5b656d5 commit 2a2aa18
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 3 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Workflow for Codecov
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: pip install -r requirements-dev.lock
- name: Run tests and collect coverage
run: pytest --cov ${{ env.CODECOV_ATS_TESTS }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
86 changes: 84 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 29 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ test.optional = true
[tool.poetry.group.test.dependencies]
pytest-asyncio = "^0.23.7"
pytest = "^8.2.2"
pytest-cov = "^5.0.0"

[build-system]
requires = ["poetry-core"]
Expand Down Expand Up @@ -89,4 +90,31 @@ ignore_missing_imports = true
follow_imports = "normal"

[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_mode = "auto"

[tool.coverage.report]
exclude_also = [
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
omit = [
# omit anything in a .local directory anywhere
"*/.local/*",
"__init__.py",
"tests/*",
"*/tests/*",
# omit anything in a .venv directory anywhere
".venv/*",
"*/containers/*",
"*/migrations/*",
"*/core/*",
"*/errors.py",
]
21 changes: 21 additions & 0 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
cfgv==3.4.0 ; python_version >= "3.11" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.11" and python_version < "4.0" and sys_platform == "win32"
coverage[toml]==7.6.0 ; python_version >= "3.11" and python_version < "4.0"
distlib==0.3.8 ; python_version >= "3.11" and python_version < "4.0"
filelock==3.15.4 ; python_version >= "3.11" and python_version < "4.0"
identify==2.5.36 ; python_version >= "3.11" and python_version < "4.0"
iniconfig==2.0.0 ; python_version >= "3.11" and python_version < "4.0"
mypy-extensions==1.0.0 ; python_version >= "3.11" and python_version < "4.0"
mypy==1.10.1 ; python_version >= "3.11" and python_version < "4.0"
nodeenv==1.9.1 ; python_version >= "3.11" and python_version < "4.0"
packaging==24.1 ; python_version >= "3.11" and python_version < "4.0"
platformdirs==4.2.2 ; python_version >= "3.11" and python_version < "4.0"
pluggy==1.5.0 ; python_version >= "3.11" and python_version < "4.0"
pre-commit==3.7.1 ; python_version >= "3.11" and python_version < "4.0"
pytest-asyncio==0.23.7 ; python_version >= "3.11" and python_version < "4.0"
pytest-cov==5.0.0 ; python_version >= "3.11" and python_version < "4.0"
pytest==8.2.2 ; python_version >= "3.11" and python_version < "4.0"
pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "4.0"
ruff==0.5.0 ; python_version >= "3.11" and python_version < "4.0"
typing-extensions==4.12.2 ; python_version >= "3.11" and python_version < "4.0"
virtualenv==20.26.3 ; python_version >= "3.11" and python_version < "4.0"

0 comments on commit 2a2aa18

Please sign in to comment.