-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
419 lines (364 loc) · 13.3 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
variables:
DOCKER_DRIVER: overlay2
STANDARDFLAGS: -DHEPMC3_TEST_VALGRIND=ON -DHEPMC3_ENABLE_PROTOBUFIO:BOOL=ON -DHEPMC3_ENABLE_ROOTIO:BOOL=ON -DHEPMC3_BUILD_EXAMPLES:BOOL=ON -DHEPMC3_ENABLE_TEST:BOOL=ON -DHEPMC3_TEST_VALGRIND:BOOL=ON -DHEPMC3_ENABLE_PYTHON:BOOL=ON -DHEPMC3_INSTALL_INTERFACES:BOOL=ON -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON -DHEPMC3_BUILD_DOCS:BOOL=ON
#-DCMAKE_CXX_FLAGS="-Wpedantic -Wall -Wextra"
stages:
- check_if_dockerfile_updated
- build_docker_image
- build
- LCG
########################################################################
.LCGcmake: &LCGcmake
- mkdir BUILD
- cd BUILD
- set -x
- cmake .. -DCMAKE_CXX_FLAGS="-Wpedantic -Wall -Wextra" ${STANDARDFLAGS} ${LARG} ${EXTRACMAKEFLAGS}
- set +x
- make -j $(nproc)
- make -j $(nproc) install
- ctest -j 5 --output-on-failure
LCG_99_x86_64-centos7-gcc8-opt:
only:
variables:
- $CI_SERVER_HOST=="gitlab.cern.ch"
image: gitlab-registry.cern.ch/sft/docker:lcg-cc7
tags:
- k8s-cvmfs
stage: LCG
before_script:
- export LCGPLATFORM=x86_64-centos7-gcc8-opt
- export LCG_LOCATION=/cvmfs/sft.cern.ch/lcg/releases/LCG_99
- source /cvmfs/sft.cern.ch/lcg/contrib/gcc/8.2.0/${LCGPLATFORM}/setup.sh
- source ${LCG_LOCATION}/ROOT/v6.22.06/${LCGPLATFORM}/ROOT-env.sh
- export PATH=/cvmfs/sft.cern.ch/lcg/contrib/CMake/latest/Linux-x86_64/bin/:${PATH}
- export ROOTSYS=${LCG_LOCATION}/ROOT/v6.22.06/${LCGPLATFORM}/
- source ${LCG_LOCATION}/valgrind/3.16.1/${LCGPLATFORM}/valgrind-env.sh
- source ${LCG_LOCATION}/graphviz/2.40.1/${LCGPLATFORM}/graphviz-env.sh
- source ${LCG_LOCATION}/zlib/1.2.11/${LCGPLATFORM}/zlib-env.sh
- source ${LCG_LOCATION}/Python/3.8.6/${LCGPLATFORM}/Python-env.sh
- source ${LCG_LOCATION}/HepMC/2.06.11/${LCGPLATFORM}/HepMC-env.sh
- source ${LCG_LOCATION}/protobuf/2.5.0/${LCGPLATFORM}/protobuf-env.sh
#LCG 99 calls its variable Protobuf__HOME instead of Protobuf_HOME
- export Protobuf_ROOT=$(pkg-config protobuf --variable=prefix)
script:
- export
- LARG=" "
- LARG="$LARG "-DPYTHIA8_ROOT_DIR=${LCG_LOCATION}/MCGenerators/pythia8/244/${LCGPLATFORM}
- LARG="$LARG "-DHEPMC2_ROOT_DIR=${LCG_LOCATION}/HepMC/2.06.11/${LCGPLATFORM}/
- LARG="$LARG "-DGRAPHVIZ_ROOT=${LCG_LOCATION}/graphviz/2.40.1/${LCGPLATFORM}/
- LARG="$LARG "-DProtobuf_INCLUDE_DIR=${Protobuf_ROOT}/include
- LARG="$LARG "-DProtobuf_LIBRARY=${Protobuf_ROOT}/lib/libprotobuf.so
- LARG="$LARG "-DHEPMC3_USE_INTERFACE_FROM_PYTHIA8:BOOL=OFF
- LARG="$LARG "-DHEPMC3_PYTHON_VERSIONS=3
- LARG="$LARG "-DCMAKE_INSTALL_PREFIX=$(pwd)/install
- LARG="$LARG "-DHEPMC3_Python_SITEARCH38=$(pwd)/install/lib/python3.8/site-packages
- *LCGcmake
.check_commit: &check_commit
stage: check_if_dockerfile_updated
image:
name: alpine/git
entrypoint: [""]
script:
- rm -rf todo-$OS'_'$FREL.txt
- export SUFFIX=
- set -x
- if [ $OS == "CentOS" ]; then export SUFFIX=$FREL; fi
- git log -1 | grep $OS'Dockerfile'$FREL | head -n 1 >> todo-$OS'_'$FREL.txt || touch todo-$OS'_'$FREL.txt
- git diff --name-only HEAD HEAD~1 | grep CI/$OS/Dockerfile$SUFFIX | head -n 1 >> todo-$OS'_'$FREL.txt || touch todo-$OS'_'$FREL.txt
- if [ -s todo-$OS'_'$FREL.txt ]; then cat CI/$OS/Dockerfile$SUFFIX | sed 's/fedora:35/fedora:'$FREL'/g' > todo-$OS'_'$FREL.txt; fi
- if [ $CI_PIPELINE_SOURCE == "schedule" ]; then cat CI/$OS/Dockerfile$SUFFIX | sed 's/fedora:35/fedora:'$FREL'/g' > todo-$OS'_'$FREL.txt; fi
- cat todo-$OS'_'$FREL.txt
- exit 0
variables:
GIT_DEPTH: "3"
artifacts:
paths:
- todo-${OS}_${FREL}.txt
expire_in: 1 day
########################################################################
.build_image: &build_image
stage: build_docker_image
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo $CI_REGISTRY_IMAGE:$OS_$FREL $CI_PROJECT_DIR
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- if [ -s todo-${OS}_${FREL}.txt ]; then /kaniko/executor --context $CI_PROJECT_DIR --dockerfile todo-${OS}_${FREL}.txt --destination $CI_REGISTRY_IMAGE:${OS}_${FREL} ; fi
variables:
GIT_DEPTH: "2"
########################################################################
.any: &any
image: gitlab-registry.cern.ch/hepmc/hepmc3:${OS}_${FREL}
stage: build
only:
variables:
- $CI_SERVER_HOST=="gitlab.cern.ch"
before_script:
- set -x
- uname -a
- cat /etc/issue
- export GIT_DEPTH=1
cache:
- key: cache-${OS}-${FREL}-${TOOLSET}
paths:
- CACHES/cache-${OS}-${FREL}-${TOOLSET}/
.standalone: &standalone
- export TTOP=$(pwd)
- mkdir -p STANDALONE
- cp -r INSTALL/share/doc/HepMC3/examples STANDALONE
- cd STANDALONE/examples
- $CMAKE -S . -B BUILD -DUSE_INSTALLED_HEPMC3=ON -DHepMC3_DIR=$TTOP/INSTALL/share/HepMC3/cmake/
- $CMAKE --build BUILD
- cd $TTOP
- cd python
- $CMAKE -S . -B BUILD -DUSE_INSTALLED_HEPMC3=ON -DHepMC3_DIR=$TTOP/INSTALL/share/HepMC3/cmake/ -DHEPMC3_ENABLE_TEST=ON $CACHINGFLAGS
- $CMAKE --build BUILD
- cd BUILD
- $CTEST -j 5 --output-on-failure
- cd $TTOP
.oldstandaloneexamples: &oldstandaloneexamples
- export TTOP=$(pwd)
- mkdir -p STANDALONE
- cp -r INSTALL/share/doc/HepMC3/examples STANDALONE
- cd STANDALONE/examples
- mkdir -p BUILD
- cd BUILD
- $CMAKE .. -DUSE_INSTALLED_HEPMC3=ON -DHepMC3_DIR=$TTOP/INSTALL/share/HepMC3/cmake/
- make -j 4
- cd $TTOP
.oldstandalonepython: &oldstandalonepython
- export TTOP=$(pwd)
- cd python
- mkdir -p BUILD
- cd BUILD
- $CMAKE .. -DUSE_INSTALLED_HEPMC3=ON -DHepMC3_DIR=$TTOP/INSTALL/share/HepMC3/cmake/ -DHEPMC3_ENABLE_TEST=ON $CACHINGFLAGS
- make -j 4
- $CTEST -j 5 --output-on-failure
- cd $TTOP
.cmake: &cmake
- $CMAKE -S . -B BUILD -DCMAKE_INSTALL_PREFIX=$(pwd)/INSTALL -DCMAKE_CXX_FLAGS="-Wpedantic -Wall -Wextra" ${STANDARDFLAGS} ${EXTRACMAKEFLAGS} $CACHINGFLAGS
- $CMAKE --build BUILD -j 10 --verbose
- $CMAKE --install BUILD
- cd BUILD
- $CTEST -j 5 --output-on-failure
- cd ..
.oldcmake: &oldcmake
- mkdir -p BUILD
- cd BUILD
- $CMAKE .. -DCMAKE_INSTALL_PREFIX=$(pwd)/../INSTALL -DCMAKE_CXX_FLAGS="-Wpedantic -Wall -Wextra" ${STANDARDFLAGS} ${EXTRACMAKEFLAGS} $CACHINGFLAGS
- make -j 10 SHELL='sh -x'
- make install
- $CTEST -j 5 --output-on-failure
- cd ..
.ex: &ex
- if [ "${TOOLSET}" == "LLVM" ]; then export CXX=clang++; export CC=clang; export FC=gfortran; fi
- if [ "${TOOLSET}" == "GNU" ]; then export CXX=g++; export CC=gcc; export FC=gfortran; fi
- if [ "${TOOLSET}" == "INTEL" ]; then source /opt/intel/oneapi/setvars.sh; export CXX=icx; export CC=icx; export FC=ifx; fi
- export CCACHE_BASEDIR=`pwd`/CACHES/cache-${OS}-${FREL}-${TOOLSET}
- export CCACHE_DIR=`pwd`/CACHES/cache-${OS}-${FREL}-${TOOLSET}/ccache
- mkdir -p CCACHE_DIR
- export CCACHE_COMPILERCHECK=content
- export CMAKE=cmake
- export CTEST=ctest
- if [ "${FREL}" == "7" ]; then export CMAKE=cmake3; CTEST=ctest3; fi
- if [ "${FREL}" == "0" ]; then export CMAKE=cmake; CTEST=ctest; fi
- if [ "${FREL}" == "23" ]; then export CMAKE=cmake; CTEST=ctest; fi
- export CACHINGFLAGS="-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache "
- $CMAKE --version
- $CTEST --version
.any-cmake: &any-cmake
extends: .any
script:
- *ex
- *cmake
- *standalone
.any-oldcmake: &any-oldcmake
extends: .any
script:
- *ex
- *oldcmake
- *oldstandaloneexamples
- *oldstandalonepython
.any-oldcmake-no-python: &any-oldcmake-no-python
extends: .any
script:
- *ex
- *oldcmake
- *oldstandaloneexamples
###########################################################################
#Check commit messages
check_commit_Fedora40:
variables: { OS: Fedora, FREL: 40}
extends: .check_commit
check_commit_Fedora38:
variables: { OS: Fedora, FREL: 38}
extends: .check_commit
check_commit_Fedora37:
variables: { OS: Fedora, FREL: 37}
extends: .check_commit
check_commit_Fedora35:
variables: { OS: Fedora, FREL: 35}
extends: .check_commit
check_commit_Fedora34:
variables: { OS: Fedora, FREL: 34}
extends: .check_commit
check_commit_Fedora33:
variables: { OS: Fedora, FREL: 33}
extends: .check_commit
check_commit_Fedora24:
variables: { OS: Fedora, FREL: 24}
extends: .check_commit
check_commit_Fedora23:
variables: { OS: Fedora, FREL: 23}
extends: .check_commit
check_commit_CentOS9:
variables: { OS: CentOS, FREL: 9}
extends: .check_commit
check_commit_CentOS8:
variables: { OS: CentOS, FREL: 8}
extends: .check_commit
check_commit_CentOS7:
variables: { OS: CentOS, FREL: 7}
extends: .check_commit
check_commit_Archlinux0:
variables: {OS: Archlinux, FREL: 0}
extends: .check_commit
###########################################################################
#Build images
build_image_Fedora40:
variables: { OS: Fedora, FREL: 40}
extends: .build_image
needs:
- job: check_commit_Fedora40
build_image_Fedora38:
variables: { OS: Fedora, FREL: 38}
extends: .build_image
needs:
- job: check_commit_Fedora38
build_image_Fedora37:
variables: { OS: Fedora, FREL: 37}
extends: .build_image
needs:
- job: check_commit_Fedora37
build_image_Fedora35:
variables: { OS: Fedora, FREL: 35}
extends: .build_image
needs:
- job: check_commit_Fedora35
build_image_Fedora34:
variables: { OS: Fedora, FREL: 34}
extends: .build_image
needs:
- job: check_commit_Fedora34
build_image_Fedora33:
variables: { OS: Fedora, FREL: 33}
extends: .build_image
needs:
- job: check_commit_Fedora33
build_image_Fedora24:
variables: { OS: Fedora, FREL: 24}
extends: .build_image
needs:
- job: check_commit_Fedora24
build_image_Fedora23:
variables: { OS: Fedora, FREL: 23}
extends: .build_image
needs:
- job: check_commit_Fedora23
build_image_CentOS9:
variables: { OS: CentOS, FREL: 9}
extends: .build_image
needs:
- job: check_commit_CentOS9
build_image_CentOS8:
variables: { OS: CentOS, FREL: 8}
extends: .build_image
needs:
- job: check_commit_CentOS8
build_image_CentOS7:
variables: { OS: CentOS, FREL: 7}
extends: .build_image
needs:
- job: check_commit_CentOS7
build_image_Archlinux0:
variables: { OS: Archlinux, FREL: 0}
extends: .build_image
needs:
- job: check_commit_Archlinux0
###########################################################################
Fedora40-GNU:
variables: { OS: Fedora, FREL: 40, TOOLSET: GNU, EXTRACMAKEFLAGS: }
extends: .any-cmake
needs:
- job: build_image_Fedora40
Fedora38-GNU:
variables: { OS: Fedora, FREL: 38, TOOLSET: GNU, EXTRACMAKEFLAGS: }
extends: .any-cmake
needs:
- job: build_image_Fedora38
Fedora37-LLVM:
variables: { OS: Fedora, FREL: 37, TOOLSET: LLVM, EXTRACMAKEFLAGS: }
extends: .any-cmake
needs:
- job: build_image_Fedora37
Fedora35-GNU:
variables: { OS: Fedora, FREL: 35, TOOLSET: GNU, EXTRACMAKEFLAGS: }
extends: .any-cmake
needs:
- job: build_image_Fedora35
Fedora34-GNU:
variables: { OS: Fedora, FREL: 34, TOOLSET: GNU, EXTRACMAKEFLAGS: }
extends: .any-cmake
needs:
- job: build_image_Fedora34
Fedora34-LLVM:
variables: { OS: Fedora, FREL: 34, TOOLSET: LLVM, EXTRACMAKEFLAGS: }
extends: .any-cmake
needs:
- job: build_image_Fedora34
Fedora33-GNU-pypy:
variables: { OS: Fedora, FREL: 33, TOOLSET: GNU, EXTRACMAKEFLAGS: "-DHEPMC3_PYTHON_VERSIONS=3,pypy2" }
extends: .any-cmake
needs:
- job: build_image_Fedora33
Fedora24-GNU:
variables: { OS: Fedora, FREL: 24, TOOLSET: GNU, EXTRACMAKEFLAGS: "-DHEPMC3_TEST_LZMA:BOOL=OFF -DHEPMC3_TEST_BZIP2:BOOL=OFF"}
extends: .any-oldcmake
needs:
- job: build_image_Fedora24
Fedora23-LLVM-noroot-nopython-noprotobuf:
variables: { OS: Fedora, FREL: 23, TOOLSET: LLVM, EXTRACMAKEFLAGS: "-DHEPMC3_ENABLE_PROTOBUFIO:BOOL=OFF -DHEPMC3_ENABLE_ROOTIO:BOOL=OFF -DHEPMC3_ENABLE_PYTHON:BOOL=OFF -DHEPMC3_TEST_LZMA:BOOL=OFF -DHEPMC3_TEST_BZIP2:BOOL=OFF"}
extends: .any-oldcmake-no-python
needs:
- job: build_image_Fedora23
Fedora23-GNU-noroot-nopython-noprotobuf:
variables: { OS: Fedora, FREL: 23, TOOLSET: GNU, EXTRACMAKEFLAGS: "-DHEPMC3_ENABLE_PROTOBUFIO:BOOL=OFF -DHEPMC3_ENABLE_ROOTIO:BOOL=OFF -DHEPMC3_ENABLE_PYTHON:BOOL=OFF -DHEPMC3_TEST_LZMA:BOOL=OFF -DHEPMC3_TEST_BZIP2:BOOL=OFF"}
extends: .any-oldcmake-no-python
needs:
- job: build_image_Fedora23
#CentOS9-INTEL:
# variables: { OS: CentOS, FREL: 9, TOOLSET: INTEL, EXTRACMAKEFLAGS: -DCMAKE_EXE_LINKER_FLAGS=-lstdc++}
# extends: .any-cmake
# needs:
# - job: build_image_CentOS9
CentOS9-GNU:
variables: { OS: CentOS, FREL: 9, TOOLSET: GNU, EXTRACMAKEFLAGS: }
extends: .any-cmake
needs:
- job: build_image_CentOS9
CentOS8-GNU:
variables: { OS: CentOS, FREL: 8, TOOLSET: GNU, EXTRACMAKEFLAGS: }
extends: .any-cmake
needs:
- job: build_image_CentOS8
CentOS7-GNU:
variables: { OS: CentOS, FREL: 7, TOOLSET: GNU, EXTRACMAKEFLAGS: "-DHEPMC3_PYTHON_VERSIONS=3.6"}
extends: .any-cmake
needs:
- job: build_image_CentOS7
Archlinux0-GNU:
variables: { OS: Archlinux, FREL: 0, TOOLSET: GNU, EXTRACMAKEFLAGS: }
extends: .any-cmake
needs:
- job: build_image_Archlinux0