forked from NGSolve/ngsolve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
471 lines (411 loc) · 9.21 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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
stages:
- build
- test
- timings
- cleanup
- deploy
variables:
GIT_SUBMODULE_STRATEGY: recursive
UBUNTU_VERSION_LATEST: "21.10"
UBUNTU_VERSION_LTS: "20.04"
############################################
# Windows
############################################
.template_win: &win
tags:
- windows
- x64
before_script:
- set CI_DIR=C:\ci\%CI_PIPELINE_ID%
- set NG_USE_NATIVE_ARCH=OFF
- call tests\gitlab-ci\win\set_vars.bat
win_build:
<<: *win
stage: build
script:
- call tests\gitlab-ci\win\build.bat
- IF %errorlevel% NEQ 0 exit /b %errorlevel%
- cd %CI_PROJECT_DIR%
- call tests\gitlab-ci\win\upload.bat
- IF %errorlevel% NEQ 0 exit /b %errorlevel%
win_test:
<<: *win
stage: test
script:
- call tests\gitlab-ci\win\test.bat
- IF %errorlevel% NEQ 0 exit /b %errorlevel%
needs: ["win_build"]
win_cleanup:
<<: *win
stage: cleanup
script:
- call tests\gitlab-ci\win\cleanup.bat
when: always
allow_failure: true
needs: ["win_test"]
.template_win_avx: &win_avx
tags:
- windows
- x64
before_script:
- set CI_DIR=C:\ci\%CI_PIPELINE_ID%_avx
- set NG_USE_NATIVE_ARCH=ON
- call tests\gitlab-ci\win\set_vars.bat
only:
- schedules
- tags
win_avx_build:
<<: *win_avx
stage: build
script:
- call tests\gitlab-ci\win\build.bat
- IF %errorlevel% NEQ 0 exit /b %errorlevel%
win_avx_test:
<<: *win_avx
stage: test
script:
- call tests\gitlab-ci\win\test.bat
needs: ["win_avx_build"]
win_avx_cleanup:
<<: *win_avx
stage: cleanup
script:
- call tests\gitlab-ci\win\cleanup.bat
when: always
allow_failure: true
needs: ["win_avx_test"]
############################################
# Linux
############################################
.template_ubuntu: &ubuntu
tags:
- linux
- docker
- avx
- bash
.template_ubuntu_avx: &ubuntu_avx
<<: *ubuntu
variables:
IMAGE_NAME: "avx"
UBUNTU_VERSION: $UBUNTU_VERSION_LTS
only:
- schedules
- tags
.template_ubuntu_avx512: &ubuntu_avx512
tags:
- docker
- avx512
variables:
IMAGE_NAME: "avx512"
UBUNTU_VERSION: $UBUNTU_VERSION_LTS
.template_ubuntu_debug: &ubuntu_debug
<<: *ubuntu
variables:
IMAGE_NAME: "debug"
UBUNTU_VERSION: $UBUNTU_VERSION_LTS
.template_ubuntu_mpi: &ubuntu_mpi
<<: *ubuntu
variables:
IMAGE_NAME: "mpi"
UBUNTU_VERSION: $UBUNTU_VERSION_LATEST
.template_build_linux: &build_linux
stage: build
script:
- source tests/gitlab-ci/ubuntu/build.sh
artifacts:
when: always
paths:
- logs/
ubuntu_avx_build:
<<: *ubuntu_avx
<<: *build_linux
.ubuntu_avx512_build:
<<: *ubuntu_avx512
<<: *build_linux
ubuntu_debug_build:
<<: *ubuntu_debug
<<: *build_linux
ubuntu_mpi_build:
<<: *ubuntu_mpi
<<: *build_linux
.template_test_linux: &test_linux
stage: test
script:
- source tests/gitlab-ci/ubuntu/test.sh
ubuntu_avx_test:
<<: *ubuntu_avx
<<: *test_linux
needs: ["ubuntu_avx_build"]
.ubuntu_avx512_test:
<<: *ubuntu_avx512
<<: *test_linux
needs: ["ubuntu_avx512_build"]
ubuntu_debug_test:
<<: *ubuntu_debug
<<: *test_linux
needs: ["ubuntu_debug_build"]
ubuntu_mpi_test:
<<: *ubuntu_mpi
<<: *test_linux
needs: ["ubuntu_mpi_build"]
linux_cleanup:
stage: cleanup
tags:
- linux
- docker
- avx
- bash
script:
- source tests/gitlab-ci/ubuntu/cleanup.sh
when: always
allow_failure: true
.linux_cleanup_avx512:
stage: cleanup
tags:
- docker
- avx512
script:
- source tests/gitlab-ci/ubuntu/cleanup.sh
when: always
allow_failure: true
############################################
# MacOSX
############################################
.template_mac: &mac
tags:
- mac
- x64
before_script:
- source tests/gitlab-ci/mac/set_vars.sh
mac_build:
<<: *mac
stage: build
script:
- source $CI_PROJECT_DIR/tests/gitlab-ci/mac/build.sh
- source $CI_PROJECT_DIR/tests/gitlab-ci/mac/upload.sh
mac_test:
<<: *mac
stage: test
script:
- source tests/gitlab-ci/mac/test.sh
needs: ["mac_build"]
mac_cleanup:
<<: *mac
stage: cleanup
script:
- source tests/gitlab-ci/mac/cleanup.sh
when: always
allow_failure: true
needs: ["mac_test"]
############################################
# Timings stage
############################################
.t_clang: &t_clang
variables:
CMAKE_C_COMPILER: "clang"
CMAKE_CXX_COMPILER: "clang++"
.t_gcc7: &t_gcc7
variables:
CMAKE_C_COMPILER: "gcc-7"
CMAKE_CXX_COMPILER: "g++-7"
.t_gcc6: &t_gcc6
variables:
CMAKE_C_COMPILER: "gcc-6"
CMAKE_CXX_COMPILER: "g++-6"
.t_gcc5: &t_gcc5
variables:
CMAKE_C_COMPILER: "gcc-5"
CMAKE_CXX_COMPILER: "g++-5"
.t_omit_frame_pointer: &t_omit_frame_pointer
before_script:
- export CMAKE_FLAGS="-fomit-frame-pointer"
.t_timings: &t_timings
allow_failure: true
stage: timings
tags:
- linux
- avx2
only:
- triggers
script:
- git submodule update --init --recursive
- mkdir build
- mkdir install
- cd build
- >-
cmake ..
-DUSE_CCACHE=ON
-DCMAKE_INSTALL_PREFIX=$CI_PROJECT_DIR/install
-DUSE_NATIVE_ARCH=ON
-DCMAKE_C_COMPILER=$CMAKE_C_COMPILER
-DCMAKE_CXX_COMPILER=$CMAKE_CXX_COMPILER
-DCMAKE_CXX_FLAGS="-ffast-math $CMAKE_FLAGS"
-DUSE_MKL=ON
-DMKL_ROOT=/opt/intel/mkl
-DCMAKE_BUILD_TYPE=Release
- make -j install
- export NETGENDIR=$CI_PROJECT_DIR/install/bin
- export PATH=$CI_PROJECT_DIR/install/bin:$PATH
- export PYTHONPATH=$CI_PROJECT_DIR/install/lib/python3.6/site-packages:.
- export LD_LIBRARY_PATH=$CI_PROJECT_DIR/install/lib:.:$LD_LIBRARY_PATH
- cd ngsolve
- if [ -n "${RUN_TIMINGS}" ]; then make timings; fi
artifacts:
paths:
- build/ngsolve/tests/timings/results.json
gcc5_timings:
<<: *t_gcc5
<<: *t_timings
gcc6_timings:
<<: *t_gcc6
<<: *t_timings
gcc7_timings:
<<: *t_gcc7
<<: *t_timings
clang_timings:
<<: *t_clang
<<: *t_timings
clang_no_fp_timings:
<<: *t_omit_frame_pointer
<<: *t_clang
<<: *t_timings
############################################
# Deploy stage
############################################
deploy_github:
stage: deploy
tags:
- deploy
script:
- git remote add github [email protected]:NGSolve/ngsolve.git || true
- git remote update
- git checkout --track origin/master
- git pull origin master
- git push github master
only:
- master
deploy_release:
stage: deploy
tags:
- deploy
script:
- git remote add github [email protected]:NGSolve/ngsolve.git || true
- git push github $CI_BUILD_TAG
- source tests/gitlab-ci/deploy/release.sh
only:
- tags
environment: deploy_release
deploy_nightly:
stage: deploy
tags:
- deploy
script:
- source tests/gitlab-ci/deploy/nightly.sh
only:
- schedules
except:
- tags
environment: deploy_nigthly
deploy_win:
stage: deploy
tags:
- deploy
script:
- source tests/gitlab-ci/deploy/win.sh
when: manual
needs: ["win_build"]
deploy_mac:
stage: deploy
tags:
- deploy
script:
- source tests/gitlab-ci/deploy/mac.sh
when: manual
needs: ["mac_build"]
############################################
# Conda package builds
conda_win:
<<: *win
stage: deploy
script:
- call C:\Users\mhochsteger\Miniconda3\Scripts\activate.bat C:\Users\mhochsteger\Miniconda3
- call conda build purge
- call conda clean -a -y
- cd %CI_PROJECT_DIR%\tests\gitlab-ci\conda
- python generate_meta_files.py
- cd netgen
- call conda build -c conda-forge -c NGSolve --user NGSolve --token %ANACONDA_TOKEN% .
- cd ..\ngsolve
- call conda build -c conda-forge -c NGSolve --user NGSolve --token %ANACONDA_TOKEN% .
only:
- schedules
- tags
conda_linux:
stage: deploy
tags:
- linux
- docker
- avx
- bash
script:
- export PATH="/home/gitlab-runner/miniconda3/bin:$PATH"
- conda build purge
- conda clean -a -y
- cd tests/gitlab-ci/conda
- python3 generate_meta_files.py
- cd netgen
- conda build -c conda-forge -c NGSolve --user NGSolve --token ${ANACONDA_TOKEN} .
- cd ../ngsolve
- conda build -c conda-forge -c NGSolve --user NGSolve --token ${ANACONDA_TOKEN} .
only:
- schedules
- tags
conda_mac:
stage: deploy
tags:
- mac
- x64
script:
- conda activate
- conda build purge
- conda clean -a -y
- cd tests/gitlab-ci/conda
- python3 generate_meta_files.py
- cd netgen
- conda build -c conda-forge -c NGSolve --user NGSolve --token ${ANACONDA_TOKEN} .
- cd ../ngsolve
- conda build -c conda-forge -c NGSolve --user NGSolve --token ${ANACONDA_TOKEN} .
only:
- schedules
- tags
pip_linux:
image: quay.io/pypa/manylinux2014_x86_64
stage: build
tags:
- pip
- linux
- docker
script:
- ./tests/build_pip.sh
when: manual
pip_windows:
stage: build
tags:
- pip
- windows
script:
- .\tests\build_pip.ps1 C:\Python38
- .\tests\build_pip.ps1 C:\Python39
- .\tests\build_pip.ps1 C:\Python310
when: manual
pip_macos:
stage: build
tags:
- pip
- macosx
- m1
script:
- ./tests/build_pip_mac.sh 3.8
- ./tests/build_pip_mac.sh 3.9
- ./tests/build_pip_mac.sh 3.10
when: manual