bootstrap: Add chrpath as a required package
[metze/samba/wip.git] / .gitlab-ci.yml
1 # see https://docs.gitlab.com/ce/ci/yaml/README.html for all available options
2
3 stages:
4   - images
5   - build
6   - report
7
8 variables:
9   GIT_STRATEGY: fetch
10   GIT_DEPTH: "3"
11   # "--enable-coverage" or ""
12   SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE: ""
13   #
14   # we run autobuild.py inside a samba CI docker image located on gitlab's registry
15   # overwrite this variable if you want use your own image registry.
16   #
17   # Or better ask for access to the shared development repository, see
18   # https://wiki.samba.org/index.php/Samba_CI_on_gitlab#Getting_Access
19   #
20   SAMBA_CI_CONTAINER_REGISTRY: registry.gitlab.com/samba-team/devel/samba
21   #
22   # Set this to the contents of bootstrap/sha1sum.txt
23   # which is generated by bootstrap/template.py --render
24   #
25   SAMBA_CI_CONTAINER_TAG: 36dd95324f5406f62312648e83fde78a8267b386
26   #
27   # We use the ubuntu1804 image as default as
28   # it matches what we have on sn-devel-184.
29   #
30   SAMBA_CI_CONTAINER_IMAGE: ubuntu1804
31   #
32   # The following images are available
33   # Please see the samba-o3 sections at the end of this file!
34   # We should run that for each available image
35   #
36   SAMBA_CI_CONTAINER_IMAGE_ubuntu1804: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu1804:${SAMBA_CI_CONTAINER_TAG}
37   SAMBA_CI_CONTAINER_IMAGE_ubuntu1604: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu1604:${SAMBA_CI_CONTAINER_TAG}
38   SAMBA_CI_CONTAINER_IMAGE_debian9: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-debian9:${SAMBA_CI_CONTAINER_TAG}
39   SAMBA_CI_CONTAINER_IMAGE_debian10: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-debian10:${SAMBA_CI_CONTAINER_TAG}
40   SAMBA_CI_CONTAINER_IMAGE_opensuse150: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-opensuse150:${SAMBA_CI_CONTAINER_TAG}
41   SAMBA_CI_CONTAINER_IMAGE_opensuse151: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-opensuse151:${SAMBA_CI_CONTAINER_TAG}
42   SAMBA_CI_CONTAINER_IMAGE_fedora29: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-fedora29:${SAMBA_CI_CONTAINER_TAG}
43   SAMBA_CI_CONTAINER_IMAGE_fedora30: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-fedora30:${SAMBA_CI_CONTAINER_TAG}
44   SAMBA_CI_CONTAINER_IMAGE_fedora31: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-fedora31:${SAMBA_CI_CONTAINER_TAG}
45   SAMBA_CI_CONTAINER_IMAGE_centos7: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-centos7:${SAMBA_CI_CONTAINER_TAG}
46   SAMBA_CI_CONTAINER_IMAGE_centos8: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-centos8:${SAMBA_CI_CONTAINER_TAG}
47
48 include:
49   # The image creation details are specified in a separate file
50   # See bootstrap/README.md for details
51   - 'bootstrap/.gitlab-ci.yml'
52
53 .shared_template:
54   variables:
55     AUTOBUILD_JOB_NAME: $CI_JOB_NAME
56   image: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-${SAMBA_CI_CONTAINER_IMAGE}:${SAMBA_CI_CONTAINER_TAG}
57   stage: build
58   tags:
59     - docker
60     - shared
61   before_script:
62     - uname -a
63     - lsb_release -a
64     - cat /etc/os-release
65     - mount
66     - df -h
67     - cat /proc/swaps
68     - free -h
69       # ld will fail if coverage enabled, force link ld to ld.bfd
70     - if [ -n "$SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE" ]; then sudo ln -sf $(which ld.bfd) $(which ld); fi
71       # See bootstrap/.gitlab-ci.yml how to generate a new image
72     - echo "SAMBA_CI_CONTAINER_REGISTRY[${SAMBA_CI_CONTAINER_REGISTRY}]"
73     - echo "SAMBA_CI_CONTAINER_TAG[${SAMBA_CI_CONTAINER_TAG}]"
74     - bootstrap/template.py --sha1sum > /tmp/sha1sum-template.txt
75     - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-template.txt
76     - echo "${SAMBA_CI_CONTAINER_TAG}" > /tmp/sha1sum-tag.txt
77     - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-tag.txt
78     - diff -u bootstrap/sha1sum.txt /sha1sum.txt
79   after_script:
80     - mount
81     - df -h
82     - cat /proc/swaps
83     - free -h
84   artifacts:
85     expire_in: 1 week
86     paths:
87       - "*.stdout"
88       - "*.stderr"
89       - "*.info"
90       - system-info.txt
91   retry:
92     max: 2
93     when:
94       - runner_system_failure
95       - stuck_or_timeout_failure
96   script:
97     # gitlab predefines CI_JOB_NAME for each job. The gitlab job usually matches the
98     # autobuild name, which means we can define a default template that runs most autobuild jobs
99     - echo "Running cmd script/autobuild.py $AUTOBUILD_JOB_NAME $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase"
100     - script/autobuild.py $AUTOBUILD_JOB_NAME $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE  --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
101
102 others:
103   extends: .shared_template
104   script:
105     - script/autobuild.py ldb     $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
106     - script/autobuild.py pidl    $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
107     - script/autobuild.py replace $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
108     - script/autobuild.py talloc  $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
109     - script/autobuild.py tdb     $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
110     - script/autobuild.py tevent  $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
111
112 samba:
113   extends: .shared_template
114
115 samba-mitkrb5:
116   extends: .shared_template
117
118 samba-none-env:
119   extends: .shared_template
120
121 samba-nopython:
122   extends: .shared_template
123
124 samba-nopython-py2:
125   extends: .shared_template
126
127 samba-xc:
128   extends: .shared_template
129
130 samba-admem:
131   extends: .shared_template
132
133 samba-ad-dc-2:
134   extends: .shared_template
135
136 samba-ad-dc-3:
137   extends: .shared_template
138
139 samba-ad-dc-4:
140   extends: .shared_template
141
142 samba-ad-dc-5:
143   extends: .shared_template
144
145 samba-ad-dc-6:
146   extends: .shared_template
147
148 samba-libs:
149   extends: .shared_template
150
151 samba-static:
152   extends: .shared_template
153
154 ctdb:
155   extends: .shared_template
156
157 samba-ctdb:
158   extends: .shared_template
159
160 samba-ad-dc-ntvfs:
161   extends: .shared_template
162
163 samba-admem-mit:
164   extends: .shared_template
165
166 samba-ad-dc-4-mitkrb5:
167   extends: .shared_template
168
169 .private_template:
170   extends: .shared_template
171   tags:
172     - docker
173     - samba-ci-private
174   only:
175     variables:
176       # These jobs are only run if the gitlab repo has private runners available.
177       # To enable private jobs, you must add the following var and value to
178       # your gitlab repo by navigating to:
179       # settings -> CI/CD -> Environment variables
180       - $SUPPORT_PRIVATE_TEST == "yes"
181
182 samba-ad-dc-backup:
183   extends: .private_template
184
185 samba-simpleserver:
186   extends: .private_template
187
188 samba-fileserver:
189   extends: .private_template
190
191 samba-ktest-heimdal:
192   extends: .private_template
193
194 samba-ad-dc-1:
195   extends: .private_template
196
197 samba-nt4:
198   extends: .private_template
199
200 samba-schemaupgrade:
201   extends: .private_template
202
203 samba-ad-dc-1-mitkrb5:
204   extends: .private_template
205
206 # 'pages' is a special job which can publish artifacts in `public` dir to gitlab pages
207 pages:
208   image: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-${SAMBA_CI_CONTAINER_IMAGE}:${SAMBA_CI_CONTAINER_TAG}
209   stage: report
210   tags:
211     - docker
212     - shared
213   dependencies:  # tell gitlab to download artifacts for these jobs
214     - samba
215     - samba-ad-dc-1
216     - samba-ad-dc-1-mitkrb5
217     - samba-ad-dc-2
218     - samba-ad-dc-3
219     - samba-ad-dc-4
220     - samba-ad-dc-4-mitkrb5
221     - samba-ad-dc-5
222     - samba-ad-dc-6
223     - samba-ad-dc-backup
224     - samba-ad-dc-ntvfs
225     - samba-admem
226     - samba-admem-mit
227     - samba-ctdb
228     - samba-fileserver
229     - samba-libs
230     - samba-none-env
231     - samba-nopython
232     - samba-nopython-py2
233     - samba-nt4
234     - samba-schemaupgrade
235     - samba-static
236     - samba-xc
237     # - ctdb  # TODO
238     - others
239   script:
240     - ./configure.developer
241     - make -j
242     - lcov $(ls *.info | xargs -I{} echo -n "-a {} ") -o all.info
243     - genhtml all.info --output-directory public --prefix=$(pwd) --title "coverage report for $CI_COMMIT_REF_NAME $CI_COMMIT_SHORT_SHA"
244   artifacts:
245     expire_in: 30 days
246     paths:
247       - public
248   only:
249     variables:
250       - $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE == "--enable-coverage"
251
252 #
253 # We build samba-o3 on all supported distributions
254 #
255
256 .samba-o3-template:
257   extends: .shared_template
258   variables:
259     AUTOBUILD_JOB_NAME: samba-o3
260   only:
261     variables:
262       # do not run o3 for coverage since they are using different images
263       - $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE == ""
264
265 ubuntu1804-samba-o3:
266   extends: .samba-o3-template
267   image: $SAMBA_CI_CONTAINER_IMAGE_ubuntu1804
268
269 ubuntu1604-samba-o3:
270   extends: .samba-o3-template
271   image: $SAMBA_CI_CONTAINER_IMAGE_ubuntu1604
272
273 debian9-samba-o3:
274   extends: .samba-o3-template
275   image: $SAMBA_CI_CONTAINER_IMAGE_debian9
276
277 debian10-samba-o3:
278   extends: .samba-o3-template
279   image: $SAMBA_CI_CONTAINER_IMAGE_debian10
280
281 opensuse150-samba-o3:
282   extends: .samba-o3-template
283   image: $SAMBA_CI_CONTAINER_IMAGE_opensuse150
284
285 opensuse151-samba-o3:
286   extends: .samba-o3-template
287   image: $SAMBA_CI_CONTAINER_IMAGE_opensuse151
288
289 centos7-samba-o3:
290   extends: .samba-o3-template
291   image: $SAMBA_CI_CONTAINER_IMAGE_centos7
292   variables:
293     # Git on CentOS doesn't support shallow git cloning
294     GIT_DEPTH: ""
295     # We need a newer GnuTLS version on CentOS7
296     PKG_CONFIG_PATH: "/usr/lib64/compat-gnutls34/pkgconfig:/usr/lib64/compat-nettle32/pkgconfig"
297
298 centos8-samba-o3:
299   extends: .samba-o3-template
300   image: $SAMBA_CI_CONTAINER_IMAGE_centos8
301
302 fedora29-samba-o3:
303   extends: .samba-o3-template
304   image: $SAMBA_CI_CONTAINER_IMAGE_fedora29
305
306 fedora30-samba-o3:
307   extends: .samba-o3-template
308   image: $SAMBA_CI_CONTAINER_IMAGE_fedora30
309
310 fedora31-samba-o3:
311   extends: .samba-o3-template
312   image: $SAMBA_CI_CONTAINER_IMAGE_fedora31
313
314 #
315 # Keep the samba-o3 sections at the end ...
316 #