Try to add Codecov coverage in CI

This commit is contained in:
Lucidiot 2019-01-30 19:49:21 +01:00
parent 6e9dafe516
commit 82d2e069ef
No known key found for this signature in database
GPG Key ID: AE3F7205692FA205
3 changed files with 25 additions and 11 deletions

2
.coveragerc Normal file
View File

@ -0,0 +1,2 @@
[run]
include=urbantz/*

View File

@ -1,13 +1,27 @@
image: python:3.7
stages:
- lint
- test
- deploy
flake8:
stage: lint
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
before_script:
- pip install .[dev]
before_script:
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install .[dev]
tests:
stage: test
coverage: '/TOTAL[\s\d]+\s(\d+%)/'
script:
- coverage run setup.py test
- coverage report
- codecov
flake8:
stage: test
script:
- flake8
@ -20,7 +34,7 @@ deploy-pypi:
name: pypi
url: https://pypi.org/project/pyurbantz
before_script:
script:
- pip install twine setuptools wheel
- echo "[distutils]" > ~/.pypirc
- echo "index-servers =" >> ~/.pypirc
@ -29,7 +43,6 @@ deploy-pypi:
- echo "repository=https://upload.pypi.org/legacy/" >> ~/.pypirc
- echo "username=$PYPI_DEPLOY_USERNAME" >> ~/.pypirc
- echo "password=$PYPI_DEPLOY_PASSWORD" >> ~/.pypirc
script:
- python setup.py sdist bdist_wheel
- twine upload dist/* -r pypi
@ -42,7 +55,7 @@ deploy-testpypi:
name: testpypi
url: https://test.pypi.org/project/pyurbantz
before_script:
script:
- pip install twine setuptools wheel
- echo "[distutils]" > ~/.pypirc
- echo "index-servers =" >> ~/.pypirc
@ -51,7 +64,6 @@ deploy-testpypi:
- echo "repository=https://test.pypi.org/legacy/" >> ~/.pypirc
- echo "username=$PYPI_DEPLOY_USERNAME" >> ~/.pypirc
- echo "password=$PYPI_DEPLOY_PASSWORD" >> ~/.pypirc
script:
- python setup.py sdist bdist_wheel
- twine upload dist/* -r testpypi
@ -64,8 +76,6 @@ pages:
paths:
- public
before_script:
- pip install .[dev]
script:
- cd docs
- make html

View File

@ -1,2 +1,4 @@
flake8>=3.5
Sphinx>=1.8.1
coverage>=4.5
codecov>=2.0