.gitlab-ci.yml 5.4 KB
Newer Older
1 2 3
# This build file heavily uses template features from YAML so it is generic
# enough for any Bob project. Don't modify it unless you know what you're
# doing.
André Anjos's avatar
André Anjos committed
4 5 6 7 8 9 10 11


# Definition of our build pipeline
stages:
  - build
  - test
  - docs
  - wheels
12
  - deploy
André Anjos's avatar
André Anjos committed
13 14


15 16 17
# ---------
# Templates
# ---------
André Anjos's avatar
André Anjos committed
18 19 20 21 22 23 24

# Template for the build stage
# Needs to run on all supported architectures, platforms and python versions
.build_template: &build_job
  stage: build
  before_script:
    - git clean -ffdx
25 26 27 28 29
    - mkdir _ci
    - curl --silent "https://gitlab.idiap.ch/bob/bob.admin/raw/master/gitlab/install.sh" > _ci/install.sh
    - chmod 755 _ci/install.sh
    - ./_ci/install.sh _ci #updates
    - ./_ci/before_build.sh
André Anjos's avatar
André Anjos committed
30
  script:
31
    - ./_ci/build.sh
André Anjos's avatar
André Anjos committed
32
  after_script:
33
    - ./_ci/after_build.sh
André Anjos's avatar
André Anjos committed
34
  artifacts:
35
    expire_in: 1 week
André Anjos's avatar
André Anjos committed
36
    paths:
37
      - _ci/
André Anjos's avatar
André Anjos committed
38 39 40 41
      - dist/
      - sphinx/


42
# Template for the test stage - re-installs from uploaded wheels
André Anjos's avatar
André Anjos committed
43 44 45 46
# Needs to run on all supported architectures, platforms and python versions
.test_template: &test_job
  stage: test
  before_script:
47 48
    - ./_ci/install.sh _ci #updates
    - ./_ci/before_test.sh
André Anjos's avatar
André Anjos committed
49
  script:
50
    - ./_ci/test.sh
André Anjos's avatar
André Anjos committed
51
  after_script:
52
    - ./_ci/after_test.sh
André Anjos's avatar
André Anjos committed
53 54 55


# Template for the wheel uploading stage
56
# Needs to run against all combinations of python and operating systems
André Anjos's avatar
André Anjos committed
57 58
.wheels_template: &wheels_job
  stage: wheels
59
  environment: intranet
André Anjos's avatar
André Anjos committed
60 61
  only:
    - master
62
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
André Anjos's avatar
André Anjos committed
63
  before_script:
64 65
    - ./_ci/install.sh _ci #updates
    - ./_ci/before_wheels.sh
André Anjos's avatar
André Anjos committed
66
  script:
67 68 69
    - ./_ci/wheels.sh
  after_script:
    - ./_ci/after_wheels.sh
André Anjos's avatar
André Anjos committed
70 71 72 73 74 75


# Template for (latest) documentation upload stage
# Only one real job needs to do this
.docs_template: &docs_job
  stage: docs
76
  environment: intranet
André Anjos's avatar
André Anjos committed
77 78
  only:
    - master
André Anjos's avatar
André Anjos committed
79
  before_script:
80 81
    - ./_ci/install.sh _ci #updates
    - ./_ci/before_docs.sh
André Anjos's avatar
André Anjos committed
82
  script:
83 84 85
    - ./_ci/docs.sh
  after_script:
    - ./_ci/after_docs.sh
André Anjos's avatar
André Anjos committed
86 87


88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
# Template for the deployment stage - re-installs from uploaded wheels
# Needs to run on a single architecture only
# Will deploy your package to PyPI and other required services
# Only runs for tags
.deploy_template: &deploy_job
  stage: deploy
  environment: internet
  only:
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
  except:
    - branches
  before_script:
    - ./_ci/install.sh _ci #updates
    - ./_ci/before_deploy.sh
  script:
    - ./_ci/deploy.sh
  after_script:
    - ./_ci/after_deploy.sh
André Anjos's avatar
André Anjos committed
106

107 108 109 110 111 112

# -------------
# Build Targets
# -------------

# Linux + Python 2.7: Builds, tests, uploads wheel and deploys (if needed)
André Anjos's avatar
André Anjos committed
113
build_linux_27:
114
  <<: *build_job
André Anjos's avatar
André Anjos committed
115
  variables: &linux_27_build_variables
116
    PYTHON_VERSION: "2.7"
André Anjos's avatar
André Anjos committed
117 118 119 120 121 122 123 124 125 126 127 128 129
  tags:
    - conda-linux

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

wheels_linux_27:
  <<: *wheels_job
130 131 132 133 134 135 136 137 138
  variables: *linux_27_build_variables
  dependencies:
    - build_linux_27
  tags:
    - conda-linux

deploy_linux_27:
  <<: *deploy_job
  variables: *linux_27_build_variables
André Anjos's avatar
André Anjos committed
139 140 141 142 143 144
  dependencies:
    - build_linux_27
  tags:
    - conda-linux


145
# Linux + Python 3.5: Builds, tests and uploads wheel
André Anjos's avatar
André Anjos committed
146
build_linux_35:
147
  <<: *build_job
André Anjos's avatar
André Anjos committed
148
  variables: &linux_35_build_variables
149
    PYTHON_VERSION: "3.5"
André Anjos's avatar
André Anjos committed
150 151 152 153 154 155 156 157 158 159 160 161 162
  tags:
    - conda-linux

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

wheels_linux_35:
  <<: *wheels_job
163
  variables: *linux_35_build_variables
André Anjos's avatar
André Anjos committed
164 165 166 167 168 169 170
  dependencies:
    - build_linux_35
  tags:
    - conda-linux

docs_linux_35:
  <<: *docs_job
171
  variables: *linux_35_build_variables
André Anjos's avatar
André Anjos committed
172 173 174 175 176 177
  dependencies:
    - build_linux_35
  tags:
    - conda-linux


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
# Linux + Python 3.6: Builds and tests
build_linux_36:
  <<: *build_job
  variables: &linux_36_build_variables
    PYTHON_VERSION: "3.6"
  tags:
    - conda-linux

test_linux_36:
  <<: *test_job
  variables: *linux_36_build_variables
  dependencies:
    - build_linux_36
  tags:
    - conda-linux

wheels_linux_36:
  <<: *wheels_job
  variables: *linux_36_build_variables
  dependencies:
    - build_linux_36
  tags:
    - conda-linux


203
# Mac OSX + Python 2.7: Builds and tests
André Anjos's avatar
André Anjos committed
204
build_macosx_27:
205
  <<: *build_job
André Anjos's avatar
André Anjos committed
206
  variables: &macosx_27_build_variables
207
    PYTHON_VERSION: "2.7"
André Anjos's avatar
André Anjos committed
208 209 210 211 212 213 214 215 216 217 218 219 220
  tags:
    - conda-macosx

test_macosx_27:
  <<: *test_job
  variables: *macosx_27_build_variables
  dependencies:
    - build_macosx_27
  tags:
    - conda-macosx

wheels_macosx_27:
  <<: *wheels_job
221
  variables: *macosx_27_build_variables
André Anjos's avatar
André Anjos committed
222 223 224 225 226 227
  dependencies:
    - build_macosx_27
  tags:
    - conda-macosx


228 229
# Mac OSX + Python 3.5: Builds and tests
build_macosx_35:
230
  <<: *build_job
231 232
  variables: &macosx_35_build_variables
    PYTHON_VERSION: "3.5"
André Anjos's avatar
André Anjos committed
233 234 235
  tags:
    - conda-macosx

236
test_macosx_35:
André Anjos's avatar
André Anjos committed
237
  <<: *test_job
238
  variables: *macosx_35_build_variables
André Anjos's avatar
André Anjos committed
239
  dependencies:
240
    - build_macosx_35
André Anjos's avatar
André Anjos committed
241 242 243
  tags:
    - conda-macosx

244
wheels_macosx_35:
André Anjos's avatar
André Anjos committed
245
  <<: *wheels_job
246
  variables: *macosx_35_build_variables
André Anjos's avatar
André Anjos committed
247
  dependencies:
248
    - build_macosx_35
André Anjos's avatar
André Anjos committed
249 250 251 252
  tags:
    - conda-macosx


253 254
# Mac OSX + Python 3.6: Builds and tests
build_macosx_36:
255
  <<: *build_job
256 257
  variables: &macosx_36_build_variables
    PYTHON_VERSION: "3.6"
André Anjos's avatar
André Anjos committed
258 259 260
  tags:
    - conda-macosx

261
test_macosx_36:
André Anjos's avatar
André Anjos committed
262
  <<: *test_job
263
  variables: *macosx_36_build_variables
André Anjos's avatar
André Anjos committed
264
  dependencies:
265
    - build_macosx_36
André Anjos's avatar
André Anjos committed
266 267 268
  tags:
    - conda-macosx

269
wheels_macosx_36:
André Anjos's avatar
André Anjos committed
270
  <<: *wheels_job
271
  variables: *macosx_36_build_variables
André Anjos's avatar
André Anjos committed
272
  dependencies:
273
    - build_macosx_36
André Anjos's avatar
André Anjos committed
274
  tags:
275
    - conda-macosx