.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
    - scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
    - git fetch upstream
Administrator's avatar
Administrator committed
86
87
88
89
    - echo "export FAIRSOFT_VERSION=apr21p2" > env.sh
    - echo "export FAIRROOT_VERSION=v18.6.7" >> env.sh
    - echo "export SIMPATH=/cvmfs/fairsoft.gsi.de/debian10/fairsoft/\${FAIRSOFT_VERSION}" >> env.sh
    - echo "export FAIRROOTPATH=/cvmfs/fairsoft.gsi.de/debian10/fairroot/\${FAIRROOT_VERSION}_fs_\${FAIRSOFT_VERSION}" >> env.sh
Administrator's avatar
Administrator committed
90
91
    - 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
    - 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
96
97
FileFormatCheck:
  stage: checkFormat
98
  image: alpine
99
  tags:
100
    - docker
101
102
103
104
105
106
107
108
  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
109
    - apk update && apk add git bash file
110
111
112
    - scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
    - git fetch upstream
    - scripts/check-file-format.sh upstream
113

114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151

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


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

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

.realData_variables: &realData_variables
195
    OS: "Debian10"
196
197
198
    EXTRA_PATH: /opt/cmake/3.20.1/bin
    NCPU: 16
    RAW_DATA_PATH: "/opt/cbmsoft/beamtime-test-data/reduced/"
Administrator's avatar
Administrator committed
199
200
    FAIRSOFT_VERSION: "apr21p2_root6"
    FAIRROOT_VERSION: "v18.6.7"
201
    BASE_PATH: "/opt/cbmsoft"
202
203
204
205
206
207
208
    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
209

210
211
.singularity_debian10_variables_apr21: &singularity_debian10_variables_apr21
    OS: debian10
Administrator's avatar
Administrator committed
212
213
    FAIRSOFT_VERSION: apr21p2
    FAIRROOT_VERSION: v18.6.7
214
215
216
217
218
219
220
    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
221
222
    FAIRSOFT_VERSION: apr21p2
    FAIRROOT_VERSION: v18.6.7
223
224
225
226
227
    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
228
.singularity_debian11_variables_apr21: &singularity_debian11_variables_apr21
Administrator's avatar
Administrator committed
229
    CONTAINER: "/cvmfs/cbm.gsi.de/containers/debian11_v18.6.7_apr21p2.sif"
Administrator's avatar
Administrator committed
230
    OS: debian11
Administrator's avatar
Administrator committed
231
232
    FAIRSOFT_VERSION: apr21p2
    FAIRROOT_VERSION: v18.6.7
Administrator's avatar
Administrator committed
233
    BASE_PATH: "/opt/"
Administrator's avatar
Administrator committed
234
    SIMPATH: "$BASE_PATH/fairsoft/${FAIRSOFT_VERSION}"
Administrator's avatar
Administrator committed
235
    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_${FAIRSOFT_VERSION}"
236
    EXTRA_FLAGS: '"-DCBM_TEST_INSTALL=TRUE\" \"-DCMAKE_INSTALL_PREFIX=install"'
Administrator's avatar
Administrator committed
237

238
239
240
241
242
243
.linux_tag: &linux_tag
  stage: build
  tags:
    - CbmRoot

.linux_variables: &linux_variables
Administrator's avatar
Administrator committed
244
    OS: "Debian10.11"
245
    NCPU: 5
Administrator's avatar
Administrator committed
246
247
    FAIRSOFT_VERSION: "apr21p2"
    FAIRROOT_VERSION: "v18.6.7"
Administrator's avatar
Administrator committed
248
    BASE_PATH: "/cvmfs/fairsoft.gsi.de/debian10"
249
    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
Administrator's avatar
Administrator committed
250
    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_fs_${FAIRSOFT_VERSION}"
Administrator's avatar
Administrator committed
251
    EXTRA_PATH: "${SIMPATH}/bin"
Administrator's avatar
Administrator committed
252
253

.macosx_tag: &macosx_tag
254
255
  stage: build
  tags:
Administrator's avatar
Administrator committed
256
    - qemu_macosx
257

Administrator's avatar
Administrator committed
258
259
.macosx_12_variables: &macosx_12_variables
    OS: "macOS12"
Administrator's avatar
Administrator committed
260
261
    FAIRSOFT_VERSION: "apr21p2"
    FAIRROOT_VERSION: "v18.6.7"
262
263
    BASE_PATH: "/opt"
    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
Administrator's avatar
Administrator committed
264
    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_${FAIRSOFT_VERSION}"
Administrator's avatar
Administrator committed
265
266
    IMAGE_NAME: "${OS}_${FAIRROOT_VERSION}_${FAIRSOFT_VERSION}"
    EXTRA_PATH: /usr/local/bin
267

Administrator's avatar
Administrator committed
268
269
270
271
272
273
274
275
276
.macosx_11_variables: &macosx_11_variables
    OS: "macOS11"
    FAIRSOFT_VERSION: "apr21p2"
    FAIRROOT_VERSION: "v18.6.7"
    BASE_PATH: "/opt"
    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_${FAIRSOFT_VERSION}"
    IMAGE_NAME: "${OS}_${FAIRROOT_VERSION}_${FAIRSOFT_VERSION}"
    EXTRA_PATH: /usr/local/bin
Administrator's avatar
Administrator committed
277

Administrator's avatar
Administrator committed
278
279
.macosx_1015_variables: &macosx_1015_variables
    OS: "macOS1015"
280
    FAIRSOFT_VERSION: "apr21p2"
Administrator's avatar
Administrator committed
281
    FAIRROOT_VERSION: "v18.6.7"
Administrator's avatar
Administrator committed
282
283
284
    BASE_PATH: "/opt"
    SIMPATH: "$BASE_PATH/fairsoft/$FAIRSOFT_VERSION"
    FAIRROOTPATH: "$BASE_PATH/fairroot/${FAIRROOT_VERSION}_${FAIRSOFT_VERSION}"
Administrator's avatar
Administrator committed
285
286
    IMAGE_NAME: "${OS}_${FAIRROOT_VERSION}_${FAIRSOFT_VERSION}"
    EXTRA_PATH: /usr/local/bin
Administrator's avatar
Administrator committed
287

288
289
.mergeVariables: &mergeVariables
    BUILD_TYPE: "Continuous"
290

291
292
.mergeRequestVariables: &mergeRequestVariables
    BUILD_TYPE: "MergeRequest"
293

294
.check_merge_request: &check_merge_request
295
296
297
298
299
300
  only:
    refs:
      - merge_requests
    variables:
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"

301
302
303
304
305
306
307
.check_merge: &check_merge
  only:
    refs:
      - master
    variables:
      - $CI_PROJECT_PATH == "computing/cbmroot"

308
#
309
# job matrix for build jobs
310
#
311

312
CbmRoot_Merge_realData:
313
314
315
  <<: [*realData_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *realData_variables]
316

317
318
319
320
321
CbmRoot_Merge_Singularity_debian10_apr21:
  <<: [*singularity_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *singularity_debian10_variables_apr21]

Administrator's avatar
Administrator committed
322
323
324
325
326
CbmRoot_Merge_Singularity_debian11_apr21:
  <<: [*singularity_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *singularity_debian11_variables_apr21]

327
328
329
330
CbmRoot_Merge_Singularity_centos7_apr21:
  <<: [*singularity_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *singularity_centos7_variables_apr21]
331

Administrator's avatar
Administrator committed
332
333
334
335
CbmRoot_Merge_macosx_12:
  <<: [*macosx_tag, *check_merge_request, *build_and_test]
  variables:
    <<: [*mergeRequestVariables, *macosx_12_variables]
336
337

CbmRoot_Merge_macosx_11:
Administrator's avatar
Administrator committed
338
  <<: [*macosx_tag, *check_merge_request, *build_and_test]
339
  variables:
340
    <<: [*mergeRequestVariables, *macosx_11_variables]
341

Administrator's avatar
Administrator committed
342
343
CbmRoot_Merge_macosx_1015:
  <<: [*macosx_tag, *check_merge_request, *build_and_test]
Administrator's avatar
Administrator committed
344
  variables:
Administrator's avatar
Administrator committed
345
    <<: [*mergeRequestVariables, *macosx_1015_variables]
Administrator's avatar
Administrator committed
346

347
348
349
350
CbmRoot_Continuous:
  <<: [*linux_tag, *check_merge, *build_and_test]
  variables:
    <<: [*mergeVariables, *linux_variables]
351

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

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