.gitlab-ci.yml 3.52 KB
Newer Older
André Anjos's avatar
André Anjos committed
1
2
3
4
5
6
7
8
9
# This build file 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.

# Definition of global variables (all stages)
variables:
  CONDA_ROOT: "${CI_PROJECT_DIR}/miniconda"


# Definition of our build pipeline order
Philip ABBET's avatar
Philip ABBET committed
10
stages:
André Anjos's avatar
André Anjos committed
11
12
  - build
  - docker
André Anjos's avatar
André Anjos committed
13
14
  - deploy
  - pypi
Philip ABBET's avatar
Philip ABBET committed
15

André Anjos's avatar
André Anjos committed
16

André Anjos's avatar
André Anjos committed
17
18
# Build targets
.build_template: &build_job
André Anjos's avatar
André Anjos committed
19
  stage: build
Philip ABBET's avatar
Philip ABBET committed
20
  before_script:
André Anjos's avatar
André Anjos committed
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
    - 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 master #installs ci support scripts
    - ./_ci/before_build.sh
  script:
    - ./_ci/build.sh
  after_script:
    - ./_ci/after_build.sh
  cache: &build_caches
    paths:
      - miniconda.sh
      - ${CONDA_ROOT}/pkgs/*.tar.bz2
      - ${CONDA_ROOT}/pkgs/urls.txt


.build_linux_template: &linux_build_job
  <<: *build_job
  tags:
    - docker
  image: continuumio/conda-concourse-ci
  artifacts:
    expire_in: 1 week
    paths:
      - _ci/
      - ${CONDA_ROOT}/conda-bld/linux-64/*.tar.bz2
  cache:
    <<: *build_caches
    key: "linux-cache"


.build_macosx_template: &macosx_build_job
  <<: *build_job
  tags:
    - macosx
  artifacts:
    expire_in: 1 week
    paths:
      - _ci/
      - ${CONDA_ROOT}/conda-bld/osx-64/*.tar.bz2
  cache:
    <<: *build_caches
    key: "macosx-cache"


# Docker host based testing (must be run inside dind or docker-enabled host)
.docker_test_linux_template: &linux_docker_job
André Anjos's avatar
André Anjos committed
68
  stage: docker
André Anjos's avatar
André Anjos committed
69
70
71
72
73
74
75
76
77
78
79
80
81
82
  before_script:
    # safe keep artifacts as before_build.sh will erase those...
    - mv ${CONDA_ROOT}/conda-bld .
    - ./_ci/install.sh _ci master #updates ci support scripts
    - ./_ci/before_build.sh
    - mv conda-bld ${CONDA_ROOT}
    - ./scripts/before_test.sh
  script:
    - export BEAT_DOCKER_TESTS=true
    - BOB_TEST_ONLY=true ./_ci/build.sh
  after_script:
    - ./_ci/after_build.sh


83
84
85
86
87
88
build_linux_27:
  <<: *linux_build_job
  variables:
    PYTHON_VERSION: "2.7"


André Anjos's avatar
André Anjos committed
89
90
91
92
93
94
95
96
97
98
99
100
101
102
build_linux_36:
  <<: *linux_build_job
  variables:
    PYTHON_VERSION: "3.6"
    BUILD_EGG: "true"
  artifacts:
    expire_in: 1 week
    paths:
      - _ci/
      - dist/*.zip
      - sphinx
      - ${CONDA_ROOT}/conda-bld/linux-64/*.tar.bz2


103
104
105
106
107
build_macosx_27:
  <<: *macosx_build_job
  variables:
    PYTHON_VERSION: "2.7"

André Anjos's avatar
André Anjos committed
108
109
110
111
112
113
114
115

build_macosx_36:
  <<: *macosx_build_job
  variables:
    PYTHON_VERSION: "3.6"


# Docker host based testing
116
117
118
119
120
121
122
123
docker_linux_27:
  <<: *linux_docker_job
  variables:
    PYTHON_VERSION: "2.7"
  dependencies:
    - build_linux_27
  tags:
    - docker-build
André Anjos's avatar
André Anjos committed
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143


docker_linux_36:
  <<: *linux_docker_job
  variables:
    PYTHON_VERSION: "3.6"
  dependencies:
    - build_linux_36
  tags:
    - docker-build


# Deploy targets
.deploy_template: &deploy_job
  stage: deploy
  before_script:
    - ./_ci/install.sh _ci master #updates ci support scripts
  script:
    - ./_ci/deploy.sh
  dependencies:
144
    - build_linux_27
André Anjos's avatar
André Anjos committed
145
    - build_linux_36
146
    - build_macosx_27
André Anjos's avatar
André Anjos committed
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
    - build_macosx_36
  tags:
    - deployer


deploy_beta:
  <<: *deploy_job
  environment: beta
  only:
    - 1.4.x


deploy_stable:
  <<: *deploy_job
  environment: stable
  only:
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
  except:
    - branches


pypi:
  stage: pypi
  environment: pypi
  only:
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
  except:
    - branches
  before_script:
    - ./_ci/install.sh _ci master #updates ci support scripts
André Anjos's avatar
André Anjos committed
177
  script:
André Anjos's avatar
André Anjos committed
178
179
180
    - ./_ci/pypi.sh
  dependencies:
    - build_linux_36
André Anjos's avatar
André Anjos committed
181
  tags:
André Anjos's avatar
André Anjos committed
182
    - deployer