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

RebaseCheck:
9
  stage: checkRepository
Administrator's avatar
Administrator committed
10
11
  variables:
    GIT_DEPTH: 100
Administrator's avatar
Administrator committed
12
13
  tags:
    - CbmRoot
14
=======
Administrator's avatar
Administrator committed
15
  
16
17
RebaseCheck:
  stage: checkRepository
18
  image: alpine
19
  tags:
20
    - docker
21
>>>>>>> 3bb7564c1f3983233a72370527a32a8be1c86ffd
Administrator's avatar
Administrator committed
22
23
24
25
  only:
    refs:
      - merge_requests
    variables:
26
<<<<<<< HEAD
Administrator's avatar
Administrator committed
27
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
28
=======
29
      - $CI_MERGE_REQUEST_PROJECT_PATH == "CbmSoft/cbmroot_geometry" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
30
>>>>>>> 3bb7564c1f3983233a72370527a32a8be1c86ffd
Administrator's avatar
Administrator committed
31
32
  script:
    # Get the upstream repository manually. I did not find any other way to have it for
33
    # comparison
Administrator's avatar
Administrator committed
34
35
    # Check if a rebase is needed
    # If a rebase is needed stop immediately
36
<<<<<<< HEAD
Administrator's avatar
Administrator committed
37
    - scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
38
=======
39
    - apk update && apk add git bash
40
    - ci_scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
41
>>>>>>> 3bb7564c1f3983233a72370527a32a8be1c86ffd
Administrator's avatar
Administrator committed
42
43
44
45
46
47
48
49
50
51
52
53
54
55
    - git fetch upstream
    - hash1=$(git show-ref upstream/master | cut -f1 -d' ')
    - hash2=$(git merge-base upstream/master origin/$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME)
    - 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

56
57
LinearHistCheck:
  stage: checkRepository
58
<<<<<<< HEAD
Administrator's avatar
Administrator committed
59
60
  variables:
    GIT_DEPTH: 100
61
62
  tags:
    - CbmRoot
63
=======
64
  image: alpine
65
  tags:
66
    - docker
67
>>>>>>> 3bb7564c1f3983233a72370527a32a8be1c86ffd
68
69
70
71
  only:
    refs:
      - merge_requests
    variables:
72
<<<<<<< HEAD
73
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
74
=======
75
      - $CI_MERGE_REQUEST_PROJECT_PATH == "CbmSoft/cbmroot_geometry" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
76
>>>>>>> 3bb7564c1f3983233a72370527a32a8be1c86ffd
77
78
79
80
81
  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
82
<<<<<<< HEAD
83
    - scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
84
=======
85
    - apk update && apk add git bash
86
    - ci_scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
87
>>>>>>> 3bb7564c1f3983233a72370527a32a8be1c86ffd
88
89
90
91
92
93
94
95
96
97
98
99
    - 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

100
<<<<<<< HEAD
Administrator's avatar
Administrator committed
101
102
103
104
FormatCheck:
  stage: checkFormat
  tags:
    - CbmRoot
105
=======
Administrator's avatar
Administrator committed
106
107
108
109
110
FileFormatCheck:
  stage: checkFormat
  image: alpine
  tags:
    - docker
111
>>>>>>> 3bb7564c1f3983233a72370527a32a8be1c86ffd
Administrator's avatar
Administrator committed
112
113
114
115
  only:
    refs:
      - merge_requests
    variables:
116
<<<<<<< HEAD
Administrator's avatar
Administrator committed
117
118
119
      - $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
120
    # comparison
Administrator's avatar
Administrator committed
121
122
123
124
125
126
127
128
129
130
131
132
133
    - 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
    - echo "export PATH=/cvmfs/fairroot.gsi.de/clang-format-8.0.1:\$SIMPATH/bin:$PATH:/cvmfs/it.gsi.de/compiler/llvm/6.0.1/bin/" >> env.sh
    - 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

134

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

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

196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
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
    - echo "export LINUX_FLAVOUR=macOS_10.13" >> Dart.cfg
    - echo "export FAIRSOFT_VERSION=jun19p1" >> Dart.cfg
    - echo "export FAIRROOT_VERSION=v18.2.0" >> Dart.cfg
    - 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
    - echo "export PATH=\$SIMPATH/bin:$PATH" >> Dart.cfg
    - ls
    - pwd
    - cat Dart.cfg
    - $PWD/Dart.sh MergeRequest Dart.cfg

229
230
231
232
233
234
pages:
  stage: documentation
  image: alpine
  tags:
    - docker
  script:
Administrator's avatar
Administrator committed
235
    - apk update && apk add doxygen graphviz
236
237
238
    - doxygen doxygen/cbmDoxyfile.conf
    - mv html-doc/html public/
  artifacts:
Administrator's avatar
Administrator committed
239
    expire_in: 1 day
240
241
242
    paths:
      - public
  only:
243
    - nightly_master
244
=======
Administrator's avatar
Administrator committed
245
246
247
248
249
250
251
252
      - $CI_MERGE_REQUEST_PROJECT_PATH == "CbmSoft/cbmroot_geometry" && $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
    - ci_scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
    - git fetch upstream
    - ci_scripts/check-file-format.sh upstream
253
>>>>>>> 3bb7564c1f3983233a72370527a32a8be1c86ffd