forked from taverntesting/tavern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
202 lines (154 loc) · 3.22 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
---
variables:
GIT_SUBMODULE_STRATEGY: none
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
stages:
- precheck
- basic-tests
- full-tests
- deploy
.basetest: &testbaseanchor
stage: basic-tests
# cache:
# key: tavern-project-cache
# paths:
# - .cache/pip
# - .tox
# policy: pull
before_script:
- pip install tox
script:
- tox -c ${TOXCFG} -e ${CI_JOB_NAME}
variables:
TOXCFG: tox.ini
only:
- master
########################################
# Initial checks
########################################
.flakestest: &flakestest
<<: *testbaseanchor
stage: precheck
py27flakes:
<<: *flakestest
image: python:2.7-alpine
py36flakes:
<<: *flakestest
image: python:3.6-alpine
########################################
# Unit tests
########################################
.basictests: &basictest
<<: *testbaseanchor
# basic unit tests
py27:
<<: *basictest
image: python:2.7-alpine
py36:
<<: *basictest
image: python:3.6-alpine
# Make this job push the cache. It doesn't hugely matter if the cache is out
# of date, so just do it in one job.
# cache:
# key: tavern-project-cache
# paths:
# - .cache/pip
# - .tox
py27lint:
<<: *basictest
image: python:2.7-alpine
py36lint:
<<: *basictest
image: python:3.6-alpine
# extra unit tests
py34:
<<: *basictest
image: python:3.4-alpine
stage: full-tests
py35:
<<: *basictest
image: python:3.5-alpine
stage: full-tests
pypy:
<<: *basictest
image: pypy:2-slim
stage: full-tests
pypy3:
<<: *basictest
image: pypy:3-slim
stage: full-tests
########################################
# Integration tests
########################################
# Different cfg file and needs docker running
.integrationtest: &inttest
<<: *testbaseanchor
variables:
TOXCFG: tox-integration.ini
DOCKER_HOST: tcp://docker:2375
services:
- docker:dind
before_script:
- pip install --upgrade docker-compose tox
# basic integration tests
py27-generic:
<<: *inttest
image: python:2.7-alpine
py36-mqtt:
<<: *inttest
image: python:3.6-alpine
py36-advanced:
<<: *inttest
image: python:3.6-alpine
py36-generic:
<<: *inttest
image: python:3.6-alpine
# full integration tests
py27-cookies:
<<: *inttest
image: python:2.7-alpine
stage: full-tests
py34-cookies:
<<: *inttest
image: python:3.4-alpine
stage: full-tests
py35-cookies:
<<: *inttest
image: python:3.5-alpine
stage: full-tests
py36-cookies:
<<: *inttest
image: python:3.6-alpine
stage: full-tests
pypy-cookies:
<<: *inttest
image: pypy:2-slim
stage: full-tests
pypy3-cookies:
<<: *inttest
image: pypy:3-slim
stage: full-tests
########################################
# Deploy
########################################
Deploy to pypi:
<<: *testbaseanchor
only:
- tags
stage: deploy
image: python:2.7-alpine
before_script:
- |
echo "
[distutils]
index-servers =
pypi
[pypi]
repository = https://pypi.python.org/pypi
username = ${PYPI_USERNAME}
password = ${PYPI_PASSWORD}
" > ~/.pypirc
- pip install twine
script:
- python setup.py sdist bdist_wheel --universal
- twine upload dist/*