forked from acts-project/acts
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.gitlab-ci.yml
463 lines (394 loc) · 11.5 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
variables:
CCACHE_DIR: ${CI_PROJECT_DIR}/ccache
CCACHE_MAXSIZE: 2G
CCACHE_KEY_SUFFIX: r1
CTEST_OUTPUT_ON_FAILURE: 1
clang_tidy:
stage: build
image: ghcr.io/acts-project/ubuntu2004:v41
artifacts:
paths:
- src/clang-tidy/
when: always
expire_in: 2 weeks
script:
- git clone $CLONE_URL src
- cd src
- git checkout $HEAD_SHA
- >
apt-get update
&& apt-get install -y g++-8 libstdc++-8-dev parallel software-properties-common
&& curl -L https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add
&& add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main'
&& apt-get install -y clang-16 clang-tidy-16
&& ln -s /usr/bin/clang++-16 /usr/bin/clang++
&& ln -s /usr/bin/clang-16 /usr/bin/clang
&& ln -s /usr/bin/clang-tidy-16 /usr/bin/clang-tidy
&& mkdir -p /opt/lib/gcc/x86_64-linux-gnu
&& ln -s /usr/lib/gcc/x86_64-linux-gnu/8/ /opt/lib/gcc/x86_64-linux-gnu/
&& clang++ --gcc-toolchain=/opt -v
- >
cmake -B build -S .
-GNinja
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_C_COMPILER=clang
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_FLAGS="-Werror --gcc-toolchain=/opt"
-DACTS_BUILD_EVERYTHING=on
-DACTS_RUN_CLANG_TIDY=on
# Main clang-tidy run during cmake compilation
- CI/clang_tidy/run_clang_tidy.sh clang-tidy build
# Install dependencies for processing scripts
- pip install -r CI/clang_tidy/requirements.txt
# Parse the main clang-tidy run
- >
CI/clang_tidy/parse_clang_tidy.py
clang-tidy/clang-tidy.log
clang-tidy/clang-tidy.json
--exclude "*thirdparty*"
--exclude "*ActsPodioEdm*"
# Check the combined report against the defined limits
- CI/clang_tidy/check_clang_tidy.py --report clang-tidy/clang-tidy.json --config CI/clang_tidy/limits.yml
# Generate an html report
- codereport clang-tidy/clang-tidy.json clang-tidy/html
build_exatrkx:
stage: build
image: ghcr.io/acts-project/ubuntu2004_exatrkx:v43
tags:
- docker
cache:
key: ccache-exatrkx-$CI_COMMIT_REF_SLUG
paths:
- ${CI_PROJECT_DIR}/ccache_${CCACHE_KEY_SUFFIX}
artifacts:
paths:
- build/
exclude:
- build/**/*.o
- build/bin/ActsIntegrationTest*
script:
- export PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH
- export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:$PATH
- echo $PATH
- git clone $CLONE_URL src
- cd src
- git checkout $HEAD_SHA
- cd ..
- mkdir build
- >
cmake -B build -S src
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-GNinja
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_FLAGS=-w
-DCMAKE_CUDA_FLAGS=-w
-DCMAKE_CUDA_ARCHITECTURES="75;86"
-DACTS_BUILD_PLUGIN_EXATRKX=ON
-DACTS_BUILD_EXAMPLES_EXATRKX=ON
-DACTS_BUILD_UNITTESTS=ON
-DACTS_EXATRKX_ENABLE_TORCH=ON
-DACTS_EXATRKX_ENABLE_ONNX=ON
-DACTS_BUILD_EXAMPLES_PYTHON_BINDINGS=ON
-DACTS_ENABLE_LOG_FAILURE_THRESHOLD=ON
- cmake --build build -- -j3
test_exatrkx_unittests:
stage: test
needs:
- build_exatrkx
image: ghcr.io/acts-project/ubuntu2004_exatrkx:v43
tags:
- docker-gpu-nvidia
script:
- ctest --test-dir build -R ExaTrkX
test_exatrkx_python:
stage: test
needs:
- build_exatrkx
image: ghcr.io/acts-project/ubuntu2004_exatrkx:v43
tags:
- docker-gpu-nvidia
script:
- apt-get update -y
- apt-get install -y python3 libxxhash0
- source /usr/local/bin/thisroot.sh
- source build/python/setup.sh
- git clone $CLONE_URL src
- cd src
- git checkout $HEAD_SHA
- pip3 install -r Examples/Python/tests/requirements.txt
- nvidia-smi
- pytest -rFsv -k test_exatrkx
build_linux_ubuntu:
stage: build
image: ghcr.io/acts-project/ubuntu2204:v41
tags:
- docker
cache:
key: ccache-${CI_JOB_NAME_SLUG}-${HEAD_REF}-${CCACHE_KEY_SUFFIX}
when: 'always'
paths:
- ${CI_PROJECT_DIR}/ccache
artifacts:
paths:
- build/
exclude:
- build/bin/ActsUnitTest*
- build/bin/ActsIntegrationTest*
- build/**/*.o
script:
- echo $PATH
- git clone $CLONE_URL src
- cd src
- git checkout $HEAD_SHA
- git submodule init
- git submodule update
- cd ..
- mkdir build
- >
cmake -B build -S src
-GNinja
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_CXX_FLAGS=-Werror
-DCMAKE_CXX_STANDARD=17
-DACTS_ENABLE_LOG_FAILURE_THRESHOLD=ON
-DACTS_BUILD_EVERYTHING=ON
-DACTS_BUILD_ODD=ON
-DACTS_BUILD_EXAMPLES_PYTHON_BINDINGS=ON
-DACTS_BUILD_EXAMPLES_BINARIES=ON
-DACTS_BUILD_EXAMPLES_EDM4HEP=ON
-DACTS_FORCE_ASSERTIONS=ON
-DACTS_BUILD_ANALYSIS_APPS=ON
-DACTS_BUILD_PLUGIN_ONNX=ON
-DACTS_BUILD_PLUGIN_ACTSVG=ON
- ccache -z
- cmake --build build -- -j3
- ccache -s
linux_test_examples:
stage: test
image: ghcr.io/acts-project/ubuntu2204:v41
needs: [build_linux_ubuntu]
tags:
- docker
script:
- apt-get update && apt-get install -y git-lfs
- git clone $CLONE_URL src
- cd src
- git checkout $HEAD_SHA
- git submodule init
- git submodule update
- cd ..
- /usr/local/bin/geant4-config --install-datasets
- "source /usr/local/bin/thisroot.sh || true"
- "source /usr/local/bin/thisdd4hep_only.sh || true"
- "source /usr/local/bin/geant4.sh || true"
- source build/python/setup.sh
- export PYTHONPATH=/usr/local/python:$PYTHONPATH
- export LD_LIBRARY_PATH=$PWD/build/thirdparty/OpenDataDetector/factory:$LD_LIBRARY_PATH
- cd src
- pip3 install -r Examples/Python/tests/requirements.txt
- pytest -rFsv -k "not exatrkx" -v -n auto
linux_physmon:
stage: test
image: ghcr.io/acts-project/ubuntu2204:v41
needs: [build_linux_ubuntu]
tags:
- docker
artifacts:
when: always
paths:
- src/physmon
script:
- apt-get update && apt-get install -y git-lfs
- git clone $CLONE_URL src
- cd src
- git checkout $HEAD_SHA
- git submodule init
- git submodule update
- cd ..
- git config --global safe.directory "$GITHUB_WORKSPACE"
- pip3 install histcmp==0.6.2 spyral-cli==1.1.0 matplotlib
- pip3 install -r src/Examples/Scripts/requirements.txt
- /usr/local/bin/geant4-config --install-datasets
- "source /usr/local/bin/thisroot.sh || true"
- "source /usr/local/bin/thisdd4hep_only.sh || true"
- "source /usr/local/bin/geant4.sh || true"
- source build/python/setup.sh
- export LD_LIBRARY_PATH=$PWD/build/thirdparty/OpenDataDetector/factory:$LD_LIBRARY_PATH
- cd src
- export PYTHONPATH="${PYTHONPATH}":"${PWD}/Examples/Scripts/Python"
- CI/physmon/phys_perf_mon.sh all physmon
###############################
### UBUNTU EXTRA JOB MATRIX ###
###############################
.linux_ubuntu_extra: &linux_ubuntu_extra
variables:
INSTALL_DIR: ${CI_PROJECT_DIR}/install
stage: build
tags:
- docker
cache:
key: ccache-${CI_JOB_NAME_SLUG}-${HEAD_REF}-${CCACHE_KEY_SUFFIX}
when: 'always'
paths:
- ${CI_PROJECT_DIR}/ccache
script:
- git clone $CLONE_URL src
- cd src
- git checkout $HEAD_SHA
- git submodule init
- git submodule update
- cd ..
- mkdir build
- >
cmake -B build -S src
-GNinja
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_FLAGS=-Werror
-DCMAKE_CXX_STANDARD=${CXXSTD}
-DACTS_ENABLE_LOG_FAILURE_THRESHOLD=ON
-DACTS_BUILD_EVERYTHING=ON
-DACTS_BUILD_ODD=ON
-DACTS_BUILD_EXAMPLES_PYTHON_BINDINGS=ON
-DACTS_BUILD_EXAMPLES_EDM4HEP=ON
-DACTS_FORCE_ASSERTIONS=ON
-DACTS_BUILD_ANALYSIS_APPS=ON
-DACTS_BUILD_PLUGIN_ACTSVG=ON
- ccache -z
- cmake --build build -- -j3
- ccache -s
- ctest --test-dir build -j$(nproc)
- cmake --build build --target integrationtests
# Install main project
- cmake --install build
# Downstream configure
- >
cmake -B build-downstream -S src/Tests/DownstreamProject
-GNinja
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_FLAGS=-Werror
-DCMAKE_CXX_STANDARD=${CXXSTD}
-DCMAKE_PREFIX_PATH="${INSTALL_DIR}"
# Downstream build
- cmake --build build-downstream
# Downstream run
- ./build-downstream/bin/ShowActsVersion
linux_ubuntu_2004_cpp17:
<<: *linux_ubuntu_extra
variables:
CXXSTD: 17
image: ghcr.io/acts-project/ubuntu2004:v41
linux_ubuntu_2204_cpp20:
<<: *linux_ubuntu_extra
variables:
CXXSTD: 20
image: ghcr.io/acts-project/ubuntu2204_cpp20:v41
linux_ubuntu_2204_clang:
<<: *linux_ubuntu_extra
variables:
CXXSTD: 17
image: ghcr.io/acts-project/ubuntu2204_clang:v41
######################
### LCG JOB MATRIX ###
######################
.lcg: &lcg_base_job
image: ghcr.io/acts-project/${OS}-base:sha-ca76a1f2
stage: build
tags:
- docker
- cvmfs
variables:
INSTALL_DIR: ${{ github.workspace }}/install
SETUP:
cache:
key: ccache-${CI_JOB_NAME_SLUG}-${HEAD_REF}-${CCACHE_KEY_SUFFIX}
when: 'always'
paths:
- ${CI_PROJECT_DIR}/ccache
before_script:
- 'echo "LCG_VERSION: ${LCG_VERSION}"'
- 'echo "COMPILER: ${COMPILER}"'
# Figure out LCG platform name based on version number and OS
- >
if [ "$OS" = "alma9" ]; then
if [ "$LCG_VERSION" = "104" ]; then
export LCG_PLATFORM="el9"
else
export LCG_PLATFORM="centos9"
fi
else
export LCG_PLATFORM="$OS"
fi
- 'echo "LCG_PLATFORM: ${LCG_PLATFORM}"'
- source /cvmfs/sft.cern.ch/lcg/views/LCG_${LCG_VERSION}/x86_64-${LCG_PLATFORM}-${COMPILER}-opt/setup.sh
- git clone $CLONE_URL src
- cd src
- git checkout $HEAD_SHA
- git submodule init
- git submodule update
- cd ..
- ccache --version
script:
- >
cmake -B build -S src
-GNinja
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_FLAGS=-Werror
-DCMAKE_CXX_STANDARD=17
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
-DACTS_LOG_FAILURE_THRESHOLD=WARNING
-DACTS_BUILD_EXAMPLES_PYTHON_BINDINGS=ON
-DACTS_FORCE_ASSERTIONS=OFF
-DACTS_BUILD_UNITTESTS=ON
-DACTS_BUILD_INTEGRATIONTESTS=ON
-DACTS_BUILD_BENCHMARKS=ON
-DACTS_BUILD_EXAMPLES=ON
-DACTS_BUILD_PLUGIN_DD4HEP=OFF
-DACTS_BUILD_PLUGIN_TGEO=ON
-DACTS_BUILD_PLUGIN_IDENTIFICATION=ON
-DACTS_BUILD_PLUGIN_JSON=ON
-DACTS_BUILD_FATRAS=ON
-DACTS_BUILD_PLUGIN_LEGACY=ON
-DACTS_BUILD_PLUGIN_AUTODIFF=OFF
-DACTS_BUILD_EXAMPLES_DD4HEP=OFF
-DACTS_BUILD_PLUGIN_EDM4HEP=OFF
-DACTS_BUILD_EXAMPLES_GEANT4=ON
-DACTS_BUILD_EXAMPLES_HEPMC3=ON
-DACTS_BUILD_EXAMPLES_PYTHIA8=ON
-DACTS_BUILD_FATRAS_GEANT4=ON
-DACTS_BUILD_FATRAS=ON
-DACTS_BUILD_ALIGNMENT=ON
-DACTS_BUILD_ANALYSIS_APPS=ON
-DACTS_BUILD_PLUGIN_ACTSVG=ON
- ccache -z
- cmake --build build -- -j3
- ccache -s
- ctest --test-dir build -j$(nproc)
lcg_102b:
<<: *lcg_base_job
variables:
LCG_VERSION: "102b"
parallel:
matrix:
- OS: [centos7]
COMPILER: [gcc11]
lcg_104:
<<: *lcg_base_job
variables:
LCG_VERSION: "104"
parallel:
matrix:
- OS: [centos7]
COMPILER:
- gcc11
- gcc12
- OS: [alma9]
COMPILER:
- gcc11
- gcc12
- gcc13
- clang16
- OS: [centos8]
COMPILER: [gcc11]