.gitlab-ci.yml 6.02 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
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

Thomas Vincent's avatar
Thomas Vincent committed
32
windows_wheel_python36:
Thomas Vincent's avatar
Thomas Vincent committed
33
  extends: .windows_wheel_python36
Thomas Vincent's avatar
Thomas Vincent committed
34

Thomas Vincent's avatar
Thomas Vincent committed
35
windows_wheel_python37:
Thomas Vincent's avatar
Thomas Vincent committed
36
  extends: .windows_wheel_python37
37
38
39
  
windows_wheel_python38:
  extends: .windows_wheel_python38
Thomas Vincent's avatar
Thomas Vincent committed
40
41


Thomas Vincent's avatar
Thomas Vincent committed
42
debian9:
Thomas Vincent's avatar
Thomas Vincent committed
43
  extends: .debian9
Thomas Vincent's avatar
Thomas Vincent committed
44

Thomas Vincent's avatar
Thomas Vincent committed
45
46
47

debian10:
  extends: .debian10
Thomas Vincent's avatar
Thomas Vincent committed
48
49


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


Thomas Vincent's avatar
Thomas Vincent committed
54
55
56
57
58
59
60
61
62
macos_wheel_python35:
  extends: .macos_wheel_python35

macos_wheel_python36:
  extends: .macos_wheel_python36

macos_wheel_python37:
  extends: .macos_wheel_python37

63
64
65
macos_wheel_python38:
  extends: .macos_wheel_python38

Thomas Vincent's avatar
Thomas Vincent committed
66

Thomas Vincent's avatar
Thomas Vincent committed
67
68
# Test

69
.test_noqt_template: &test_noqt_template_defintion
Thomas Vincent's avatar
Thomas Vincent committed
70
71
  stage: test
  variables:
72
    WITH_QT_TEST: "False"
Thomas Vincent's avatar
Thomas Vincent committed
73
  script:
74
75
    # Install pyopencl build dependencies first
    - pip install numpy pybind11
76
    # Install pyopencl first to use a wheel from silx.org under Windows
77
    - 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
78
79
80
81
82
    - 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:
83
  <<: *test_noqt_template_defintion
Thomas Vincent's avatar
Thomas Vincent committed
84
85
86
87
88
  extends: .windows_base_python36
  dependencies:
    - windows_wheel_python36

windows_test_python37:
89
  <<: *test_noqt_template_defintion
Thomas Vincent's avatar
Thomas Vincent committed
90
91
92
93
  extends: .windows_base_python37
  dependencies:
    - windows_wheel_python37

94
windows_test_python38:
95
  <<: *test_noqt_template_defintion
96
97
98
99
  extends: .windows_base_python38
  dependencies:
    - windows_wheel_python38

Thomas Vincent's avatar
Thomas Vincent committed
100

101
macos_test_python35:
102
103
  <<: *test_noqt_template_defintion
  extends: .macos_base_python35
104
105
  dependencies:
    - macos_wheel_python35
Thomas Vincent's avatar
Thomas Vincent committed
106

107
macos_test_python36:
108
109
  <<: *test_noqt_template_defintion
  extends: .macos_base_python36
110
111
  dependencies:
    - macos_wheel_python36
Thomas Vincent's avatar
Thomas Vincent committed
112

113
macos_test_python37:
114
115
  <<: *test_noqt_template_defintion
  extends: .macos_base_python37
116
117
  dependencies:
    - macos_wheel_python37
Thomas Vincent's avatar
Thomas Vincent committed
118

119
macos_test_python38:
120
121
  <<: *test_noqt_template_defintion
  extends: .macos_base_python38
122
123
  dependencies:
    - macos_wheel_python38
124

Thomas Vincent's avatar
Thomas Vincent committed
125

126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
.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
141
142
manylinux1_test_cp35:
  <<: *test_template_defintion
143
  extends: .manylinux2014_cp35_base
Thomas Vincent's avatar
Thomas Vincent committed
144
145
146
147
148
  dependencies:
    - manylinux1_wheels

manylinux1_test_cp36:
  <<: *test_template_defintion
149
  extends: .manylinux2014_cp36_base
Thomas Vincent's avatar
Thomas Vincent committed
150
151
152
153
154
  dependencies:
    - manylinux1_wheels

manylinux1_test_cp37:
  <<: *test_template_defintion
155
  extends: .manylinux2014_cp37_base
Thomas Vincent's avatar
Thomas Vincent committed
156
157
158
  dependencies:
    - manylinux1_wheels

159
160
manylinux1_test_cp38:
  <<: *test_template_defintion
161
  extends: .manylinux2014_cp38_base
162
163
  dependencies:
    - manylinux1_wheels
164

Thomas Vincent's avatar
Thomas Vincent committed
165

166
manylinux2014_test_cp35:
Thomas Vincent's avatar
Thomas Vincent committed
167
  <<: *test_template_defintion
168
  extends: .manylinux2014_cp35_base
Thomas Vincent's avatar
Thomas Vincent committed
169
  dependencies:
170
    - manylinux2014_wheels
Thomas Vincent's avatar
Thomas Vincent committed
171

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

178
manylinux2014_test_cp37:
Thomas Vincent's avatar
Thomas Vincent committed
179
  <<: *test_template_defintion
180
  extends: .manylinux2014_cp37_base
Thomas Vincent's avatar
Thomas Vincent committed
181
  dependencies:
182
    - manylinux2014_wheels
Thomas Vincent's avatar
Thomas Vincent committed
183

184
manylinux2014_test_cp38:
185
  <<: *test_template_defintion
186
  extends: .manylinux2014_cp38_base
187
  dependencies:
188
    - manylinux2014_wheels
Thomas Vincent's avatar
Thomas Vincent committed
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
# 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]
    # Install pyinstaller
Thomas Vincent's avatar
Thomas Vincent committed
216
    - pip install pyinstaller
217
218
219
220
221
222
223
224
225
    # 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
226
227
    - python -m zipfile -c %BOB_WINDOWS_APPLICATION% silx
    - xcopy %BOB_WINDOWS_APPLICATION% "..\\..\\..\\..\\..\\artifacts"
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
    - 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
251
252
253
254
# Deploy

pages:
  extends: .pages