-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
53 lines (44 loc) · 1.33 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
stages:
- test
- build
tests:
image: python:3.9
stage: test
services:
- postgres:13.3
only:
- merge_requests
- master
cache:
paths:
- $PIP_CACHE_DIR
- $PIPENV_CACHE_DIR
variables:
PIP_DOWNLOAD_CACHE: /cache/pip/.pip_download_cache
PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
PIPENV_CACHE_DIR: $CI_PROJECT_DIR/.cache/pipenv
POSTGRES_PASSWORD: postgres
before_script:
- pip install -U pip pipenv
- pipenv install --deploy --system --clear --dev
- python -m tests.test_app.init_db
script:
- black --check --diff ./
- mypy ./awokado/
- coverage run --source=awokado -m unittest discover
- coverage report -m
build:
image: python:3.9
stage: build
only:
- master
before_script:
- pip install twine
- git config --global user.email $NPA_EMAIL
- git config --global user.name $NPA_USER
- git config --global user.password $NPA_PASSWORD
script:
- python setup.py sdist bdist_wheel
- twine upload --skip-existing dist/* -u $PYPI_USER -p $PYPI_PASSWORD
- git remote set-url origin https://$NPA_USER:[email protected]/5783354/awokado.git
- git tag | egrep -q $(python awokado/version.py) || (git tag -am "Release $(python awokado/version.py)" $(python awokado/version.py) && git push origin $(python awokado/version.py))