.gitlab-ci.yml 6.15 KB
Newer Older
André Anjos's avatar
André Anjos committed
1
# This build file is defined in two parts: 1) a generic set of instructions you
2
3
4
5
# probably **don't** need to change and 2) a part you may have to tune to your
# project. It heavily uses template features from YAML to help you in only
# changing a minimal part of it and avoid code duplication to a maximum while
# still providing a nice pipeline display on your package.
André Anjos's avatar
André Anjos committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24


# 1) Generic instructions (only change if you know what you're doing)
# -------------------------------------------------------------------

# Definition of our build pipeline
stages:
  - build
  - test
  - docs
  - wheels


# Template for the build stage
# Needs to run on all supported architectures, platforms and python versions
.build_template: &build_job
  stage: build
  script:
    - git clean -ffdx
André Anjos's avatar
André Anjos committed
25
    - ${CONDA_FOLDER}/bin/conda create --prefix `pwd`/build-env --clone `cat ${CONDA_FOLDER}/envs/latest-devel-${PYTHON_VER}.txt` --use-index-cache --yes
André Anjos's avatar
André Anjos committed
26
    - source ${CONDA_FOLDER}/bin/activate `pwd`/build-env
27
28
29
30
    - which pip
    - pip install --find-links 'https://www.idiap.ch/software/bob/wheels/travis/' --use-wheel --pre --requirement requirements.txt
    - which pip
    - python bootstrap-buildout.py
André Anjos's avatar
André Anjos committed
31
32
33
34
35
36
37
38
39
40
41
42
    - ./bin/buildout
    - ./bin/sphinx-build -b html doc sphinx
  artifacts:
    expire_in: 2 hours
    paths:
      - ${CI_PROJECT_NAME}.egg-info/
      - .installed.cfg
      - parts/
      - bin/
      - eggs/
      - develop-eggs/
      - sphinx/
André Anjos's avatar
André Anjos committed
43
      - build-env/
André Anjos's avatar
André Anjos committed
44
45
46
47
48


# Template for building on a Linux machine
.build_linux_template: &linux_build_job
  <<: *build_job
André Anjos's avatar
André Anjos committed
49
  variables: &linux_variables
André Anjos's avatar
André Anjos committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
    CONDA_FOLDER: "/idiap/group/torch5spro/conda"


# Template for building on a Mac OSX machine
.build_mac_template: &macosx_build_job
  <<: *build_job
  variables: &macosx_variables
    CONDA_FOLDER: "/opt/conda"
    MACOSX_DEPLOYMENT_TARGET: "10.9"
    CFLAGS: "-pthread"


# Template for the test stage
# Needs to run on all supported architectures, platforms and python versions
.test_template: &test_job
  stage: test
  script:
André Anjos's avatar
André Anjos committed
67
    - source ${CONDA_FOLDER}/bin/activate `pwd`/build-env
68
69
    - which python
    - python bootstrap-buildout.py
André Anjos's avatar
André Anjos committed
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
    - ./bin/buildout -o
    - ./bin/python -c 'from bob.extension import get_config; print(get_config())'
    - ./bin/coverage run --source=${CI_PROJECT_NAME} ./bin/nosetests -sv
    - ./bin/sphinx-build -b doctest doc sphinx


# Template for testing on a Mac OSX machine
.test_mac_template: &macosx_test_job
  <<: *test_job
  variables:
    MACOSX_DEPLOYMENT_TARGET: "10.9"
    CFLAGS: "-pthread"


# Template for the wheel uploading stage
# Needs to run against one combination of python 2.x and 3.x if it is a python
# only package, otherwise, needs to run in both pythons to all supported
# architectures (Linux and Mac OSX 64-bit)
.wheels_template: &wheels_job
  stage: wheels
  only:
    - master
    - tags
  script:
André Anjos's avatar
André Anjos committed
94
    - source ${CONDA_FOLDER}/bin/activate `pwd`/build-env
95
96
    - which python
    - python bootstrap-buildout.py
André Anjos's avatar
André Anjos committed
97
98
99
    - ./bin/buildout -o
    - wget https://gitlab.idiap.ch/bob/bob.extension/raw/master/scripts/upload-wheel.sh
    - chmod 755 upload-wheel.sh
André Anjos's avatar
André Anjos committed
100
    - ./upload-wheel.sh
André Anjos's avatar
André Anjos committed
101
102
103
104
105
106
107
108
109
110
111


# Template for (latest) documentation upload stage
# Only one real job needs to do this (normally, the latest python on OSX)
.docs_template: &docs_job
  stage: docs
  only:
    - master
  variables:
    BOB_DOCUMENTATION_SERVER: "http://www.idiap.ch/software/bob/docs/latest/bob/%s/master/"
  script:
André Anjos's avatar
André Anjos committed
112
    - source ${CONDA_FOLDER}/bin/activate `pwd`/build-env
113
114
    - which python
    - python bootstrap-buildout.py
André Anjos's avatar
André Anjos committed
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
    - ./bin/buildout -o
    - rm -rf sphinx
    - ./bin/sphinx-build -b html doc sphinx
    - wget https://gitlab.idiap.ch/bob/bob.extension/raw/master/scripts/upload-sphinx.sh
    - chmod 755 upload-sphinx.sh
    - ./upload-sphinx.sh


# 2) Package specific instructions (you may tune this if needed)
# --------------------------------------------------------------

# Linux + Python 2.7: Builds and tests
build_linux_27:
  <<: *linux_build_job
  variables:
    <<: *linux_variables
    PYTHON_VER: "2.7"
  tags:
    - conda-linux

test_linux_27:
  <<: *test_job
  dependencies:
    - build_linux_27
  tags:
    - conda-linux

wheels_linux_27:
  <<: *wheels_job
  dependencies:
    - build_linux_27
  tags:
    - conda-linux


# Linux + Python 3.4: Builds and tests
build_linux_34:
  <<: *linux_build_job
  variables:
    <<: *linux_variables
    PYTHON_VER: "3.4"
  tags:
    - conda-linux

test_linux_34:
  <<: *test_job
  dependencies:
    - build_linux_34
  tags:
    - conda-linux

wheels_linux_34:
  <<: *wheels_job
  dependencies:
    - build_linux_34
  tags:
    - conda-linux


# Linux + Python 3.5: Builds and tests
build_linux_35:
  <<: *linux_build_job
  variables:
    <<: *linux_variables
    PYTHON_VER: "3.5"
  tags:
    - conda-linux

test_linux_35:
  <<: *test_job
  dependencies:
    - build_linux_35
  tags:
    - conda-linux

wheels_linux_35:
  <<: *wheels_job
  dependencies:
    - build_linux_35
  tags:
    - conda-linux


# Mac OSX + Python 2.7: Builds, tests and uploads the wheel
build_macosx_27:
  <<: *macosx_build_job
  variables:
    <<: *macosx_variables
    PYTHON_VER: "2.7"
  tags:
    - conda-macosx

test_macosx_27:
  <<: *macosx_test_job
  dependencies:
    - build_macosx_27
  tags:
    - conda-macosx

wheels_macosx_27:
  <<: *wheels_job
  dependencies:
    - build_macosx_27
  tags:
    - conda-macosx


# Mac OSX + Python 3.4: Builds and tests
build_macosx_34:
  <<: *macosx_build_job
  variables:
    <<: *macosx_variables
    PYTHON_VER: "3.4"
  tags:
    - conda-macosx

test_macosx_34:
  <<: *macosx_test_job
  dependencies:
    - build_macosx_34
  tags:
    - conda-macosx

wheels_macosx_34:
  <<: *wheels_job
  dependencies:
    - build_macosx_34
  tags:
    - conda-macosx


# Mac OSX + Python 3.5: Builds, tests, uploads the wheel and the latest docs
build_macosx_35:
  <<: *macosx_build_job
  variables:
    <<: *macosx_variables
    PYTHON_VER: "3.5"
  tags:
    - conda-macosx

test_macosx_35:
  <<: *macosx_test_job
  dependencies:
    - build_macosx_35
  tags:
    - conda-macosx

wheels_macosx_35:
  <<: *wheels_job
  dependencies:
    - build_macosx_35
  tags:
    - conda-macosx

docs_macosx_35:
  <<: *docs_job
  dependencies:
    - build_macosx_35
  tags:
    - conda-macosx