| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
stages: |
| 6 |
- test |
| 7 |
- build |
| 8 |
- deploy |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
variables: |
| 13 |
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
cache: |
| 21 |
paths: |
| 22 |
- .cache/pip |
| 23 |
- venv/ |
| 24 |
|
| 25 |
before_script: |
| 26 |
|
| 27 |
- python -V |
| 28 |
- python -m ensurepip |
| 29 |
- python -m pip install -U pip |
| 30 |
- python -m pip install -U setuptools |
| 31 |
- python -m pip install -U wheel |
| 32 |
- python -m pip install -U virtualenv |
| 33 |
- python -m pip install -U tox |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
py36-build: |
| 41 |
stage: build |
| 42 |
image: python:3.6 |
| 43 |
script: |
| 44 |
- export TOXENV=py36-build |
| 45 |
- tox -s true |
| 46 |
|
| 47 |
|
| 48 |
py37-build: |
| 49 |
stage: build |
| 50 |
image: python:3.7 |
| 51 |
script: |
| 52 |
- export TOXENV=py37-build |
| 53 |
- tox -s true |
| 54 |
|
| 55 |
|
| 56 |
py38-build: |
| 57 |
stage: build |
| 58 |
image: python:3.8 |
| 59 |
script: |
| 60 |
- export TOXENV=py38-build |
| 61 |
- tox -s true |
| 62 |
|
| 63 |
|
| 64 |
py38-test: |
| 65 |
stage: test |
| 66 |
image: python:3.8 |
| 67 |
script: |
| 68 |
- export TOXENV=py38-test |
| 69 |
- tox -s true |
| 70 |
|
| 71 |
|
| 72 |
py38-lint: |
| 73 |
stage: test |
| 74 |
image: python:3.8 |
| 75 |
allow_failure: false |
| 76 |
script: |
| 77 |
- export TOXENV=py38-lint |
| 78 |
- tox -r -s true |
| 79 |
|
| 80 |
|
| 81 |
py38-safety: |
| 82 |
stage: test |
| 83 |
image: python:3.8 |
| 84 |
script: |
| 85 |
- export TOXENV=py38-safety |
| 86 |
- tox -s true |
| 87 |
|
| 88 |
|
| 89 |
py38-metric: |
| 90 |
stage: test |
| 91 |
image: python:3.8 |
| 92 |
script: |
| 93 |
- export TOXENV=py38-metric |
| 94 |
- tox -s true |
| 95 |
|
| 96 |
include: |
| 97 |
- template: Code-Quality.gitlab-ci.yml |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
py36-release-pypi: |
| 116 |
stage: deploy |
| 117 |
image: python:3.6 |
| 118 |
script: |
| 119 |
- pip install twine |
| 120 |
- python setup.py sdist bdist_wheel |
| 121 |
- echo $CI_COMMIT_TAG |
| 122 |
- twine check dist/* |
| 123 |
|
| 124 |
- twine upload --repository-url https://test.pypi.org/legacy/ dist/* |
| 125 |
- pip install --no-deps --index-url https://test.pypi.org/simple/ helpdev |
| 126 |
- pip uninstall helpdev -y |
| 127 |
|
| 128 |
- twine upload --repository-url https://upload.pypi.org/legacy/ dist/* |
| 129 |
- pip install helpdev |
| 130 |
- helpdev --version |
| 131 |
- pip uninstall helpdev -y |
| 132 |
only: |
| 133 |
- tags |