Try to add Codecov coverage in CI
This commit is contained in:
parent
6e9dafe516
commit
82d2e069ef
|
@ -0,0 +1,2 @@
|
||||||
|
[run]
|
||||||
|
include=urbantz/*
|
|
@ -1,13 +1,27 @@
|
||||||
image: python:3.7
|
image: python:3.7
|
||||||
stages:
|
stages:
|
||||||
- lint
|
- test
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
flake8:
|
variables:
|
||||||
stage: lint
|
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- pip install .[dev]
|
- 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:
|
script:
|
||||||
- flake8
|
- flake8
|
||||||
|
|
||||||
|
@ -20,7 +34,7 @@ deploy-pypi:
|
||||||
name: pypi
|
name: pypi
|
||||||
url: https://pypi.org/project/pyurbantz
|
url: https://pypi.org/project/pyurbantz
|
||||||
|
|
||||||
before_script:
|
script:
|
||||||
- pip install twine setuptools wheel
|
- pip install twine setuptools wheel
|
||||||
- echo "[distutils]" > ~/.pypirc
|
- echo "[distutils]" > ~/.pypirc
|
||||||
- echo "index-servers =" >> ~/.pypirc
|
- echo "index-servers =" >> ~/.pypirc
|
||||||
|
@ -29,7 +43,6 @@ deploy-pypi:
|
||||||
- echo "repository=https://upload.pypi.org/legacy/" >> ~/.pypirc
|
- echo "repository=https://upload.pypi.org/legacy/" >> ~/.pypirc
|
||||||
- echo "username=$PYPI_DEPLOY_USERNAME" >> ~/.pypirc
|
- echo "username=$PYPI_DEPLOY_USERNAME" >> ~/.pypirc
|
||||||
- echo "password=$PYPI_DEPLOY_PASSWORD" >> ~/.pypirc
|
- echo "password=$PYPI_DEPLOY_PASSWORD" >> ~/.pypirc
|
||||||
script:
|
|
||||||
- python setup.py sdist bdist_wheel
|
- python setup.py sdist bdist_wheel
|
||||||
- twine upload dist/* -r pypi
|
- twine upload dist/* -r pypi
|
||||||
|
|
||||||
|
@ -42,7 +55,7 @@ deploy-testpypi:
|
||||||
name: testpypi
|
name: testpypi
|
||||||
url: https://test.pypi.org/project/pyurbantz
|
url: https://test.pypi.org/project/pyurbantz
|
||||||
|
|
||||||
before_script:
|
script:
|
||||||
- pip install twine setuptools wheel
|
- pip install twine setuptools wheel
|
||||||
- echo "[distutils]" > ~/.pypirc
|
- echo "[distutils]" > ~/.pypirc
|
||||||
- echo "index-servers =" >> ~/.pypirc
|
- echo "index-servers =" >> ~/.pypirc
|
||||||
|
@ -51,7 +64,6 @@ deploy-testpypi:
|
||||||
- echo "repository=https://test.pypi.org/legacy/" >> ~/.pypirc
|
- echo "repository=https://test.pypi.org/legacy/" >> ~/.pypirc
|
||||||
- echo "username=$PYPI_DEPLOY_USERNAME" >> ~/.pypirc
|
- echo "username=$PYPI_DEPLOY_USERNAME" >> ~/.pypirc
|
||||||
- echo "password=$PYPI_DEPLOY_PASSWORD" >> ~/.pypirc
|
- echo "password=$PYPI_DEPLOY_PASSWORD" >> ~/.pypirc
|
||||||
script:
|
|
||||||
- python setup.py sdist bdist_wheel
|
- python setup.py sdist bdist_wheel
|
||||||
- twine upload dist/* -r testpypi
|
- twine upload dist/* -r testpypi
|
||||||
|
|
||||||
|
@ -64,8 +76,6 @@ pages:
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
|
|
||||||
before_script:
|
|
||||||
- pip install .[dev]
|
|
||||||
script:
|
script:
|
||||||
- cd docs
|
- cd docs
|
||||||
- make html
|
- make html
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
flake8>=3.5
|
flake8>=3.5
|
||||||
Sphinx>=1.8.1
|
Sphinx>=1.8.1
|
||||||
|
coverage>=4.5
|
||||||
|
codecov>=2.0
|
||||||
|
|
Reference in New Issue