python/tests/krb5: modify rfc4120.asn1 in order to generate pyasn1 code
[vlendec/samba-autobuild/.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: 7414ad7ef9108d406b1f6b17ebce19e32aee9f70
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_ubuntu1604: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu1604:${SAMBA_CI_CONTAINER_TAG}
37   SAMBA_CI_CONTAINER_IMAGE_ubuntu1804: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu1804:${SAMBA_CI_CONTAINER_TAG}
38   SAMBA_CI_CONTAINER_IMAGE_ubuntu2004: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu2004:${SAMBA_CI_CONTAINER_TAG}
39   SAMBA_CI_CONTAINER_IMAGE_debian9: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-debian9:${SAMBA_CI_CONTAINER_TAG}
40   SAMBA_CI_CONTAINER_IMAGE_debian10: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-debian10:${SAMBA_CI_CONTAINER_TAG}
41   SAMBA_CI_CONTAINER_IMAGE_opensuse150: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-opensuse150:${SAMBA_CI_CONTAINER_TAG}
42   SAMBA_CI_CONTAINER_IMAGE_opensuse151: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-opensuse151:${SAMBA_CI_CONTAINER_TAG}
43   SAMBA_CI_CONTAINER_IMAGE_fedora31: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-fedora31:${SAMBA_CI_CONTAINER_TAG}
44   SAMBA_CI_CONTAINER_IMAGE_fedora32: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-fedora32:${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 # Ensure when adding a new job below that you also add it to
103 # the dependencies for 'pages' below for the code coverage page
104 # generation.
105
106 others:
107   extends: .shared_template
108   script:
109     - script/autobuild.py ldb      $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
110     - script/autobuild.py pidl     $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
111     - script/autobuild.py replace  $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
112     - script/autobuild.py talloc   $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
113     - script/autobuild.py tdb      $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
114     - script/autobuild.py tevent   $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
115     - script/autobuild.py samba-xc $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
116
117 samba:
118   extends: .shared_template
119
120 samba-mitkrb5:
121   extends: .shared_template
122
123 samba-nopython:
124   extends: .shared_template
125
126 samba-nopython-py2:
127   extends: .shared_template
128
129 samba-admem:
130   extends: .shared_template
131
132 samba-ad-dc-2:
133   extends: .shared_template
134
135 samba-ad-dc-3:
136   extends: .shared_template
137
138 samba-ad-dc-4:
139   extends: .shared_template
140
141 samba-ad-dc-5:
142   extends: .shared_template
143
144 samba-ad-dc-6:
145   extends: .shared_template
146
147 samba-libs:
148   extends: .shared_template
149
150 samba-static:
151   extends: .shared_template
152
153 samba-fuzz:
154   extends: .shared_template
155   image: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu1604:${SAMBA_CI_CONTAINER_TAG}
156
157 ctdb:
158   extends: .shared_template
159
160 samba-ctdb:
161   extends: .shared_template
162
163 samba-ad-dc-ntvfs:
164   extends: .shared_template
165
166 samba-admem-mit:
167   extends: .shared_template
168
169 samba-ad-dc-4-mitkrb5:
170   extends: .shared_template
171
172 .private_template:
173   extends: .shared_template
174   tags:
175     - docker
176     - samba-ci-private
177   only:
178     variables:
179       # These jobs are only run if the gitlab repo has private runners available.
180       # To enable private jobs, you must add the following var and value to
181       # your gitlab repo by navigating to:
182       # settings -> CI/CD -> Environment variables
183       - $SUPPORT_PRIVATE_TEST == "yes"
184
185 samba-ad-dc-backup:
186   extends: .private_template
187
188 samba-fileserver:
189   extends: .private_template
190
191 samba-ad-dc-1:
192   extends: .private_template
193
194 samba-nt4:
195   extends: .private_template
196
197 samba-schemaupgrade:
198   extends: .private_template
199
200 samba-ad-dc-1-mitkrb5:
201   extends: .private_template
202
203 # 'pages' is a special job which can publish artifacts in `public` dir to gitlab pages
204 pages:
205   image: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-${SAMBA_CI_CONTAINER_IMAGE}:${SAMBA_CI_CONTAINER_TAG}
206   stage: report
207   tags:
208     - docker
209     - shared
210   dependencies:  # tell gitlab to download artifacts for these jobs
211     - others
212     - samba
213     - samba-mitkrb5
214     - samba-nopython
215     - samba-nopython-py2
216     - samba-admem
217     - samba-ad-dc-2
218     - samba-ad-dc-3
219     - samba-ad-dc-4
220     - samba-ad-dc-5
221     - samba-ad-dc-6
222     - samba-libs
223     - samba-static
224     - samba-fuzz
225     # - ctdb  # TODO
226     - samba-ctdb
227     - samba-ad-dc-ntvfs
228     - samba-admem-mit
229     - samba-ad-dc-4-mitkrb5
230     - samba-ad-dc-backup
231     - samba-fileserver
232     - samba-ad-dc-1
233     - samba-nt4
234     - samba-schemaupgrade
235     - samba-ad-dc-1-mitkrb5
236   script:
237     - ./configure.developer
238     - make -j
239     - lcov $(ls *.info | xargs -I{} echo -n "-a {} ") -o all.info
240     - genhtml all.info --output-directory public --prefix=$(pwd) --title "coverage report for $CI_COMMIT_REF_NAME $CI_COMMIT_SHORT_SHA"
241   artifacts:
242     expire_in: 30 days
243     paths:
244       - public
245   only:
246     variables:
247       - $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE == "--enable-coverage"
248
249 #
250 # We build samba-o3 on all supported distributions
251 #
252
253 .samba-o3-template:
254   extends: .shared_template
255   variables:
256     AUTOBUILD_JOB_NAME: samba-o3
257   only:
258     variables:
259       # do not run o3 for coverage since they are using different images
260       - $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE == ""
261
262 ubuntu1804-samba-o3:
263   extends: .samba-o3-template
264   image: $SAMBA_CI_CONTAINER_IMAGE_ubuntu1804
265
266 .ubuntu2004-samba-o3:
267   extends: .samba-o3-template
268   image: $SAMBA_CI_CONTAINER_IMAGE_ubuntu2004
269
270 debian10-samba-o3:
271   extends: .samba-o3-template
272   image: $SAMBA_CI_CONTAINER_IMAGE_debian10
273
274 opensuse150-samba-o3:
275   extends: .samba-o3-template
276   image: $SAMBA_CI_CONTAINER_IMAGE_opensuse150
277
278 opensuse151-samba-o3:
279   extends: .samba-o3-template
280   image: $SAMBA_CI_CONTAINER_IMAGE_opensuse151
281
282 centos7-samba-o3:
283   extends: .samba-o3-template
284   image: $SAMBA_CI_CONTAINER_IMAGE_centos7
285   variables:
286     # Git on CentOS doesn't support shallow git cloning
287     GIT_DEPTH: ""
288     # We need a newer GnuTLS version on CentOS7
289     PKG_CONFIG_PATH: "/usr/lib64/compat-gnutls34/pkgconfig:/usr/lib64/compat-nettle32/pkgconfig"
290
291 centos8-samba-o3:
292   extends: .samba-o3-template
293   image: $SAMBA_CI_CONTAINER_IMAGE_centos8
294
295 fedora31-samba-o3:
296   extends: .samba-o3-template
297   image: $SAMBA_CI_CONTAINER_IMAGE_fedora31
298
299 fedora32-samba-o3:
300   extends: .samba-o3-template
301   image: $SAMBA_CI_CONTAINER_IMAGE_fedora32
302
303 #
304 # Keep the samba-o3 sections at the end ...
305 #