Skip to content

Commit 441a72d

Browse files
committed
introduce coverage, ensure all tests pass
1 parent edba232 commit 441a72d

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

.github/workflows/pytest.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,26 @@ jobs:
4444
pre-commit install
4545
4646
- name: Run pre-commit hooks
47-
continue-on-error: true
4847
run: >
4948
git ls-files | xargs pre-commit run
5049
--show-diff-on-failure
5150
--color=always
5251
--files
5352
5453
- name: Test with pytest
55-
continue-on-error: true
56-
run: |
54+
run: >
5755
pytest tests
56+
--log-cli-level=DEBUG
57+
--cov=pydaikin
58+
--cov-report=xml
59+
60+
- name: Upload coverage report
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: coverage-report-${{ matrix.python-version }}
64+
path: coverage.xml
65+
- name: Upload coverage to Codecov
66+
uses: codecov/codecov-action@v4
67+
with:
68+
token: ${{ secrets.CODECOV_TOKEN }}
69+
files: coverage.xml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ __pycache__
88
.idea/
99
*.pyc
1010
venv/
11+
.coverage

codecov.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: auto
6+
# adjust accordingly based on how flaky your tests are
7+
# this allows a 10% drop from the previous base commit coverage
8+
threshold: 10%

requirements-test.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
freezegun==1.5.1
22
pytest==8.3.2
33
pytest-asyncio==0.24.0
4+
pytest-cov==5.0.0
5+
aresponses==3.0.0

0 commit comments

Comments
 (0)