-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
63 lines (57 loc) · 1.38 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
51
52
53
54
55
56
57
58
59
60
61
62
63
image: ubuntu:bionic
stages:
- linting
- tests
- publish
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
DOCKER_DRIVER: overlay2
POSTGRES_USER: user
POSTGRES_DB: db
POSTGRES_PASSWORD: password
POSTGRES_HOST: makinacorpus__pgrouting
cache:
paths:
- /var/cache/apt/
- .cache/
- venv/
tests:
stage: tests
tags: [shared-ci-docker]
before_script:
- apt-get update
- apt-get install -y python3-pip
- apt-get install -y $(grep -vE "^\s*#" apt.txt | tr "\n" " ")
- python3 -m venv venv/
- ./venv/bin/pip3 install -r test-requirements.txt
services:
- makinacorpus/pgrouting:10.1-2.5.4
script:
- ./venv/bin/tox -c tox.ini -e tests,coverage
coverage: '/TOTAL.+ ([0-9]{1,3}%)/'
linting:
image: python:3.6
stage: linting
tags: [shared-ci-docker]
script:
- pip install tox
- tox -c tox.ini -e linting
publish_pypi:
image: python:3.6
stage: publish
tags: [shared-ci-docker]
when: manual
before_script:
- echo =========== Deploying on pypi ===========
only:
- /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
except:
- branches
variables:
TWINE_USERNAME: $PYPI_USER
TWINE_PASSWORD: $PYPI_PASSWORD
TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/
script:
- pip install twine
- python setup.py sdist bdist_wheel
- twine upload -r pypi dist/*