.gitlab-ci.yml 8.04 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
  extends: .windows_base_python36
91
  needs: ["windows_wheel_python36"]
Thomas Vincent's avatar
Thomas Vincent committed
92
93

windows_test_python37:
94
  <<: *test_noqt_template_defintion
Thomas Vincent's avatar
Thomas Vincent committed
95
  extends: .windows_base_python37
96
  needs: ["windows_wheel_python37"]
Thomas Vincent's avatar
Thomas Vincent committed
97

98
windows_test_python38:
99
  <<: *test_noqt_template_defintion
100
  extends: .windows_base_python38
101
  needs: ["windows_wheel_python38"]
102

103
104
105
windows_test_python39:
  <<: *test_noqt_template_defintion
  extends: .windows_base_python39
106
  needs: ["windows_wheel_python39"]
107

Thomas Vincent's avatar
Thomas Vincent committed
108

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

Thomas Vincent's avatar
Thomas Vincent committed
124

125
macos_test_python36:
126
  <<: *test_macos_noqt_template_defintion
127
  extends: .macos_base_python36
128
  needs: ["macos_wheel_python36"]
Thomas Vincent's avatar
Thomas Vincent committed
129

130
macos_test_python37:
131
  <<: *test_macos_noqt_template_defintion
132
  extends: .macos_base_python37
133
  needs: ["macos_wheel_python37"]
Thomas Vincent's avatar
Thomas Vincent committed
134

135
macos_test_python38:
136
  <<: *test_macos_noqt_template_defintion
137
  extends: .macos_base_python38
138
  needs: ["macos_wheel_python38"]
139

140
141
142
macos_test_python39:
  <<: *test_macos_noqt_template_defintion
  extends: .macos_base_python39
143
  needs: ["macos_wheel_python39"]
144

Thomas Vincent's avatar
Thomas Vincent committed
145

146
147
148
149
150
151
152
153
154
.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
155
    - pip install --pre --find-links artifacts/ --only-binary silx silx[full,test]
156
157
158
159
160
    - 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
161
162
163

manylinux1_test_cp36:
  <<: *test_template_defintion
164
  extends: .manylinux2014_cp36_base
165
  needs: ["manylinux1_wheels"]
Thomas Vincent's avatar
Thomas Vincent committed
166
167
168

manylinux1_test_cp37:
  <<: *test_template_defintion
169
  extends: .manylinux2014_cp37_base
170
  needs: ["manylinux1_wheels"]
Thomas Vincent's avatar
Thomas Vincent committed
171

172
173
manylinux1_test_cp38:
  <<: *test_template_defintion
174
  extends: .manylinux2014_cp38_base
175
  needs: ["manylinux1_wheels"]
176

177
178
179
manylinux1_test_cp39:
  <<: *test_template_defintion
  extends: .manylinux2014_cp39_base
180
  needs: ["manylinux1_wheels"]
181

Thomas Vincent's avatar
Thomas Vincent committed
182

183
manylinux2014_test_cp36:
Thomas Vincent's avatar
Thomas Vincent committed
184
  <<: *test_template_defintion
185
  extends: .manylinux2014_cp36_base
186
  needs: ["manylinux2014_wheels"]
Thomas Vincent's avatar
Thomas Vincent committed
187

188
manylinux2014_test_cp37:
Thomas Vincent's avatar
Thomas Vincent committed
189
  <<: *test_template_defintion
190
  extends: .manylinux2014_cp37_base
191
  needs: ["manylinux2014_wheels"]
Thomas Vincent's avatar
Thomas Vincent committed
192

193
manylinux2014_test_cp38:
194
  <<: *test_template_defintion
195
  extends: .manylinux2014_cp38_base
196
  needs: ["manylinux2014_wheels"]
Thomas Vincent's avatar
Thomas Vincent committed
197

198
manylinux2014_test_cp39:
199
  <<: *test_template_defintion
200
  extends: .manylinux2014_cp39_base
201
  needs: ["manylinux2014_wheels"]
202

Thomas Vincent's avatar
Thomas Vincent committed
203

Thomas Vincent's avatar
Thomas Vincent committed
204
205
206
207
208
.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
209
    - pip install --pre --find-links artifacts/ --only-binary numpy,h5py,fabio silx[test]
Thomas Vincent's avatar
Thomas Vincent committed
210
    - 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
211
212
213
214

manylinux2014_ppc64le_test_cp37:
  <<: *test_ppc64le_template_defintion
  extends: .manylinux2014_ppc64le_cp37_base
215
  needs: ["manylinux2014_ppc64le_wheels"]
Thomas Vincent's avatar
Thomas Vincent committed
216
217
218
219

manylinux2014_ppc64le_test_cp38:
  <<: *test_ppc64le_template_defintion
  extends: .manylinux2014_ppc64le_cp38_base
220
  needs: ["manylinux2014_ppc64le_wheels"]
Thomas Vincent's avatar
Thomas Vincent committed
221

222
223
224
manylinux2014_ppc64le_test_cp39:
  <<: *test_ppc64le_template_defintion
  extends: .manylinux2014_ppc64le_cp39_base
225
  needs: ["manylinux2014_ppc64le_wheels"]
226

Thomas Vincent's avatar
Thomas Vincent committed
227

228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# 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
248
    - pip install --upgrade numpy pybind11
249
250
    # 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
251
    - pip install hdf5plugin
Thomas Vincent's avatar
Thomas Vincent committed
252
    - pip install .[full,test]
253
    # Install pyinstaller
254
    - pip install pyinstaller
255
256
257
258
259
260
    # Generate fat binary
    - cd package
    - cd windows
    - pyinstaller pyinstaller.spec
    - cd dist
    - dir
Thomas Vincent's avatar
Thomas Vincent committed
261
262
    - python -m zipfile -c %BOB_WINDOWS_APPLICATION% silx
    - xcopy %BOB_WINDOWS_APPLICATION% "..\\..\\..\\..\\..\\artifacts"
263
    - cd ..
264
265
266
267
    - cd artifacts
    - dir
    - xcopy "*.exe" "..\\..\\..\\..\\..\\artifacts"
    - cd ..
268
269
270
271
272
273
274
275
276
277
    - cd ..
    - cd ..
  artifacts:
    paths:
      - "artifacts"
    when: on_success
    expire_in: 8h


windows_test_exe:
Thomas Vincent's avatar
Thomas Vincent committed
278
  stage: test
279
280
281
282
283
  extends: .windows_base_python37
  script:
    - rd /s /q silx
    - python -m zipfile -e "artifacts\\silx-windows-application.zip" .
    - cd silx
284
285
286
    - silx-view.exe
    - timeout 10
    - taskkill /IM "silx-view.exe" /F
287
288
    - cd ..
    - rmdir silx /s /q
289
  needs: ["windows_exe"]
290
  allow_failure: true
291
292


Thomas Vincent's avatar
Thomas Vincent committed
293
294
295
# Deploy

pages:
296
  extends: .pages