Skip to content

Commit 0413572

Browse files
committed
Add support for pytest-cov and Codecov 🎉
1 parent c0c98fc commit 0413572

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
pytest-in-venv:
2020
name: Python tests
2121
runs-on: ubuntu-latest
22+
env:
23+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2224
timeout-minutes: 5
2325

2426
steps:
@@ -34,5 +36,10 @@
3436
- name: Install dependencies
3537
run: pip install -r requirements/requirements-test.txt
3638

37-
- name: Run the tests
38-
run: pytest
39+
- name: Run the tests with coverage
40+
run: pytest --cov=./ --cov-report=xml
41+
42+
- name: Upload coverage reports to Codecov
43+
uses: codecov/codecov-action@v3
44+
env:
45+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

requirements/requirements-test.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Use this for running tests (such as in CI environment)
22
-r requirements.txt
33
pytest
4+
pytest-cov

0 commit comments

Comments
 (0)