Browse Source

Try to add Codecov coverage in CI

merge-requests/2/head
Lucidiot 3 years ago
parent
commit
82d2e069ef
No known key found for this signature in database GPG Key ID: AE3F7205692FA205
  1. 2
      .coveragerc
  2. 32
      .gitlab-ci.yml
  3. 2
      requirements-dev.txt

2
.coveragerc

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

32
.gitlab-ci.yml

@ -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 virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install .[dev]
before_script:
- 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

2
requirements-dev.txt

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

Loading…
Cancel
Save