.gitlab-ci.yml 8.19 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"
Thomas Vincent's avatar
Thomas Vincent committed
17
  MANYLINUX_PYTHON_VER: 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
49
debian10:
  extends: .debian10
Thomas Vincent's avatar
Thomas Vincent committed
50
51


Thomas Vincent's avatar
Thomas Vincent committed
52
53
54
ubuntu20.04:
  extends: .ubuntu_20_04

Thomas Vincent's avatar
Thomas Vincent committed
55
56
ubuntu20.04_ppc64le:
  extends: .ubuntu_20_04_ppc64le
57
  allow_failure: true
Thomas Vincent's avatar
Thomas Vincent committed
58

Thomas Vincent's avatar
Thomas Vincent committed
59

Thomas Vincent's avatar
Thomas Vincent committed
60
61
62
63
64
65
macos_wheel_python36:
  extends: .macos_wheel_python36

macos_wheel_python37:
  extends: .macos_wheel_python37

66
67
68
macos_wheel_python38:
  extends: .macos_wheel_python38

69
70
71
macos_wheel_python39:
  extends: .macos_wheel_python39

Thomas Vincent's avatar
Thomas Vincent committed
72

Thomas Vincent's avatar
Thomas Vincent committed
73
74
# Test

75
.test_noqt_template: &test_noqt_template_defintion
Thomas Vincent's avatar
Thomas Vincent committed
76
77
  stage: test
  variables:
78
    WITH_QT_TEST: "False"
Thomas Vincent's avatar
Thomas Vincent committed
79
  script:
80
81
    # Install pyopencl build dependencies first
    - pip install numpy pybind11
82
    # Install pyopencl first to use a wheel from silx.org under Windows
83
    - 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
84
    - pip install --pre --find-links artifacts/ --only-binary silx silx[full,test]
Thomas Vincent's avatar
Thomas Vincent committed
85
86
87
88
    - python -c "import silx.test, sys; sys.exit(silx.test.run_tests());"


windows_test_python36:
89
  <<: *test_noqt_template_defintion
Thomas Vincent's avatar
Thomas Vincent committed
90
91
92
93
94
  extends: .windows_base_python36
  dependencies:
    - windows_wheel_python36

windows_test_python37:
95
  <<: *test_noqt_template_defintion
Thomas Vincent's avatar
Thomas Vincent committed
96
97
98
99
  extends: .windows_base_python37
  dependencies:
    - windows_wheel_python37

100
windows_test_python38:
101
  <<: *test_noqt_template_defintion
102
103
104
105
  extends: .windows_base_python38
  dependencies:
    - windows_wheel_python38

106
107
108
109
110
111
windows_test_python39:
  <<: *test_noqt_template_defintion
  extends: .windows_base_python39
  dependencies:
    - windows_wheel_python39

Thomas Vincent's avatar
Thomas Vincent committed
112

113
114
115
116
117
118
119
120
121
122
.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
123
    - pip install pyqt5==5.13.2
Thomas Vincent's avatar
Thomas Vincent committed
124
    - pip install --pre --find-links artifacts/ --only-binary silx silx[full,test]
125
    # Do not run GUI tests and OpenCL ones
126
    - python -c "import silx.test, sys; sys.exit(silx.test.run_tests());"
127

Thomas Vincent's avatar
Thomas Vincent committed
128

129
macos_test_python36:
130
  <<: *test_macos_noqt_template_defintion
131
  extends: .macos_base_python36
132
133
  dependencies:
    - macos_wheel_python36
Thomas Vincent's avatar
Thomas Vincent committed
134

135
macos_test_python37:
136
  <<: *test_macos_noqt_template_defintion
137
  extends: .macos_base_python37
138
139
  dependencies:
    - macos_wheel_python37
Thomas Vincent's avatar
Thomas Vincent committed
140

141
macos_test_python38:
142
  <<: *test_macos_noqt_template_defintion
143
  extends: .macos_base_python38
144
145
  dependencies:
    - macos_wheel_python38
146

147
148
149
150
151
152
macos_test_python39:
  <<: *test_macos_noqt_template_defintion
  extends: .macos_base_python39
  dependencies:
    - macos_wheel_python39

Thomas Vincent's avatar
Thomas Vincent committed
153

154
155
156
157
158
159
160
161
162
.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
Thomas Vincent's avatar
Thomas Vincent committed
163
    - pip install --pre --find-links artifacts/ --only-binary silx silx[full,test]
164
165
166
167
168
    - 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
169
170
171

manylinux1_test_cp36:
  <<: *test_template_defintion
172
  extends: .manylinux2014_cp36_base
Thomas Vincent's avatar
Thomas Vincent committed
173
174
175
176
177
  dependencies:
    - manylinux1_wheels

manylinux1_test_cp37:
  <<: *test_template_defintion
178
  extends: .manylinux2014_cp37_base
Thomas Vincent's avatar
Thomas Vincent committed
179
180
181
  dependencies:
    - manylinux1_wheels

182
183
manylinux1_test_cp38:
  <<: *test_template_defintion
184
  extends: .manylinux2014_cp38_base
185
186
  dependencies:
    - manylinux1_wheels
187

188
189
190
191
192
193
manylinux1_test_cp39:
  <<: *test_template_defintion
  extends: .manylinux2014_cp39_base
  dependencies:
    - manylinux1_wheels

Thomas Vincent's avatar
Thomas Vincent committed
194

195
manylinux2014_test_cp36:
Thomas Vincent's avatar
Thomas Vincent committed
196
  <<: *test_template_defintion
197
  extends: .manylinux2014_cp36_base
Thomas Vincent's avatar
Thomas Vincent committed
198
  dependencies:
199
    - manylinux2014_wheels
Thomas Vincent's avatar
Thomas Vincent committed
200

201
manylinux2014_test_cp37:
Thomas Vincent's avatar
Thomas Vincent committed
202
  <<: *test_template_defintion
203
  extends: .manylinux2014_cp37_base
Thomas Vincent's avatar
Thomas Vincent committed
204
  dependencies:
205
    - manylinux2014_wheels
Thomas Vincent's avatar
Thomas Vincent committed
206

207
manylinux2014_test_cp38:
208
  <<: *test_template_defintion
209
  extends: .manylinux2014_cp38_base
210
  dependencies:
211
    - manylinux2014_wheels
Thomas Vincent's avatar
Thomas Vincent committed
212

213
manylinux2014_test_cp39:
214
  <<: *test_template_defintion
215
216
217
218
  extends: .manylinux2014_cp39_base
  dependencies:
    - manylinux2014_wheels

Thomas Vincent's avatar
Thomas Vincent committed
219

Thomas Vincent's avatar
Thomas Vincent committed
220
221
222
223
224
.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
225
    - pip install --pre --find-links artifacts/ --only-binary numpy,h5py,fabio silx[test]
Thomas Vincent's avatar
Thomas Vincent committed
226
    - python -c "import silx, silx.test, os, sys; path=os.path.dirname(silx.__file__); sys.exit(silx.test.run_tests(args=['--ignore=%s/app' % path, '--ignore=%s/gui' % path, '--ignore=%s/opencl' % path, '--ignore=%s/test/test_sx.py' % path]));"
Thomas Vincent's avatar
Thomas Vincent committed
227
228
229
230
231
232
233
234
235
236
237
238
239

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

240
241
242
243
244
245
manylinux2014_ppc64le_test_cp39:
  <<: *test_ppc64le_template_defintion
  extends: .manylinux2014_ppc64le_cp39_base
  dependencies:
    - manylinux2014_ppc64le_wheels

Thomas Vincent's avatar
Thomas Vincent committed
246

247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# 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
267
    - pip install --upgrade numpy pybind11
268
269
    # 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
Thomas Vincent's avatar
Thomas Vincent committed
270
    - pip install .[full,test]
271
    # Install pyinstaller
272
    - pip install pyinstaller==4.1
273
274
275
276
277
278
279
280
281
    # 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
282
283
    - python -m zipfile -c %BOB_WINDOWS_APPLICATION% silx
    - xcopy %BOB_WINDOWS_APPLICATION% "..\\..\\..\\..\\..\\artifacts"
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
    - 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
305
  allow_failure: true
306
307


Thomas Vincent's avatar
Thomas Vincent committed
308
309
310
# Deploy

pages:
311
  extends: .pages