.gitlab-ci.yml 10.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
11
  variables:
    GIT_DEPTH: 100
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
44
  variables:
    GIT_DEPTH: 100
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
137
CbmRoot_Continuous:
  stage: build
  tags:
    - CbmRoot
  only:
Administrator's avatar
Administrator committed
138
139
    refs:
      - master
140
    variables:
Administrator's avatar
Administrator committed
141
      - $CI_PROJECT_PATH == "computing/cbmroot"
142
143
  script:
    - set -xv
144
    - mkdir -p build
145
146
147
148
149
150
    - cd build
    - cd ..
    - echo "export LINUX_FLAVOUR=Debian8.11" >> Dart.cfg
    - echo "export FAIRSOFT_VERSION=jun19p1" >> Dart.cfg
    - echo "export FAIRROOT_VERSION=v18.2.0" >> Dart.cfg
    - echo "export SIMPATH=/cvmfs/fairroot.gsi.de/fairsoft/\${FAIRSOFT_VERSION}" >> Dart.cfg
Administrator's avatar
Administrator committed
151
    - echo "export FAIRROOTPATH=/cvmfs/fairroot.gsi.de/fairroot/\${FAIRROOT_VERSION}_fairsoft-\${FAIRSOFT_VERSION}" >> Dart.cfg
152
153
154
    - echo "export BUILDDIR=$PWD/build" >> Dart.cfg
    - echo "export SOURCEDIR=$PWD" >> Dart.cfg
    - echo "export NCPU=5" >> Dart.cfg
155
    - echo "export PATH=/cvmfs/it.gsi.de/cmake/3.19.1/bin:$PATH" >> Dart.cfg
156
157
158
159
160
161
162
163
164
    - ls
    - pwd
    - cat Dart.cfg
    - $PWD/Dart.sh Continuous Dart.cfg

CbmRoot_Merge:
  stage: build
  tags:
    - CbmRoot
165
166
167
168
  only:
    refs:
      - merge_requests
    variables:
Administrator's avatar
Administrator committed
169
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
170
  script:
Administrator's avatar
Administrator committed
171
172
    - echo $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH
    - echo $CI_MERGE_REQUEST_PROJECT_PATH
173
174
175
176
    - if [ "$CI_MERGE_REQUEST_PROJECT_PATH" != "computing/cbmroot" ]; then
    -   echo "Should not come here"
    -   exit 1
    - fi
Administrator's avatar
Administrator committed
177
178
179
    - echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
    - echo $CI_MERGE_REQUEST_ID
    - echo $CI_MERGE_REQUEST_IID
180
181
182
183
    - echo "export LINUX_FLAVOUR=Debian8.11" >> Dart.cfg
    - echo "export FAIRSOFT_VERSION=jun19p1" >> Dart.cfg
    - echo "export FAIRROOT_VERSION=v18.2.0" >> Dart.cfg
    - echo "export SIMPATH=/cvmfs/fairroot.gsi.de/fairsoft/\${FAIRSOFT_VERSION}" >> Dart.cfg
184
    - echo "export FAIRROOTPATH=/cvmfs/fairroot.gsi.de/fairroot/\${FAIRROOT_VERSION}_fairsoft-\${FAIRSOFT_VERSION}" >> Dart.cfg
185
186
187
    - echo "export BUILDDIR=$PWD/build" >> Dart.cfg
    - echo "export SOURCEDIR=$PWD" >> Dart.cfg
    - echo "export NCPU=5" >> Dart.cfg
188
    - echo "export PATH=/cvmfs/it.gsi.de/cmake/3.19.1/bin:$PATH" >> Dart.cfg
189
190
191
    - ls
    - pwd
    - cat Dart.cfg
Administrator's avatar
Administrator committed
192
    - $PWD/Dart.sh MergeRequest Dart.cfg
193

194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
CbmRoot_Merge_macosx:
  stage: build
  tags:
    - CbmRoot_macosx
  only:
    refs:
      - merge_requests
    variables:
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
  script:
    - echo $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH
    - echo $CI_MERGE_REQUEST_PROJECT_PATH
    - if [ "$CI_MERGE_REQUEST_PROJECT_PATH" != "computing/cbmroot" ]; then
    -   echo "Should not come here"
    -   exit 1
    - fi
    - echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
    - echo $CI_MERGE_REQUEST_ID
    - echo $CI_MERGE_REQUEST_IID
213
    - echo "export LINUX_FLAVOUR=macosx" >> Dart.cfg
214
    - echo "export FAIRSOFT_VERSION=jun19p1" >> Dart.cfg
215
    - echo "export FAIRROOT_VERSION=v18.2.1" >> Dart.cfg
216
217
218
219
220
221
222
223
224
225
    - echo "export SIMPATH=/opt/fairsoft/\${FAIRSOFT_VERSION}" >> Dart.cfg
    - echo "export FAIRROOTPATH=/opt/fairroot/\${FAIRROOT_VERSION}_fairsoft-\${FAIRSOFT_VERSION}" >> Dart.cfg
    - echo "export BUILDDIR=$PWD/build" >> Dart.cfg
    - echo "export SOURCEDIR=$PWD" >> Dart.cfg
    - echo "export NCPU=4" >> Dart.cfg
    - ls
    - pwd
    - cat Dart.cfg
    - $PWD/Dart.sh MergeRequest Dart.cfg

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
CbmRoot_Merge_Singularity:
  stage: build
  tags:
    - CbmRoot_singularity
  only:
    refs:
      - merge_requests
    variables:
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
  script:
    - echo $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH
    - echo $CI_MERGE_REQUEST_PROJECT_PATH
    - if [ "$CI_MERGE_REQUEST_PROJECT_PATH" != "computing/cbmroot" ]; then
    -   echo "Should not come here"
    -   exit 1
    - fi
    - echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
    - echo $CI_MERGE_REQUEST_ID
    - echo $CI_MERGE_REQUEST_IID
    - echo "export LINUX_FLAVOUR=Debian10" >> Dart.cfg
    - echo "export FAIRSOFT_VERSION=apr21" >> Dart.cfg
    - echo "export FAIRROOT_VERSION=v18.6.3" >> Dart.cfg
    - echo "export SIMPATH=/cvmfs/fairsoft.gsi.de/debian10/fairsoft/\${FAIRSOFT_VERSION}" >> Dart.cfg
    - echo "export FAIRROOTPATH=/cvmfs/fairsoft.gsi.de/debian10/fairroot/\${FAIRROOT_VERSION}_fs_\${FAIRSOFT_VERSION}" >> Dart.cfg
    - echo "export BUILDDIR=$PWD/build" >> Dart.cfg
    - echo "export SOURCEDIR=$PWD" >> Dart.cfg
    - echo "export NCPU=4" >> Dart.cfg
    - ls
    - pwd
    - cat Dart.cfg
    - $PWD/Dart.sh MergeRequest Dart.cfg

258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
CbmRoot_Merge_realData:
  stage: build
  tags:
    - CbmRoot_realData
  only:
    refs:
      - merge_requests
    variables:
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
  script:
    - echo $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH
    - echo $CI_MERGE_REQUEST_PROJECT_PATH
    - if [ "$CI_MERGE_REQUEST_PROJECT_PATH" != "computing/cbmroot" ]; then
    -   echo "Should not come here"
    -   exit 1
    - fi
    - echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
    - echo $CI_MERGE_REQUEST_ID
    - echo $CI_MERGE_REQUEST_IID
    - echo "export LINUX_FLAVOUR=Debian10" >> Dart.cfg
    - echo "export FAIRSOFT_VERSION=jun19p2" >> Dart.cfg
    - echo "export FAIRROOT_VERSION=v18.2.1" >> Dart.cfg
    - echo "export SIMPATH=/opt/cbmsoft/fairsoft_\${FAIRSOFT_VERSION}_root6/installation" >> Dart.cfg
    - echo "export FAIRROOTPATH=/opt/cbmsoft/fairroot_\${FAIRROOT_VERSION}-fairsoft_\${FAIRSOFT_VERSION}_root6" >> Dart.cfg
282
    - echo "export RAW_DATA_PATH=/opt/cbmsoft/beamtime-test-data/reduced/" >> Dart.cfg
283
284
285
    - echo "export BUILDDIR=$PWD/build" >> Dart.cfg
    - echo "export SOURCEDIR=$PWD" >> Dart.cfg
    - echo "export NCPU=16" >> Dart.cfg
286
    - echo "export PATH=/opt/cmake/3.20.1/bin:$PATH" >> Dart.cfg
287
288
289
290
291
    - ls
    - pwd
    - cat Dart.cfg
    - $PWD/Dart.sh MergeRequest Dart.cfg

292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
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

308
309
310
311
312
313
pages:
  stage: documentation
  image: alpine
  tags:
    - docker
  script:
Administrator's avatar
Administrator committed
314
    - apk update && apk add doxygen graphviz
315
316
317
    - doxygen doxygen/cbmDoxyfile.conf
    - mv html-doc/html public/
  artifacts:
Administrator's avatar
Administrator committed
318
    expire_in: 1 day
319
320
321
    paths:
      - public
  only:
322
    - nightly_master