Skip to content

Commit

Permalink
☔ Add coverage setup to CI (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
bastonero authored Feb 16, 2025
1 parent d8aaa9f commit 13b3337
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,19 @@ jobs:
run: sudo apt update && sudo apt install postgresql

- name: Install python dependencies
run: |
pip install --upgrade setuptools
pip install -e .[tests]
run: pip install -e .[tests]

- name: Run pytest
run: pytest -sv tests
run: pytest -sv --cov --cov-report=xml tests

- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: aiidateam/aiida-hubbard
name: pytests-3.9
flags: pytests
fail_ci_if_error: true

integration:

Expand Down
12 changes: 12 additions & 0 deletions codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
coverage:
status:
project:
default:
target: 75%
threshold: 0.2%
patch:
default:
target: 70%
threshold: 0.2%
ignore:
- "src/aiida_hubbard/cli/*"
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ pre-commit = [
tests = [
'pgtest~=1.3',
'pytest~=6.0',
'pytest-regressions~=2.3'
'coverage[toml]',
'pytest-cov',
'pytest-regressions~=2.3',
'pytest-timeout',
]

[project.scripts]
Expand Down Expand Up @@ -98,6 +101,11 @@ include_trailing_comma = true
line_length = 120
multi_line_output = 3

[tool.coverage.run]
# Configuration of [coverage.py](https://coverage.readthedocs.io)
# reporting which lines of your plugin are covered by tests
source = ["src/aiida_hubbard"]

[tool.pydocstyle]
ignore = [
'D104',
Expand Down

0 comments on commit 13b3337

Please sign in to comment.