88 lines
1.9 KiB
YAML
88 lines
1.9 KiB
YAML
image: python:3.7
|
|
stages:
|
|
- test
|
|
- deploy
|
|
|
|
variables:
|
|
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
|
|
|
cache:
|
|
paths:
|
|
- .cache/pip
|
|
- venv/
|
|
|
|
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
|
|
|
|
pre-commit:
|
|
stage: test
|
|
script:
|
|
- pre-commit run -a
|
|
|
|
deploy-pypi:
|
|
stage: deploy
|
|
when: manual
|
|
only:
|
|
- master@Lucidiot/pylspci
|
|
environment:
|
|
name: pypi
|
|
url: https://pypi.org/project/pylspci
|
|
|
|
script:
|
|
- pip install twine setuptools wheel
|
|
- echo "[distutils]" > ~/.pypirc
|
|
- echo "index-servers =" >> ~/.pypirc
|
|
- echo " pypi" >> ~/.pypirc
|
|
- echo "[pypi]" >> ~/.pypirc
|
|
- echo "repository=https://upload.pypi.org/legacy/" >> ~/.pypirc
|
|
- echo "username=$PYPI_DEPLOY_USERNAME" >> ~/.pypirc
|
|
- echo "password=$PYPI_DEPLOY_PASSWORD" >> ~/.pypirc
|
|
- python setup.py sdist bdist_wheel
|
|
- twine upload dist/* -r pypi
|
|
|
|
deploy-testpypi:
|
|
stage: deploy
|
|
when: manual
|
|
only:
|
|
- branches@Lucidiot/pylspci
|
|
environment:
|
|
name: testpypi
|
|
url: https://test.pypi.org/project/pylspci
|
|
|
|
script:
|
|
- pip install twine setuptools wheel
|
|
- echo "[distutils]" > ~/.pypirc
|
|
- echo "index-servers =" >> ~/.pypirc
|
|
- echo " testpypi" >> ~/.pypirc
|
|
- echo "[testpypi]" >> ~/.pypirc
|
|
- echo "repository=https://test.pypi.org/legacy/" >> ~/.pypirc
|
|
- echo "username=$PYPI_DEPLOY_USERNAME" >> ~/.pypirc
|
|
- echo "password=$PYPI_DEPLOY_PASSWORD" >> ~/.pypirc
|
|
- python setup.py sdist bdist_wheel
|
|
- twine upload dist/* -r testpypi
|
|
|
|
pages:
|
|
stage: deploy
|
|
when: manual
|
|
only:
|
|
- master@Lucidiot/pylspci
|
|
artifacts:
|
|
paths:
|
|
- public
|
|
|
|
script:
|
|
- cd docs
|
|
- make html
|
|
- mv _build/html ../public
|