1 | | - | image: python:latest |
| 1 | + | image: python:3.7 |
2 | 2 | | |
3 | | - | variables: |
4 | | - | PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" |
| 3 | + | stages: |
| 4 | + | - build |
| 5 | + | - test |
| 6 | + | - release |
5 | 7 | | |
6 | | - | cache: |
7 | | - | paths: |
8 | | - | - .cache/pip |
9 | | - | - venv/ |
| 8 | + | packaging: |
| 9 | + | stage: build |
| 10 | + | script: |
| 11 | + | - pip install --upgrade setuptools wheel |
| 12 | + | - python3 setup.py sdist bdist_wheel |
| 13 | + | artifacts: |
| 14 | + | paths: |
| 15 | + | - dist |
10 | 16 | | |
11 | | - | before_script: |
12 | | - | - python -V |
13 | | - | - pip install virtualenv |
14 | | - | - virtualenv venv |
15 | | - | - source venv/bin/activate |
16 | | - | - pip install -r requirements.txt |
| 17 | + | pytest: |
| 18 | + | stage: test |
| 19 | + | script: |
| 20 | + | - pip install dist/*.whl |
| 21 | + | - pip install pytest pytest-cov |
| 22 | + | - pytest |
| 23 | + | - pytest --cov=rtspbrute |
17 | 24 | | |
18 | | - | test: |
| 25 | + | upload: |
| 26 | + | stage: release |
| 27 | + | only: |
| 28 | + | - tags |
19 | 29 | | script: |
20 | | - | - pip install pytest pytest-cov |
21 | | - | - python -m pytest tests -v |
22 | | - | - python -m pytest --cov=rtspbrute |
| 30 | + | - pip install --upgrade twine |
| 31 | + | - twine upload dist/* |
23 | 32 | | |