.gitlab-ci.yml 8.65 KB
Newer Older
Thomas Vincent's avatar
Thomas Vincent committed
1
include:
Thomas Vincent's avatar
Thomas Vincent committed
2
  - remote: 'https://gitlab.esrf.fr/silx/bob/main/raw/master/job-templates.yml'
Thomas Vincent's avatar
Thomas Vincent committed
3

Thomas Vincent's avatar
Thomas Vincent committed
4
5
6
7
8
9
10
11

stages:
  - build_source
  - build
  - test
  - deploy


Thomas Vincent's avatar
Thomas Vincent committed
12
13
14
15
variables:
  PROJECT: silx
  REPOSITORY: https://github.com/silx-kit/silx
  SILX_OPENCL: "False"
16
  EXTRA_SETUP_PY_CMD_OPTIONS: "build --no-openmp"
17
  MANYLINUX_PYTHON_VER: cp35-cp35m cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39
Thomas Vincent's avatar
Thomas Vincent committed
18
  BOB_WINDOWS_APPLICATION: "silx-windows-application.zip"
Thomas Vincent's avatar
Thomas Vincent committed
19

Thomas Vincent's avatar
Thomas Vincent committed
20

Thomas Vincent's avatar
Thomas Vincent committed
21
source:
Thomas Vincent's avatar
Thomas Vincent committed
22
  extends: .source_build
Thomas Vincent's avatar
Thomas Vincent committed
23

Thomas Vincent's avatar
Thomas Vincent committed
24

Thomas Vincent's avatar
Thomas Vincent committed
25
26
27
manylinux1_wheels:
  extends: .manylinux1_wheels

28
29
manylinux2014_wheels:
  extends: .manylinux2014_wheels
Thomas Vincent's avatar
Thomas Vincent committed
30

Thomas Vincent's avatar
Thomas Vincent committed
31
32
33
manylinux2014_ppc64le_wheels:
  extends: .manylinux2014_ppc64le_wheels

Thomas Vincent's avatar
Thomas Vincent committed
34

Thomas Vincent's avatar
Thomas Vincent committed
35
windows_wheel_python36:
Thomas Vincent's avatar
Thomas Vincent committed
36
  extends: .windows_wheel_python36
Thomas Vincent's avatar
Thomas Vincent committed
37

Thomas Vincent's avatar
Thomas Vincent committed
38
windows_wheel_python37:
Thomas Vincent's avatar
Thomas Vincent committed
39
  extends: .windows_wheel_python37
40
41
42
  
windows_wheel_python38:
  extends: .windows_wheel_python38
Thomas Vincent's avatar
Thomas Vincent committed
43

44
45
46
windows_wheel_python39:
  extends: .windows_wheel_python39

Thomas Vincent's avatar
Thomas Vincent committed
47

Thomas Vincent's avatar
Thomas Vincent committed
48
debian9:
Thomas Vincent's avatar
Thomas Vincent committed
49
  extends: .debian9
Thomas Vincent's avatar
Thomas Vincent committed
50

Thomas Vincent's avatar
Thomas Vincent committed
51
52
53

debian10:
  extends: .debian10
Thomas Vincent's avatar
Thomas Vincent committed
54
55


Thomas Vincent's avatar
Thomas Vincent committed
56
57
58
ubuntu20.04:
  extends: .ubuntu_20_04

Thomas Vincent's avatar
Thomas Vincent committed
59
60
61
ubuntu20.04_ppc64le:
  extends: .ubuntu_20_04_ppc64le

Thomas Vincent's avatar
Thomas Vincent committed
62

Thomas Vincent's avatar
Thomas Vincent committed
63
64
65
66
67
68
69
70
71
macos_wheel_python35:
  extends: .macos_wheel_python35

macos_wheel_python36:
  extends: .macos_wheel_python36

macos_wheel_python37:
  extends: .macos_wheel_python37

72
73
74
macos_wheel_python38:
  extends: .macos_wheel_python38

75
76
77
macos_wheel_python39:
  extends: .macos_wheel_python39

Thomas Vincent's avatar
Thomas Vincent committed
78

Thomas Vincent's avatar
Thomas Vincent committed
79
80
# Test

81
.test_noqt_template: &test_noqt_template_defintion
Thomas Vincent's avatar
Thomas Vincent committed
82
83
  stage: test
  variables:
84
    WITH_QT_TEST: "False"
Thomas Vincent's avatar
Thomas Vincent committed
85
  script:
86
87
    # Install pyopencl build dependencies first
    - pip install numpy pybind11
88
    # Install pyopencl first to use a wheel from silx.org under Windows
89
    - pip install --find-links http://www.silx.org/pub/wheelhouse/ --trusted-host www.silx.org --prefer-binary pyopencl
Thomas Vincent's avatar
Thomas Vincent committed
90
91
92
93
94
    - pip install --pre --find-links artifacts/ --only-binary silx silx[full]
    - python -c "import silx.test, sys; sys.exit(silx.test.run_tests());"


windows_test_python36:
95
  <<: *test_noqt_template_defintion
Thomas Vincent's avatar
Thomas Vincent committed
96
97
98
  extends: .windows_base_python36
  dependencies:
    - windows_wheel_python36
99
  allow_failure: true
Thomas Vincent's avatar
Thomas Vincent committed
100
101

windows_test_python37:
102
  <<: *test_noqt_template_defintion
Thomas Vincent's avatar
Thomas Vincent committed
103
104
105
  extends: .windows_base_python37
  dependencies:
    - windows_wheel_python37
106
  allow_failure: true
Thomas Vincent's avatar
Thomas Vincent committed
107

108
windows_test_python38:
109
  <<: *test_noqt_template_defintion
110
111
112
  extends: .windows_base_python38
  dependencies:
    - windows_wheel_python38
113
  allow_failure: true
114

115
116
117
118
119
120
121
windows_test_python39:
  <<: *test_noqt_template_defintion
  extends: .windows_base_python39
  dependencies:
    - windows_wheel_python39
  allow_failure: true

Thomas Vincent's avatar
Thomas Vincent committed
122

123
124
125
126
127
128
129
130
131
132
133
134
135
136
.test_macos_noqt_template: &test_macos_noqt_template_defintion
  stage: test
  variables:
    WITH_QT_TEST: "False"
  script:
    # Install pyopencl build dependencies first
    - pip install numpy pybind11
    # Install pyopencl first to use a wheel from silx.org under Windows
    - pip install --find-links http://www.silx.org/pub/wheelhouse/ --trusted-host www.silx.org --prefer-binary pyopencl
    # Install latest compatible version of PyQt5 with macos 10.12
    - pip install pyqt5==5.15.0
    - pip install --pre --find-links artifacts/ --only-binary silx silx[full]
    - python -c "import silx.test, sys; sys.exit(silx.test.run_tests());"

137
macos_test_python35:
138
  <<: *test_macos_noqt_template_defintion
139
  extends: .macos_base_python35
140
141
  dependencies:
    - macos_wheel_python35
Thomas Vincent's avatar
Thomas Vincent committed
142

143
macos_test_python36:
144
  <<: *test_macos_noqt_template_defintion
145
  extends: .macos_base_python36
146
147
  dependencies:
    - macos_wheel_python36
Thomas Vincent's avatar
Thomas Vincent committed
148

149
macos_test_python37:
150
  <<: *test_macos_noqt_template_defintion
151
  extends: .macos_base_python37
152
153
  dependencies:
    - macos_wheel_python37
Thomas Vincent's avatar
Thomas Vincent committed
154

155
macos_test_python38:
156
  <<: *test_macos_noqt_template_defintion
157
  extends: .macos_base_python38
158
159
  dependencies:
    - macos_wheel_python38
160

161
162
163
164
165
166
macos_test_python39:
  <<: *test_macos_noqt_template_defintion
  extends: .macos_base_python39
  dependencies:
    - macos_wheel_python39

Thomas Vincent's avatar
Thomas Vincent committed
167

168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
.test_template: &test_template_defintion
  stage: test
  variables:
    WITH_GL_TEST: "False"
  script:
    # Install pyopencl build dependencies first
    - pip install numpy pybind11
    # Install pyopencl first to use a wheel from silx.org under Windows
    - pip install --find-links http://www.silx.org/pub/wheelhouse/ --trusted-host www.silx.org --prefer-binary pyopencl
    - pip install --pre --find-links artifacts/ --only-binary silx silx[full]
    - python -c "import silx.test, sys; sys.exit(silx.test.run_tests());"
    - pip uninstall -y PyQt5
    - pip install PySide2
    - python -c "import silx.test, sys; sys.exit(silx.test.run_tests());"

Thomas Vincent's avatar
Thomas Vincent committed
183
184
manylinux1_test_cp35:
  <<: *test_template_defintion
185
  extends: .manylinux2014_cp35_base
Thomas Vincent's avatar
Thomas Vincent committed
186
187
188
189
190
  dependencies:
    - manylinux1_wheels

manylinux1_test_cp36:
  <<: *test_template_defintion
191
  extends: .manylinux2014_cp36_base
Thomas Vincent's avatar
Thomas Vincent committed
192
193
194
195
196
  dependencies:
    - manylinux1_wheels

manylinux1_test_cp37:
  <<: *test_template_defintion
197
  extends: .manylinux2014_cp37_base
Thomas Vincent's avatar
Thomas Vincent committed
198
199
200
  dependencies:
    - manylinux1_wheels

201
202
manylinux1_test_cp38:
  <<: *test_template_defintion
203
  extends: .manylinux2014_cp38_base
204
205
  dependencies:
    - manylinux1_wheels
206

207
208
209
210
211
212
manylinux1_test_cp39:
  <<: *test_template_defintion
  extends: .manylinux2014_cp39_base
  dependencies:
    - manylinux1_wheels

Thomas Vincent's avatar
Thomas Vincent committed
213

214
manylinux2014_test_cp35:
Thomas Vincent's avatar
Thomas Vincent committed
215
  <<: *test_template_defintion
216
  extends: .manylinux2014_cp35_base
Thomas Vincent's avatar
Thomas Vincent committed
217
  dependencies:
218
    - manylinux2014_wheels
Thomas Vincent's avatar
Thomas Vincent committed
219

220
manylinux2014_test_cp36:
Thomas Vincent's avatar
Thomas Vincent committed
221
  <<: *test_template_defintion
222
  extends: .manylinux2014_cp36_base
Thomas Vincent's avatar
Thomas Vincent committed
223
  dependencies:
224
    - manylinux2014_wheels
Thomas Vincent's avatar
Thomas Vincent committed
225

226
manylinux2014_test_cp37:
Thomas Vincent's avatar
Thomas Vincent committed
227
  <<: *test_template_defintion
228
  extends: .manylinux2014_cp37_base
Thomas Vincent's avatar
Thomas Vincent committed
229
  dependencies:
230
    - manylinux2014_wheels
Thomas Vincent's avatar
Thomas Vincent committed
231

232
manylinux2014_test_cp38:
233
  <<: *test_template_defintion
234
  extends: .manylinux2014_cp38_base
235
  dependencies:
236
    - manylinux2014_wheels
Thomas Vincent's avatar
Thomas Vincent committed
237

238
239
240
241
242
243
manylinux2014_test_cp39:
  <<: *test_template_defintion
  extends: .manylinux2014_cp39_base
  dependencies:
    - manylinux2014_wheels

Thomas Vincent's avatar
Thomas Vincent committed
244

Thomas Vincent's avatar
Thomas Vincent committed
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
.test_ppc64le_template: &test_ppc64le_template_defintion
  stage: test
  script:
    # Pre-install numpy, h5py and fabio from silx.org
    - pip install --pre --trusted-host www.silx.org --find-links http://www.silx.org/pub/wheelhouse/ --only-binary numpy,h5py,fabio numpy h5py fabio
    - pip install --pre --find-links artifacts/ --only-binary numpy,h5py,fabio silx
    - python -c "import silx.test, sys; sys.exit(silx.test.run_tests());"

manylinux2014_ppc64le_test_cp37:
  <<: *test_ppc64le_template_defintion
  extends: .manylinux2014_ppc64le_cp37_base
  dependencies:
    - manylinux2014_ppc64le_wheels

manylinux2014_ppc64le_test_cp38:
  <<: *test_ppc64le_template_defintion
  extends: .manylinux2014_ppc64le_cp38_base
  dependencies:
    - manylinux2014_ppc64le_wheels

265
266
267
268
269
270
manylinux2014_ppc64le_test_cp39:
  <<: *test_ppc64le_template_defintion
  extends: .manylinux2014_ppc64le_cp39_base
  dependencies:
    - manylinux2014_ppc64le_wheels

Thomas Vincent's avatar
Thomas Vincent committed
271

272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# Windows fat binary

windows_exe:
  extends: .windows_base_python37
  stage: build
  variables:
    WITH_QT_TEST: "False"
  script:
    # Setup Visual Studio to use
    - call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat" amd64 -vcvars_ver=14.16
    # Prepare source
    - rd /s /q windows_build
    - md windows_build
    - cd windows_build
    - curl -o untar.py https://gitlab.esrf.fr/silx/bob/main/raw/master/untar.py
    - python untar.py "../artifacts/%PROJECT%*.tar.gz"
    - cd %PROJECT%*
    # Install build dependencies
    - pip install --upgrade -r https://gitlab.esrf.fr/silx/bob/main/raw/master/requirements-build.txt
    # Install pyopencl build dependencies first
    - pip install numpy pybind11
    # Install pyopencl first to use a wheel from silx.org under Windows
    - pip install --find-links http://www.silx.org/pub/wheelhouse/ --trusted-host www.silx.org --prefer-binary pyopencl
    - pip install .[full]
296
297
    # Install pyinstaller hooks from the master (Fix issue with v2020.7 concerning pyopengl support)
    - pip install git+https://github.com/pyinstaller/pyinstaller-hooks-contrib.git
298
    # Install pyinstaller
Thomas Vincent's avatar
Thomas Vincent committed
299
    - pip install pyinstaller
300
301
302
303
304
305
306
307
308
    # Generate fat binary
    - cd package
    - cd windows
    - pyinstaller pyinstaller.spec
    - pyinstaller pyinstaller-silx-view.spec
    - cd dist
    - dir
    - xcopy silx-view\silx-view.exe silx
    - xcopy silx-view\silx-view.exe.manifest silx
Thomas Vincent's avatar
Thomas Vincent committed
309
310
    - python -m zipfile -c %BOB_WINDOWS_APPLICATION% silx
    - xcopy %BOB_WINDOWS_APPLICATION% "..\\..\\..\\..\\..\\artifacts"
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
    - cd ..
    - cd ..
    - cd ..
  artifacts:
    paths:
      - "artifacts"
    when: on_success
    expire_in: 8h


windows_test_exe:
  extends: .windows_base_python37
  script:
    - rd /s /q silx
    - python -m zipfile -e "artifacts\\silx-windows-application.zip" .
    - cd silx
    - silx.exe test --no-gui --no-opencl
    - cd ..
    - rmdir silx /s /q
  dependencies:
    - windows_exe


Thomas Vincent's avatar
Thomas Vincent committed
334
335
336
337
# Deploy

pages:
  extends: .pages