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

133
134
135
136
#
# job template
#
.build_and_test: &build_and_test
Administrator's avatar
Administrator committed
137
  before_script:
138
    - if [ "$CI_MERGE_REQUEST_PROJECT_PATH" != "computing/cbmroot" ]; then
Administrator's avatar
Administrator committed
139
140
141
142
143
    -   if [ "$CI_PROJECT_PATH" != "computing/cbmroot" ]; then
    -     echo "Should not come here"
    -     env
    -     exit 1
    -   fi
144
    - fi
Administrator's avatar
Administrator committed
145
146
  script:
    - echo "export LINUX_FLAVOUR=$OS" >> Dart.cfg
147
148
    - echo "export SIMPATH=$SIMPATH" >> Dart.cfg
    - echo "export FAIRROOTPATH=$FAIRROOTPATH" >> Dart.cfg
Administrator's avatar
Administrator committed
149
    - if [[ -n $RAW_DATA_PATH ]]; then
150
    -   echo "export RAW_DATA_PATH=$RAW_DATA_PATH" >> Dart.cfg
Administrator's avatar
Administrator committed
151
    - fi
152
153
    - echo "export BUILDDIR=$PWD/build" >> Dart.cfg
    - echo "export SOURCEDIR=$PWD" >> Dart.cfg
154
155
156
    - if [[ -n $EXTRA_PATH ]]; then
    -   echo "export PATH=$EXTRA_PATH:$PATH" >> Dart.cfg
    - fi
157
158
159
160
161
162
    - if [[ -n $EXTRA_FLAGS ]]; then
    -   echo "export EXTRA_FLAGS=$EXTRA_FLAGS" >> Dart.cfg
    - fi
    - if [[ -n $CONFIGFILE ]]; then
    -   source $CONFIGFILE $FAIRSOFT_VERSION
    - fi
163
    - $PWD/Dart.sh $BUILD_TYPE Dart.cfg
Administrator's avatar
Administrator committed
164
  after_script:
165
166
167
168
169
170
171
172
173
    - rm -rf build

#
# job element definitions
#
.realData_tag: &realData_tag
  stage: build
  tags:
    - CbmRoot_realData
174
175

.realData_variables: &realData_variables
176
    OS: "Debian10"
177
178
179
    EXTRA_PATH: /opt/cmake/3.20.1/bin
    NCPU: 16
    RAW_DATA_PATH: "/opt/cbmsoft/beamtime-test-data/reduced/"
180
181
    FAIRSOFT_VERSION: "jun19p2_root6"
    FAIRROOT_VERSION: "v18.2.1"
182
    BASE_PATH: "/opt/cbmsoft"
183
184
185
186
187
188
189
    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
190

191
.singularity_debian10_variables_jun19: &singularity_debian10_variables_jun19
192
    OS: debian10
193
194
195
    FAIRSOFT_VERSION: jun19p2
    FAIRROOT_VERSION: v18.2.1
    BASE_PATH: "/cvmfs/fairsoft.gsi.de/$OS"
196
197
    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_fs_${FAIRSOFT_VERSION}"
198

199
.singularity_debian8_variables_jun19: &singularity_debian8_variables_jun19
200
201
202
203
204
205
    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}"
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
    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
224
    CONFIGFILE: "/cvmfs/cbm.gsi.de/$OS/bin/setup_development_environment.sh"
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
.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"
250
    FAIRROOT_VERSION: "v18.2.1"
251
252
253
254
    BASE_PATH: "/opt"
    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_fairsoft-${FAIRSOFT_VERSION}"

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

281
282
.mergeVariables: &mergeVariables
    BUILD_TYPE: "Continuous"
283

284
285
.mergeRequestVariables: &mergeRequestVariables
    BUILD_TYPE: "MergeRequest"
286

287
.check_merge_request: &check_merge_request
288
289
290
291
292
293
  only:
    refs:
      - merge_requests
    variables:
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"

294
295
296
297
298
299
300
.check_merge: &check_merge
  only:
    refs:
      - master
    variables:
      - $CI_PROJECT_PATH == "computing/cbmroot"

301
#
302
# job matrix for build jobs
303
304
#
CbmRoot_Merge_realData:
305
306
307
  <<: [*realData_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *realData_variables]
308

309
CbmRoot_Merge_Singularity_debian10_jun19:
310
311
  <<: [*singularity_tag, *check_merge_request, *build_and_test]
  variables:
312
    <<: [*mergeRequestVariables, *singularity_debian10_variables_jun19]
313

314
315
316
317
318
319
320
321
322
323
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]

324
325
326
327
##CbmRoot_Merge_Singularity_debian8_apr21:
##  <<: [*singularity_tag, *check_merge_request, *build_and_test]
##  variables:
##    <<: [*mergeRequestVariables, *singularity_debian8_variables_apr21]
328

329
330
331
332
333
CbmRoot_Merge:
  <<: [*linux_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *linux_variables]

334
335
336
337
338
339
340
341
342
343
344
345
#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]
346
  variables:
347
    <<: [*mergeRequestVariables, *macosx_11_variables]
348
349
350
351
352

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

354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
InformCodeOwners:
  stage: finalise
  tags:
    - CbmRoot_macosx
  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

370
371
372
373
374
375
pages:
  stage: documentation
  image: alpine
  tags:
    - docker
  script:
Administrator's avatar
Administrator committed
376
    - apk update && apk add doxygen graphviz
377
378
379
    - doxygen doxygen/cbmDoxyfile.conf
    - mv html-doc/html public/
  artifacts:
Administrator's avatar
Administrator committed
380
    expire_in: 1 day
381
382
383
    paths:
      - public
  only:
384
    - nightly_master