.gitlab-ci.yml 14.7 KB
Newer Older
1
stages:
2
  - checkRepository
Administrator's avatar
Administrator committed
3
  - checkFormat
4
  - build
5
  - finalise
6
  - documentation
Administrator's avatar
Administrator committed
7
8

RebaseCheck:
9
  stage: checkRepository
Administrator's avatar
Administrator committed
10
  variables:
Administrator's avatar
Administrator committed
11
    GIT_DEPTH: 200
12
  image: alpine
Administrator's avatar
Administrator committed
13
  tags:
14
    - docker
Administrator's avatar
Administrator committed
15
16
17
18
19
20
21
  only:
    refs:
      - merge_requests
    variables:
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
  script:
    # Get the upstream repository manually. I did not find any other way to have it for
22
    # comparison
Administrator's avatar
Administrator committed
23
24
    # Check if a rebase is needed
    # If a rebase is needed stop immediately
25
    - apk update && apk add git bash
Administrator's avatar
Administrator committed
26
27
28
    - scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
    - git fetch upstream
    - hash1=$(git show-ref upstream/master | cut -f1 -d' ')
29
    - hash2=$(git merge-base upstream/master HEAD)
Administrator's avatar
Administrator committed
30
31
32
33
34
35
36
37
38
39
40
    - echo "${hash1}"
    - echo "${hash2}"
    - if [ "${hash1}" = "${hash2}" ]; then
    -   echo "No rebase required"
    -   exit 0
    - else
    -   echo "The Merge Request is not up-to-date"
    -   echo "Rebase is required"
    -   exit 1
    - fi

41
42
LinearHistCheck:
  stage: checkRepository
Administrator's avatar
Administrator committed
43
  variables:
Administrator's avatar
Administrator committed
44
    GIT_DEPTH: 200
45
  image: alpine
46
  tags:
47
    - docker
48
49
50
51
52
53
54
55
56
57
  only:
    refs:
      - merge_requests
    variables:
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
  script:
    # Get the upstream repository manually. I did not find any other way to have it for
    # comparison
    # Check if the history introduced by the MR is linear (no branch loop in fork)
    # If not linear stop immediately
58
    - apk update && apk add git bash
59
60
61
62
63
64
65
66
67
68
69
70
71
    - scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
    - git fetch upstream
    - count=$(git rev-list --min-parents=2 --count upstream/master..HEAD)
    - echo "${count}"
    - if [ 0 = "${count}" ]; then
    -   echo "History introduced in fork is linear"
    -   exit 0
    - else
    -   echo "History introduced in fork is not linear"
    -   echo "${count} merge commits must be removed or the other new commits have to be replayed in a new branch"
    -   exit 1
    - fi

72
CodeFormatCheck:
Administrator's avatar
Administrator committed
73
74
75
76
77
78
79
80
81
82
  stage: checkFormat
  tags:
    - CbmRoot
  only:
    refs:
      - merge_requests
    variables:
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
  script:
    # Get the upstream repository manually. I did not find any other way to have it for
83
    # comparison
Administrator's avatar
Administrator committed
84
85
86
87
88
89
90
91
    - scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
    - git fetch upstream
    - echo "export FAIRSOFT_VERSION=jun19p1" > env.sh
    - echo "export FAIRROOT_VERSION=v18.2.0" >> env.sh
    - echo "export SIMPATH=/cvmfs/fairroot.gsi.de/fairsoft/\${FAIRSOFT_VERSION}" >> env.sh
    - echo "export FAIRROOTPATH=/cvmfs/fairroot.gsi.de/fairroot/\${FAIRROOT_VERSION}_fairsoft-\${FAIRSOFT_VERSION}" >> env.sh
    - echo "export BUILDDIR=$PWD/build" >> env.sh
    - echo "export SOURCEDIR=$PWD" >> env.sh
92
    - echo "export PATH=/cvmfs/fairroot.gsi.de/clang-format-11.0.0/bin:\$SIMPATH/bin:$PATH" >> env.sh
Administrator's avatar
Administrator committed
93
94
95
96
    - echo "export LABEL=format-check_MR-\${CI_MERGE_REQUEST_IID}" >> env.sh
    - echo "export FAIRROOT_FORMAT_BASE=upstream/\${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}" >> env.sh
    - . ./env.sh && ctest -S cmake/scripts/checkformat.cmake -VV

97
98
FileFormatCheck:
  stage: checkFormat
99
  image: alpine
100
  tags:
101
    - docker
102
103
104
105
106
107
108
109
  only:
    refs:
      - merge_requests
    variables:
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
  script:
    # Get the upstream repository manually. I did not find any other way to have it for
    # comparison
110
    - apk update && apk add git bash file
111
112
113
    - scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
    - git fetch upstream
    - scripts/check-file-format.sh upstream
114

115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
FileEndCheck:
  stage: checkFormat
  image: alpine
  tags:
    - docker
  only:
    refs:
      - merge_requests
    variables:
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
  script:
    # Get the upstream repository manually. I did not find any other way to have it for
    # comparison
    - apk update && apk add git bash file
    - scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
    - git fetch upstream
    - scripts/check-file-ending.sh upstream

Eoin Clerkin's avatar
Eoin Clerkin committed
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152

FileLicenceCheck:
  stage: checkFormat
  image: alpine
  tags:
    - docker
  only:
    refs:
      - merge_requests
    variables:
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
  script:
    # Get the upstream repository manually. I did not find any other way to have it for
    # comparison
    - apk update && apk add git bash file
    - scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
    - git fetch upstream
    - scripts/check-licence-header.sh upstream


153
154
155
156
#
# job template
#
.build_and_test: &build_and_test
Administrator's avatar
Administrator committed
157
  before_script:
158
    - if [ "$CI_MERGE_REQUEST_PROJECT_PATH" != "computing/cbmroot" ]; then
Administrator's avatar
Administrator committed
159
160
161
162
163
    -   if [ "$CI_PROJECT_PATH" != "computing/cbmroot" ]; then
    -     echo "Should not come here"
    -     env
    -     exit 1
    -   fi
164
    - fi
Administrator's avatar
Administrator committed
165
166
  script:
    - echo "export LINUX_FLAVOUR=$OS" >> Dart.cfg
167
168
    - echo "export SIMPATH=$SIMPATH" >> Dart.cfg
    - echo "export FAIRROOTPATH=$FAIRROOTPATH" >> Dart.cfg
Administrator's avatar
Administrator committed
169
    - if [[ -n $RAW_DATA_PATH ]]; then
170
    -   echo "export RAW_DATA_PATH=$RAW_DATA_PATH" >> Dart.cfg
Administrator's avatar
Administrator committed
171
    - fi
172
173
    - echo "export BUILDDIR=$PWD/build" >> Dart.cfg
    - echo "export SOURCEDIR=$PWD" >> Dart.cfg
174
175
176
    - if [[ -n $EXTRA_PATH ]]; then
    -   echo "export PATH=$EXTRA_PATH:$PATH" >> Dart.cfg
    - fi
177
178
179
180
181
182
    - if [[ -n $EXTRA_FLAGS ]]; then
    -   echo "export EXTRA_FLAGS=$EXTRA_FLAGS" >> Dart.cfg
    - fi
    - if [[ -n $CONFIGFILE ]]; then
    -   source $CONFIGFILE $FAIRSOFT_VERSION
    - fi
183
    - $PWD/Dart.sh $BUILD_TYPE Dart.cfg
Administrator's avatar
Administrator committed
184
  after_script:
185
186
187
188
189
190
191
192
193
    - rm -rf build

#
# job element definitions
#
.realData_tag: &realData_tag
  stage: build
  tags:
    - CbmRoot_realData
194
195

.realData_variables: &realData_variables
196
    OS: "Debian10"
197
198
199
    EXTRA_PATH: /opt/cmake/3.20.1/bin
    NCPU: 16
    RAW_DATA_PATH: "/opt/cbmsoft/beamtime-test-data/reduced/"
200
201
    FAIRSOFT_VERSION: "jun19p2_root6"
    FAIRROOT_VERSION: "v18.2.1"
202
    BASE_PATH: "/opt/cbmsoft"
203
204
205
206
207
208
209
    SIMPATH: "$BASE_PATH/fairsoft_$FAIRSOFT_VERSION/installation"
    FAIRROOTPATH: "$BASE_PATH/fairroot_${FAIRROOT_VERSION}-fairsoft_${FAIRSOFT_VERSION}"

.singularity_tag: &singularity_tag
  stage: build
  tags:
    - CbmRoot_singularity
210

Administrator's avatar
Administrator committed
211

212
.singularity_debian10_variables_jun19: &singularity_debian10_variables_jun19
213
    OS: debian10
214
215
216
    FAIRSOFT_VERSION: jun19p2
    FAIRROOT_VERSION: v18.2.1
    BASE_PATH: "/cvmfs/fairsoft.gsi.de/$OS"
217
218
    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_fs_${FAIRSOFT_VERSION}"
219

Administrator's avatar
Administrator committed
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
#.singularity_debian8_variables_jun19: &singularity_debian8_variables_jun19
#    OS: debian8
#    FAIRSOFT_VERSION: jun19p2
#    FAIRROOT_VERSION: v18.2.1
#    BASE_PATH: "/cvmfs/fairsoft.gsi.de/$OS"
#    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
#    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_fairsoft-${FAIRSOFT_VERSION}"
#    CONFIGFILE: "/cvmfs/cbm.gsi.de/$OS/bin/setup_development_environment.sh"

#.singularity_debian8_variables_nov20: &singularity_debian8_variables_nov20
#    OS: debian8
#    FAIRSOFT_VERSION: nov20
#    FAIRROOT_VERSION: v18.4.2
#    BASE_PATH: "/cvmfs/fairsoft.gsi.de/$OS"
#    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
#    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_fairsoft-${FAIRSOFT_VERSION}"
#    CONFIGFILE: "/cvmfs/cbm.gsi.de/$OS/bin/setup_development_environment.sh"

#.singularity_debian8_variables_apr21: &singularity_debian8_variables_apr21
#    OS: debian8
#    FAIRSOFT_VERSION: apr21
#    FAIRROOT_VERSION: v18.6.3
#    BASE_PATH: "/cvmfs/fairsoft.gsi.de/$OS"
#    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
#    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_fairsoft_${FAIRSOFT_VERSION}"
#    CONFIGFILE: "/cvmfs/cbm.gsi.de/$OS/bin/setup_development_environment.sh"
246

247
248
.singularity_debian10_variables_apr21: &singularity_debian10_variables_apr21
    OS: debian10
Administrator's avatar
Administrator committed
249
250
    FAIRSOFT_VERSION: apr21p2
    FAIRROOT_VERSION: v18.6.7
251
252
253
254
255
256
257
    BASE_PATH: "/cvmfs/fairsoft.gsi.de/$OS"
    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_fs_${FAIRSOFT_VERSION}"
    CONFIGFILE: "/cvmfs/cbm.gsi.de/$OS/bin/setup_development_environment.sh"

.singularity_centos7_variables_apr21: &singularity_centos7_variables_apr21
    OS: centos7
Administrator's avatar
Administrator committed
258
259
    FAIRSOFT_VERSION: apr21p2
    FAIRROOT_VERSION: v18.6.7
260
261
262
263
264
    BASE_PATH: "/cvmfs/fairsoft.gsi.de/$OS/gcc8"
    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_fs_${FAIRSOFT_VERSION}"
    CONFIGFILE: "/cvmfs/cbm.gsi.de/$OS/bin/setup_development_environment_test.sh"

Administrator's avatar
Administrator committed
265
.singularity_debian11_variables_apr21: &singularity_debian11_variables_apr21
Administrator's avatar
Administrator committed
266
    CONTAINER: "/cvmfs/cbm.gsi.de/containers/debian11_v18.6.7_apr21p2.sif"
Administrator's avatar
Administrator committed
267
    OS: debian11
Administrator's avatar
Administrator committed
268
269
    FAIRSOFT_VERSION: apr21p2
    FAIRROOT_VERSION: v18.6.7
Administrator's avatar
Administrator committed
270
    BASE_PATH: "/opt/"
Administrator's avatar
Administrator committed
271
    SIMPATH: "$BASE_PATH/fairsoft/${FAIRSOFT_VERSION}"
Administrator's avatar
Administrator committed
272
    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_${FAIRSOFT_VERSION}"
273
    EXTRA_FLAGS: '"-DCBM_TEST_INSTALL=TRUE\" \"-DCMAKE_INSTALL_PREFIX=install"'
Administrator's avatar
Administrator committed
274

275
276
277
278
279
280
.linux_tag: &linux_tag
  stage: build
  tags:
    - CbmRoot

.linux_variables: &linux_variables
Administrator's avatar
Administrator committed
281
    OS: "Debian10.11"
282
    NCPU: 5
Administrator's avatar
Administrator committed
283
284
285
    FAIRSOFT_VERSION: "jun19p2"
    FAIRROOT_VERSION: "v18.2.1"
    BASE_PATH: "/cvmfs/fairsoft.gsi.de/debian10"
286
    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
Administrator's avatar
Administrator committed
287
    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_fs_${FAIRSOFT_VERSION}"
288
289
290
291
292
293

.macosx_tag: &macosx_tag
  stage: build
  tags:
    - CbmRoot_macosx

Administrator's avatar
Administrator committed
294
295
296
297
298
299
300
301
#.macosx_variables: &macosx_variables
#    OS: "macOS_10.13"
#    NCPU: 4
#    FAIRSOFT_VERSION: "jun19p1"
#    FAIRROOT_VERSION: "v18.2.1"
#    BASE_PATH: "/opt"
#    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
#    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_fairsoft-${FAIRSOFT_VERSION}"
302

303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
.macosx_1015_tag: &macosx_1015_tag
  stage: build
  tags:
    - CbmRoot_macosx_1015

.macosx_1015_variables: &macosx_1015_variables
    OS: "macOS_10.15"
    FAIRSOFT_VERSION: "jun19p1"
    FAIRROOT_VERSION: "v18.2.1"
    BASE_PATH: "/opt"
    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_fairsoft-${FAIRSOFT_VERSION}"

.macosx_11_tag: &macosx_11_tag
  stage: build
  tags:
    - CbmRoot_macosx_11

.macosx_11_variables: &macosx_11_variables
    OS: "macOS_11"
Administrator's avatar
Administrator committed
323
324
    FAIRSOFT_VERSION: "apr21p2"
    FAIRROOT_VERSION: "v18.6.7"
325
326
    BASE_PATH: "/opt"
    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
Administrator's avatar
Administrator committed
327
    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_${FAIRSOFT_VERSION}"
328

Administrator's avatar
Administrator committed
329
330
331
332
333
334
335
.macosx_12_tag: &macosx_12_tag
  stage: build
  tags:
    - CbmRoot_macosx_12

.macosx_12_variables: &macosx_12_variables
    OS: "macOS_12"
336
    FAIRSOFT_VERSION: "apr21p2"
Administrator's avatar
Administrator committed
337
    FAIRROOT_VERSION: "v18.6.7"
Administrator's avatar
Administrator committed
338
339
340
341
    BASE_PATH: "/opt"
    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_${FAIRSOFT_VERSION}"

342
343
.mergeVariables: &mergeVariables
    BUILD_TYPE: "Continuous"
344

345
346
.mergeRequestVariables: &mergeRequestVariables
    BUILD_TYPE: "MergeRequest"
347

348
.check_merge_request: &check_merge_request
349
350
351
352
353
354
  only:
    refs:
      - merge_requests
    variables:
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"

355
356
357
358
359
360
361
.check_merge: &check_merge
  only:
    refs:
      - master
    variables:
      - $CI_PROJECT_PATH == "computing/cbmroot"

362
#
363
# job matrix for build jobs
364
#
365

366
CbmRoot_Merge_realData:
367
368
369
  <<: [*realData_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *realData_variables]
370

371
CbmRoot_Merge_Singularity_debian10_jun19:
372
373
  <<: [*singularity_tag, *check_merge_request, *build_and_test]
  variables:
374
    <<: [*mergeRequestVariables, *singularity_debian10_variables_jun19]
375

Administrator's avatar
Administrator committed
376
377
378
379
#CbmRoot_Merge_Singularity_debian8_jun19:
#  <<: [*singularity_tag, *check_merge_request, *build_and_test]
#  variables:
#    <<: [*mergeRequestVariables, *singularity_debian8_variables_jun19]
380

Administrator's avatar
Administrator committed
381
382
383
384
#CbmRoot_Merge_Singularity_debian8_nov20:
#  <<: [*singularity_tag, *check_merge_request, *build_and_test]
#  variables:
#    <<: [*mergeRequestVariables, *singularity_debian8_variables_nov20]
385

Administrator's avatar
Administrator committed
386
387
388
389
#CbmRoot_Merge_Singularity_debian8_apr21:
#  <<: [*singularity_tag, *check_merge_request, *build_and_test]
#  variables:
#    <<: [*mergeRequestVariables, *singularity_debian8_variables_apr21]
390
391
392
393
394
395

CbmRoot_Merge_Singularity_debian10_apr21:
  <<: [*singularity_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *singularity_debian10_variables_apr21]

Administrator's avatar
Administrator committed
396
397
398
399
400
CbmRoot_Merge_Singularity_debian11_apr21:
  <<: [*singularity_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *singularity_debian11_variables_apr21]

401
402
403
404
CbmRoot_Merge_Singularity_centos7_apr21:
  <<: [*singularity_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *singularity_centos7_variables_apr21]
405

Administrator's avatar
Administrator committed
406
407
408
409
CbmRoot_Merge:
  <<: [*linux_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *linux_variables]
410

411
412
413
414
415
416
417
418
419
420
421
422
#CbmRoot_Merge_macosx:
#  <<: [*macosx_tag, *check_merge_request, *build_and_test]
#  variables:
#    <<: [*mergeRequestVariables, *macosx_variables]

CbmRoot_Merge_macosx_1015:
  <<: [*macosx_1015_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *macosx_1015_variables]

CbmRoot_Merge_macosx_11:
  <<: [*macosx_11_tag, *check_merge_request, *build_and_test]
423
  variables:
424
    <<: [*mergeRequestVariables, *macosx_11_variables]
425

Administrator's avatar
Administrator committed
426
427
428
429
430
CbmRoot_Merge_macosx_12:
  <<: [*macosx_12_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *macosx_12_variables]

431
432
433
434
CbmRoot_Continuous:
  <<: [*linux_tag, *check_merge, *build_and_test]
  variables:
    <<: [*mergeVariables, *linux_variables]
435

436
437
438
InformCodeOwners:
  stage: finalise
  tags:
439
    - Code_Owners
440
441
442
443
444
445
446
447
448
449
450
451
  only:
    refs:
      - merge_requests
    variables:
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
  script:
    # Get the upstream repository manually. I did not find any other way to have it for
    # comparison
    - scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
    - git fetch upstream
    - scripts/inform_codeowners.sh upstream

452
453
454
455
456
457
pages:
  stage: documentation
  image: alpine
  tags:
    - docker
  script:
Administrator's avatar
Administrator committed
458
    - apk update && apk add doxygen graphviz
459
460
461
    - doxygen doxygen/cbmDoxyfile.conf
    - mv html-doc/html public/
  artifacts:
Administrator's avatar
Administrator committed
462
    expire_in: 1 day
463
464
465
    paths:
      - public
  only:
466
    - nightly_master