s4/scripting/autoidl: another py3 incompatible except
[samba.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: 563ddb220bfed37501be93b0b3204bb1ceb61b94
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_opensuse150: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-opensuse150:${SAMBA_CI_CONTAINER_TAG}
40   SAMBA_CI_CONTAINER_IMAGE_fedora29: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-fedora29:${SAMBA_CI_CONTAINER_TAG}
41   SAMBA_CI_CONTAINER_IMAGE_fedora30: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-fedora30:${SAMBA_CI_CONTAINER_TAG}
42   SAMBA_CI_CONTAINER_IMAGE_centos7: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-centos7:${SAMBA_CI_CONTAINER_TAG}
43
44 include:
45   # The image creation details are specified in a separate file
46   # See bootstrap/README.md for details
47   - 'bootstrap/.gitlab-ci.yml'
48
49 .shared_template:
50   variables:
51     AUTOBUILD_JOB_NAME: $CI_JOB_NAME
52   image: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-${SAMBA_CI_CONTAINER_IMAGE}:${SAMBA_CI_CONTAINER_TAG}
53   stage: build
54   tags:
55     - docker
56     - shared
57   before_script:
58     - uname -a
59     - lsb_release -a
60     - cat /etc/os-release
61     - mount
62     - df -h
63     - cat /proc/swaps
64     - free -h
65       # ld will fail if coverage enabled, force link ld to ld.bfd
66     - if [ -n "$SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE" ]; then sudo ln -sf $(which ld.bfd) $(which ld); fi
67       # See bootstrap/.gitlab-ci.yml how to generate a new image
68     - echo "SAMBA_CI_CONTAINER_REGISTRY[${SAMBA_CI_CONTAINER_REGISTRY}]"
69     - echo "SAMBA_CI_CONTAINER_TAG[${SAMBA_CI_CONTAINER_TAG}]"
70     - bootstrap/template.py --sha1sum > /tmp/sha1sum-template.txt
71     - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-template.txt
72     - echo "${SAMBA_CI_CONTAINER_TAG}" > /tmp/sha1sum-tag.txt
73     - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-tag.txt
74     - diff -u bootstrap/sha1sum.txt /sha1sum.txt
75   after_script:
76     - mount
77     - df -h
78     - cat /proc/swaps
79     - free -h
80   artifacts:
81     expire_in: 1 week
82     paths:
83       - "*.stdout"
84       - "*.stderr"
85       - "*.info"
86       - system-info.txt
87   retry:
88     max: 2
89     when:
90       - runner_system_failure
91       - stuck_or_timeout_failure
92   script:
93     # gitlab predefines CI_JOB_NAME for each job. The gitlab job usually matches the
94     # autobuild name, which means we can define a default template that runs most autobuild jobs
95     - echo "Running cmd script/autobuild.py $AUTOBUILD_JOB_NAME $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase"
96     - script/autobuild.py $AUTOBUILD_JOB_NAME $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE  --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
97
98 others:
99   extends: .shared_template
100   script:
101     - script/autobuild.py ldb     $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
102     - script/autobuild.py pidl    $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
103     - script/autobuild.py replace $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
104     - script/autobuild.py talloc  $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
105     - script/autobuild.py tdb     $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
106     - script/autobuild.py tevent  $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
107
108 samba:
109   extends: .shared_template
110
111 samba-none-env:
112   extends: .shared_template
113
114 samba-nopython:
115   extends: .shared_template
116
117 samba-nopython-py2:
118   extends: .shared_template
119
120 samba-systemkrb5:
121   extends: .shared_template
122
123 samba-xc:
124   extends: .shared_template
125
126 samba-ad-member:
127   extends: .shared_template
128
129 samba-ad-dc-2:
130   extends: .shared_template
131
132 samba-ad-dc-3:
133   extends: .shared_template
134
135 samba-ad-dc-4:
136   extends: .shared_template
137
138 samba-ad-dc-5:
139   extends: .shared_template
140
141 samba-ad-dc-6:
142   extends: .shared_template
143
144 samba-libs:
145   extends: .shared_template
146
147 samba-static:
148   extends: .shared_template
149
150 ctdb:
151   extends: .shared_template
152
153 samba-ctdb:
154   extends: .shared_template
155
156 samba-ad-dc-ntvfs:
157   extends: .shared_template
158
159 .private_template:
160   extends: .shared_template
161   tags:
162     - docker
163     - samba-ci-private
164   only:
165     variables:
166       # These jobs are only run if the gitlab repo has private runners available.
167       # To enable private jobs, you must add the following var and value to
168       # your gitlab repo by navigating to:
169       # settings -> CI/CD -> Environment variables
170       - $SUPPORT_PRIVATE_TEST == "yes"
171
172 samba-ad-dc-backup:
173   extends: .private_template
174
175 samba-fileserver:
176   extends: .private_template
177
178 samba-ad-dc-1:
179   extends: .private_template
180
181 samba-nt4:
182   extends: .private_template
183
184 samba-schemaupgrade:
185   extends: .private_template
186
187 # 'pages' is a special job which can publish artifacts in `public` dir to gitlab pages
188 pages:
189   image: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-${SAMBA_CI_CONTAINER_IMAGE}:${SAMBA_CI_CONTAINER_TAG}
190   stage: report
191   tags:
192     - docker
193     - shared
194   dependencies:  # tell gitlab to download artifacts for these jobs
195     - samba
196     - samba-ad-dc-1
197     - samba-ad-dc-2
198     - samba-ad-dc-3
199     - samba-ad-dc-4
200     - samba-ad-dc-5
201     - samba-ad-dc-6
202     - samba-ad-dc-backup
203     - samba-ad-dc-ntvfs
204     - samba-ad-member
205     - samba-ctdb
206     - samba-fileserver
207     - samba-libs
208     - samba-none-env
209     - samba-nopython
210     - samba-nopython-py2
211     - samba-nt4
212     - samba-schemaupgrade
213     - samba-static
214     - samba-systemkrb5
215     - samba-xc
216     # - ctdb  # TODO
217     - others
218   script:
219     - ./configure.developer
220     - make -j
221     - lcov $(ls *.info | xargs -I{} echo -n "-a {} ") -o all.info
222     - genhtml all.info --output-directory public --prefix=$(pwd) --title "coverage report for $CI_COMMIT_REF_NAME $CI_COMMIT_SHORT_SHA"
223   artifacts:
224     expire_in: 30 days
225     paths:
226       - public
227   only:
228     variables:
229       - $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE == "--enable-coverage"
230
231 #
232 # We build samba-o3 on all supported distributions
233 #
234
235 .samba-o3-template:
236   extends: .shared_template
237   variables:
238     AUTOBUILD_JOB_NAME: samba-o3
239   only:
240     variables:
241       # do not run o3 for coverage since they are using different images
242       - $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE == ""
243
244 ubuntu1804-samba-o3:
245   extends: .samba-o3-template
246   image: $SAMBA_CI_CONTAINER_IMAGE_ubuntu1804
247
248 ubuntu1604-samba-o3:
249   extends: .samba-o3-template
250   image: $SAMBA_CI_CONTAINER_IMAGE_ubuntu1604
251
252 debian9-samba-o3:
253   extends: .samba-o3-template
254   image: $SAMBA_CI_CONTAINER_IMAGE_debian9
255
256 opensuse150-samba-o3:
257   extends: .samba-o3-template
258   image: $SAMBA_CI_CONTAINER_IMAGE_opensuse150
259
260 centos7-samba-o3:
261   extends: .samba-o3-template
262   image: $SAMBA_CI_CONTAINER_IMAGE_centos7
263   variables:
264     # Git on CentOS doesn't support shallow git cloning
265     GIT_DEPTH: ""
266
267 fedora29-samba-o3:
268   extends: .samba-o3-template
269   image: $SAMBA_CI_CONTAINER_IMAGE_fedora29
270
271 fedora30-samba-o3:
272   extends: .samba-o3-template
273   image: $SAMBA_CI_CONTAINER_IMAGE_fedora30
274
275 #
276 # Keep the samba-o3 sections at the end ...
277 #