-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
245 lines (206 loc) · 5.46 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
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
# Definition of global variables (all stages)
variables:
PYTHONUNBUFFERED: "1"
CONDA_ROOT: "${CI_PROJECT_DIR}/miniconda"
XDG_CACHE_HOME: "${CI_PROJECT_DIR}/cache"
before_script:
- python3 ./bob/devtools/bootstrap.py -vv build
- source ${CONDA_ROOT}/etc/profile.d/conda.sh
- conda activate base
# Definition of our build pipeline order
stages:
- qa
- build
- deploy
- pypi
# Build targets
.build_template:
stage: build
artifacts:
expire_in: 1 week
cache:
paths:
- miniconda.sh
- cache/pre-commit
.build_linux_template:
extends: .build_template
variables:
BUILD_EGG: "true"
tags:
- bob
- docker
image: quay.io/condaforge/linux-anvil-cos7-x86_64
before_script:
- git config --global --add safe.directory ${CI_PROJECT_DIR}
- python3 ./bob/devtools/bootstrap.py -vv build
- source ${CONDA_ROOT}/etc/profile.d/conda.sh
- conda activate base
artifacts:
paths:
- dist/*.zip
- sphinx
- ${CONDA_ROOT}/conda-bld/linux-64/*.conda
- ${CONDA_ROOT}/conda-bld/noarch/*.conda
- ${CONDA_ROOT}/conda-bld/linux-64/*.tar.bz2
- ${CONDA_ROOT}/conda-bld/noarch/*.tar.bz2
cache:
key: "linux-cache"
.build_macos_intel_template:
extends: .build_template
tags:
- bob
- macos
- intel
artifacts:
paths:
- ${CONDA_ROOT}/conda-bld/osx-64/*.conda
- ${CONDA_ROOT}/conda-bld/osx-64/*.tar.bz2
cache:
key: "macos-intel-cache"
.build_macos_arm_template:
extends: .build_template
tags:
- macos
- arm
artifacts:
paths:
- ${CONDA_ROOT}/conda-bld/osx-arm64/*.conda
- ${CONDA_ROOT}/conda-bld/osx-arm64/*.tar.bz2
cache:
key: "macos-arm-cache"
code_quality:
tags:
- docker
stage: qa
image: quay.io/condaforge/linux-anvil-cos7-x86_64
cache:
key: "$CI_JOB_STAGE"
paths:
- cache/pre-commit
before_script:
- git config --global --add safe.directory ${CI_PROJECT_DIR}
script:
- sudo yum install -y git python3-pip
- pip3 install pre-commit
- pre-commit run --all-files --show-diff-on-failure
build_linux_bob_devel:
extends: .build_linux_template
variables:
# The version of cuda at Idiap
CONDA_OVERRIDE_CUDA: "11.6"
# run bob-devel test only when bob/devtools/data/conda_build_config.yaml changes
only:
changes:
- bob/devtools/data/conda_build_config.yaml
script:
- sudo yum install -y mesa-libGL-devel # need this for pyopengl
- python3 ./bob/devtools/build.py -vv build-bob-devel
build_linux_deps:
extends: .build_linux_template
# run deps test only when deps changes
only:
changes:
- deps/**/*
script:
- python3 ./bob/devtools/build.py -vv build-deps
build_linux_bob_devtools:
extends: .build_linux_template
script:
- python3 ./bob/devtools/build.py -vv build-devtools --twine-check
build_macos_intel_bob_devel:
extends: .build_macos_intel_template
# run bob-devel test only when bob/devtools/data/conda_build_config.yaml changes
only:
changes:
- bob/devtools/data/conda_build_config.yaml
script:
- python3 ./bob/devtools/build.py -vv build-bob-devel
build_macos_arm_bob_devel:
extends: .build_macos_arm_template
# run bob-devel test only when bob/devtools/data/conda_build_config.yaml changes
only:
changes:
- bob/devtools/data/conda_build_config.yaml
script:
- python3 ./bob/devtools/build.py -vv build-bob-devel
build_macos_intel_deps:
extends: .build_macos_intel_template
# run deps test only when deps changes
only:
changes:
- deps/**/*
script:
- python3 ./bob/devtools/build.py -vv build-deps
build_macos_arm_deps:
extends: .build_macos_arm_template
# run deps test only when deps changes
only:
changes:
- deps/**/*
script:
- python3 ./bob/devtools/build.py -vv build-deps
build_macos_intel_bob_devtools:
extends: .build_macos_intel_template
script:
- python3 ./bob/devtools/build.py -vv build-devtools
build_macos_arm_bob_devtools:
extends: .build_macos_arm_template
script:
- python3 ./bob/devtools/build.py -vv build-devtools
# Deploy targets
.release_template:
image: quay.io/condaforge/linux-anvil-cos7-x86_64
before_script:
- git config --global --add safe.directory ${CI_PROJECT_DIR}
- python3 ./bob/devtools/bootstrap.py -vv local base
- source ${CONDA_ROOT}/etc/profile.d/conda.sh
- conda activate base
after_script:
- python3 ./bob/devtools/bootstrap.py -vv local base
- source ${CONDA_ROOT}/etc/profile.d/conda.sh
- conda activate base
- bdt ci clean -vv
dependencies:
- build_linux_bob_devel
- build_linux_deps
- build_linux_bob_devtools
- build_macos_intel_bob_devel
- build_macos_intel_deps
- build_macos_intel_bob_devtools
- build_macos_arm_bob_devel
- build_macos_arm_deps
- build_macos_arm_bob_devtools
tags:
- docker
- bob
cache:
paths:
- miniconda.sh
.deploy_template:
extends: .release_template
stage: deploy
script:
- bdt ci base-deploy -vv
- bdt ci deploy -vv
deploy_beta:
extends: .deploy_template
environment: beta
only:
- master
deploy_stable:
extends: .deploy_template
environment: stable
only:
- /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
except:
- branches
pypi:
extends: .release_template
stage: pypi
environment: pypi
only:
- /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
except:
- branches
script:
- bdt ci pypi -vv dist/*.zip