Skip to content

Commit 14b4004

Browse files
authored
Add Codecov (#7)
* Add Codecov * Add .coveragerc
1 parent 2759e0b commit 14b4004

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

.coveragerc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[run]
2+
omit =
3+
example/*
4+
tests/*
5+
setup.py

.github/workflows/ci.yaml

+10-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,16 @@ jobs:
5555
- name: List installed packages
5656
run: pip list
5757
- name: Run unit tests
58-
run: |
59-
pytest --verbose
58+
run: pytest --verbose --cov=./ --cov-report=xml
59+
- name: Upload coverage reports to Codecov
60+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
61+
uses: codecov/codecov-action@v1
62+
with:
63+
file: ./coverage.xml
64+
flags: unittests
65+
env_vars: OS,PYTHON
66+
name: codecov-umbrella
67+
fail_ci_if_error: true
6068

6169
examples:
6270
name: 'Run examples'

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"dev": [
4646
# For test
4747
"pytest>=6.2.4,<7.0.0",
48+
"pytest-cov>=2.11.1,<3.0.0",
4849
# For lint
4950
"black>=21.5b0,<22.0",
5051
"flake8>=3.9.1,<4.0.0",

0 commit comments

Comments
 (0)