.gitlab-ci.yml 7.39 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
11
12
13
14
15
16
17
  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
18
    # comparison
Administrator's avatar
Administrator committed
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
    # 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

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
LinearHistCheck:
  stage: checkRepository
  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
63
64
65
66
67
68
69
70
71
72
73
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
74
    # comparison
Administrator's avatar
Administrator committed
75
76
77
78
79
80
81
82
83
84
85
86
87
    - 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

88

89
90
91
92
93
CbmRoot_Continuous:
  stage: build
  tags:
    - CbmRoot
  only:
Administrator's avatar
Administrator committed
94
95
    refs:
      - master
96
    variables:
Administrator's avatar
Administrator committed
97
      - $CI_PROJECT_PATH == "computing/cbmroot"
Administrator's avatar
Administrator committed
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#  cache:
#    paths:
#      - build/
#      - external/AnalysisTree/
#      - external/AnaylysisTreeQA/
#      - external/DataTree/
#      - external/DataTreeQA/
#      - external/KFParticle/
#      - external/NicaFemto/
#      - external/Vc/
#      - external/cppzmq/
#      - external/flib_dpb/flib_dpb/
#      - external/flib_dpb_20/
#      - external/ipc/ipc/
#      - external/ipc_legacy/ipc/
#      - external/jsroot/
#      - external/spadic/spadic/
#      - input
#      - geometry
#      - parameters
118
119
  script:
    - set -xv
120
    - mkdir -p build
121
    - cd build
Administrator's avatar
Administrator committed
122
123
124
#    - find . -name "*.root" -delete
#    - find . -name "*_ok" -delete
#    - find . -name "all_*.par" -delete
125
126
127
128
129
    - 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
130
    - echo "export FAIRROOTPATH=/cvmfs/fairroot.gsi.de/fairroot/\${FAIRROOT_VERSION}_fairsoft-\${FAIRSOFT_VERSION}" >> Dart.cfg
131
132
133
134
135
136
137
138
    - 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
Administrator's avatar
Administrator committed
139
140
141
142
143
#    - cd build
#    - find . -name "*.root" -delete
#    - find . -name "*_ok" -delete
#    - find . -name "all_*.par" -delete
#    - cd ..
144
145
146
147
148
149


CbmRoot_Merge:
  stage: build
  tags:
    - CbmRoot
150
151
152
153
  only:
    refs:
      - merge_requests
    variables:
Administrator's avatar
Administrator committed
154
      - $CI_MERGE_REQUEST_PROJECT_PATH == "computing/cbmroot" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
155
  script:
Administrator's avatar
Administrator committed
156
157
    - echo $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH
    - echo $CI_MERGE_REQUEST_PROJECT_PATH
158
159
160
161
    - if [ "$CI_MERGE_REQUEST_PROJECT_PATH" != "computing/cbmroot" ]; then
    -   echo "Should not come here"
    -   exit 1
    - fi
Administrator's avatar
Administrator committed
162
163
164
    - echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
    - echo $CI_MERGE_REQUEST_ID
    - echo $CI_MERGE_REQUEST_IID
165
166
167
168
    - 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
169
    - echo "export FAIRROOTPATH=/cvmfs/fairroot.gsi.de/fairroot/\${FAIRROOT_VERSION}_fairsoft-\${FAIRSOFT_VERSION}" >> Dart.cfg
170
171
172
173
174
175
176
    - 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
177
    - $PWD/Dart.sh MergeRequest Dart.cfg
178

179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
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

212
213
214
215
216
217
218
219
220
221
222
223
224
pages:
  stage: documentation
  image: alpine
  tags:
    - docker
  script:
    - apk update && apk add doxygen
    - doxygen doxygen/cbmDoxyfile.conf
    - mv html-doc/html public/
  artifacts:
    paths:
      - public
  only:
225
    - nightly_master