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