Skip to content

Commit 42aead1

Browse files
committedDec 21, 2021
Add coverage badge
1 parent 6c1ee0b commit 42aead1

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed
 

‎.github/workflows/ci.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ jobs:
4141
python-version: ${{ matrix.python_version }}
4242

4343
- name: Run tests on Python ${{ matrix.python_version }}
44-
run: make test
44+
run: make testcov
45+
46+
- name: Upload coverage report
47+
uses: codecov/codecov-action@v1
48+
if: matrix.python_version == '3.9' && github.ref == 'refs/heads/master'
4549

4650
distrib:
4751
name: Build and upload the packages

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
.*
44
__pycache__
55
build
6+
coverage.xml
67
dist
78
htmlcov

‎Makefile

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.DEFAULT: help
2-
.PHONY: help bootstrap build lint outdated test testreport upload clean
2+
.PHONY: help bootstrap build lint outdated test testcov testreport upload clean
33

44
VENV = .venv
55
PYTHON_BIN ?= python3
@@ -13,6 +13,7 @@ help:
1313
@echo " lint - inspect project source code for errors"
1414
@echo " outdated - list outdated project requirements"
1515
@echo " test - run project tests"
16+
@echo " testcov - run project tests with coverage file report"
1617
@echo " testreport - run project tests and open HTML coverage report"
1718
@echo " upload - upload built packages to package repository"
1819
@echo " clean - clean up project environment and all the build artifacts"
@@ -35,6 +36,9 @@ outdated: bootstrap
3536
test: bootstrap
3637
$(PYTHON) -m pytest
3738

39+
testcov: bootstrap
40+
$(PYTHON) -m pytest --cov-report=xml
41+
3842
testreport: bootstrap
3943
$(PYTHON) -m pytest --cov-report=html
4044
xdg-open htmlcov/index.html
@@ -43,4 +47,4 @@ upload: build
4347
$(PYTHON) -m twine upload dist/*
4448

4549
clean:
46-
rm -rf *.egg-info .eggs .pytest_cache build dist htmlcov $(VENV)
50+
rm -rf *.egg-info .eggs .pytest_cache coverage.xml build dist htmlcov $(VENV)

‎README.rst

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ aonvif
77
:alt: Build Status
88
:target: https://github.com/martyanov/aonvif/actions?query=event%3Apush+branch%3Amaster+workflow%3ACI
99

10+
.. image:: https://codecov.io/gh/martyanov/aonvif/coverage.svg?branch=master
11+
:alt: Coverage report
12+
:target: https://codecov.io/gh/martyanov/aonvif/branch/master
13+
1014
.. image:: https://img.shields.io/pypi/v/aonvif.svg
1115
:alt: PyPI Version
1216
:target: https://pypi.python.org/pypi/aonvif

‎setup.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ max-line-length = 95
44
[tool:pytest]
55
addopts=
66
--cov=onvif
7-
onvif
87
tests
98
filterwarnings =
109
ignore:defusedxml.lxml is no longer supported:DeprecationWarning

0 commit comments

Comments
 (0)
Please sign in to comment.