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

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

219
.singularity_debian8_variables_jun19: &singularity_debian8_variables_jun19
220
221
222
223
224
225
    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}"
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
    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}"
Administrator's avatar
Administrator committed
244
    CONFIGFILE: "/cvmfs/cbm.gsi.de/$OS/bin/setup_development_environment.sh"
245

246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
.singularity_debian10_variables_apr21: &singularity_debian10_variables_apr21
    OS: debian10
    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}_fs_${FAIRSOFT_VERSION}"
    CONFIGFILE: "/cvmfs/cbm.gsi.de/$OS/bin/setup_development_environment.sh"

.singularity_centos7_variables_apr21: &singularity_centos7_variables_apr21
    OS: centos7
    FAIRSOFT_VERSION: apr21
    FAIRROOT_VERSION: v18.6.3
    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"

264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
.linux_tag: &linux_tag
  stage: build
  tags:
    - CbmRoot

.linux_variables: &linux_variables
    OS: "Debian8.11"
    EXTRA_PATH: /cvmfs/it.gsi.de/cmake/3.19.1/bin
    NCPU: 5
    FAIRSOFT_VERSION: "jun19p1"
    FAIRROOT_VERSION: "v18.2.0"
    BASE_PATH: "/cvmfs/fairroot.gsi.de"
    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_fairsoft-${FAIRSOFT_VERSION}"

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

.macosx_variables: &macosx_variables
    OS: "macOS_10.13"
    NCPU: 4
    FAIRSOFT_VERSION: "jun19p1"
288
    FAIRROOT_VERSION: "v18.2.1"
289
290
291
292
    BASE_PATH: "/opt"
    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_fairsoft-${FAIRSOFT_VERSION}"

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
.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"
    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}"

319
320
.mergeVariables: &mergeVariables
    BUILD_TYPE: "Continuous"
321

322
323
.mergeRequestVariables: &mergeRequestVariables
    BUILD_TYPE: "MergeRequest"
324

325
.check_merge_request: &check_merge_request
326
327
328
329
330
331
  only:
    refs:
      - merge_requests
    variables:
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"

332
333
334
335
336
337
338
.check_merge: &check_merge
  only:
    refs:
      - master
    variables:
      - $CI_PROJECT_PATH == "computing/cbmroot"

339
#
340
# job matrix for build jobs
341
#
342

343
CbmRoot_Merge_realData:
344
345
346
  <<: [*realData_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *realData_variables]
347

348
CbmRoot_Merge_Singularity_debian10_jun19:
349
350
  <<: [*singularity_tag, *check_merge_request, *build_and_test]
  variables:
351
    <<: [*mergeRequestVariables, *singularity_debian10_variables_jun19]
352

353
354
355
356
357
358
359
360
361
362
CbmRoot_Merge_Singularity_debian8_jun19:
  <<: [*singularity_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *singularity_debian8_variables_jun19]

CbmRoot_Merge_Singularity_debian8_nov20:
  <<: [*singularity_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *singularity_debian8_variables_nov20]

363
364
365
366
367
368
369
370
371
372
373
374
375
376
CbmRoot_Merge_Singularity_debian8_apr21:
  <<: [*singularity_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *singularity_debian8_variables_apr21]

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

CbmRoot_Merge_Singularity_centos7_apr21:
  <<: [*singularity_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *singularity_centos7_variables_apr21]
377

378
379
380
381
382
CbmRoot_Merge:
  <<: [*linux_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *linux_variables]

383
384
385
386
387
388
389
390
391
392
393
394
#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]
395
  variables:
396
    <<: [*mergeRequestVariables, *macosx_11_variables]
397
398
399
400
401

CbmRoot_Continuous:
  <<: [*linux_tag, *check_merge, *build_and_test]
  variables:
    <<: [*mergeVariables, *linux_variables]
402

403
404
405
InformCodeOwners:
  stage: finalise
  tags:
406
    - Code_Owners
407
408
409
410
411
412
413
414
415
416
417
418
  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

419
420
421
422
423
424
pages:
  stage: documentation
  image: alpine
  tags:
    - docker
  script:
Administrator's avatar
Administrator committed
425
    - apk update && apk add doxygen graphviz
426
427
428
    - doxygen doxygen/cbmDoxyfile.conf
    - mv html-doc/html public/
  artifacts:
Administrator's avatar
Administrator committed
429
    expire_in: 1 day
430
431
432
    paths:
      - public
  only:
433
    - nightly_master