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

RebaseCheck:
8
  stage: checkRepository
Administrator's avatar
Administrator committed
9
10
  variables:
    GIT_DEPTH: 100
Administrator's avatar
Administrator committed
11
12
13
14
15
16
17
18
19
  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
20
    # comparison
Administrator's avatar
Administrator committed
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
    # Check if a rebase is needed
    # If a rebase is needed stop immediately
    - scripts/connect_upstream_repo.sh $CI_MERGE_REQUEST_PROJECT_URL
    - 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

38
39
LinearHistCheck:
  stage: checkRepository
Administrator's avatar
Administrator committed
40
41
  variables:
    GIT_DEPTH: 100
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
  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
    # comparison
    # Check if the history introduced by the MR is linear (no branch loop in fork)
    # If not linear stop immediately
    - 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

Administrator's avatar
Administrator committed
67
68
69
70
71
72
73
74
75
76
77
FormatCheck:
  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
78
    # comparison
Administrator's avatar
Administrator committed
79
80
81
82
83
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
    - 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

92

93
94
95
96
97
CbmRoot_Continuous:
  stage: build
  tags:
    - CbmRoot
  only:
Administrator's avatar
Administrator committed
98
99
    refs:
      - master
100
    variables:
Administrator's avatar
Administrator committed
101
      - $CI_PROJECT_PATH == "computing/cbmroot"
102
103
  script:
    - set -xv
104
    - mkdir -p build
105
106
107
108
109
110
    - 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
111
    - echo "export FAIRROOTPATH=/cvmfs/fairroot.gsi.de/fairroot/\${FAIRROOT_VERSION}_fairsoft-\${FAIRSOFT_VERSION}" >> Dart.cfg
112
113
114
    - echo "export BUILDDIR=$PWD/build" >> Dart.cfg
    - echo "export SOURCEDIR=$PWD" >> Dart.cfg
    - echo "export NCPU=5" >> Dart.cfg
115
    - echo "export PATH=/cvmfs/it.gsi.de/cmake/3.19.1/bin:$PATH" >> Dart.cfg
116
117
118
119
120
121
122
123
124
    - ls
    - pwd
    - cat Dart.cfg
    - $PWD/Dart.sh Continuous Dart.cfg

CbmRoot_Merge:
  stage: build
  tags:
    - CbmRoot
125
126
127
128
  only:
    refs:
      - merge_requests
    variables:
Administrator's avatar
Administrator committed
129
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
130
  script:
Administrator's avatar
Administrator committed
131
132
    - echo $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH
    - echo $CI_MERGE_REQUEST_PROJECT_PATH
133
134
135
136
    - if [ "$CI_MERGE_REQUEST_PROJECT_PATH" != "computing/cbmroot" ]; then
    -   echo "Should not come here"
    -   exit 1
    - fi
Administrator's avatar
Administrator committed
137
138
139
    - echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
    - echo $CI_MERGE_REQUEST_ID
    - echo $CI_MERGE_REQUEST_IID
140
141
142
143
    - 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
144
    - echo "export FAIRROOTPATH=/cvmfs/fairroot.gsi.de/fairroot/\${FAIRROOT_VERSION}_fairsoft-\${FAIRSOFT_VERSION}" >> Dart.cfg
145
146
147
    - echo "export BUILDDIR=$PWD/build" >> Dart.cfg
    - echo "export SOURCEDIR=$PWD" >> Dart.cfg
    - echo "export NCPU=5" >> Dart.cfg
148
    - echo "export PATH=/cvmfs/it.gsi.de/cmake/3.19.1/bin:$PATH" >> Dart.cfg
149
150
151
    - ls
    - pwd
    - cat Dart.cfg
Administrator's avatar
Administrator committed
152
    - $PWD/Dart.sh MergeRequest Dart.cfg
153

154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
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

187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
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
211
    - echo "export RAW_DATA_PATH=/opt/cbmsoft/beamtime-test-data/reduced/" >> Dart.cfg
212
213
214
215
216
217
218
219
220
    - echo "export BUILDDIR=$PWD/build" >> Dart.cfg
    - echo "export SOURCEDIR=$PWD" >> Dart.cfg
    - echo "export NCPU=16" >> Dart.cfg
    - echo "export PATH=\$SIMPATH/bin:$PATH" >> Dart.cfg
    - ls
    - pwd
    - cat Dart.cfg
    - $PWD/Dart.sh MergeRequest Dart.cfg

221
222
223
224
225
226
pages:
  stage: documentation
  image: alpine
  tags:
    - docker
  script:
Administrator's avatar
Administrator committed
227
    - apk update && apk add doxygen graphviz
228
229
230
    - doxygen doxygen/cbmDoxyfile.conf
    - mv html-doc/html public/
  artifacts:
Administrator's avatar
Administrator committed
231
    expire_in: 1 day
232
233
234
    paths:
      - public
  only:
235
    - nightly_master