1 # see https://docs.gitlab.com/ce/ci/yaml/README.html for all available options
12 # "--enable-coverage" or ""
13 SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE: ""
15 # we run autobuild.py inside a samba CI docker image located on gitlab's registry
16 # overwrite this variable if you want use your own image registry.
18 # Or better ask for access to the shared development repository, see
19 # https://wiki.samba.org/index.php/Samba_CI_on_gitlab#Getting_Access
21 SAMBA_CI_CONTAINER_REGISTRY: registry.gitlab.com/samba-team/devel/samba
23 # Set this to the contents of bootstrap/sha1sum.txt
24 # which is generated by bootstrap/template.py --render
26 SAMBA_CI_CONTAINER_TAG: 86279163d150fb95742f4b34fce0dfc1a639f5de
28 # We use the ubuntu1804 image as default as
29 # it matches what we have on sn-devel-184.
31 SAMBA_CI_CONTAINER_IMAGE: ubuntu1804
33 # The following images are available
34 # Please see the samba-o3 sections at the end of this file!
35 # We should run that for each available image
37 SAMBA_CI_CONTAINER_IMAGE_ubuntu1604: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu1604:${SAMBA_CI_CONTAINER_TAG}
38 SAMBA_CI_CONTAINER_IMAGE_ubuntu1804: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu1804:${SAMBA_CI_CONTAINER_TAG}
39 SAMBA_CI_CONTAINER_IMAGE_ubuntu2004: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu2004:${SAMBA_CI_CONTAINER_TAG}
40 SAMBA_CI_CONTAINER_IMAGE_debian9: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-debian9:${SAMBA_CI_CONTAINER_TAG}
41 SAMBA_CI_CONTAINER_IMAGE_debian10: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-debian10:${SAMBA_CI_CONTAINER_TAG}
42 SAMBA_CI_CONTAINER_IMAGE_opensuse150: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-opensuse150:${SAMBA_CI_CONTAINER_TAG}
43 SAMBA_CI_CONTAINER_IMAGE_opensuse151: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-opensuse151:${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_fedora32: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-fedora32:${SAMBA_CI_CONTAINER_TAG}
46 SAMBA_CI_CONTAINER_IMAGE_centos7: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-centos7:${SAMBA_CI_CONTAINER_TAG}
47 SAMBA_CI_CONTAINER_IMAGE_centos8: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-centos8:${SAMBA_CI_CONTAINER_TAG}
50 # The image creation details are specified in a separate file
51 # See bootstrap/README.md for details
52 - 'bootstrap/.gitlab-ci.yml'
55 # All Samba jobs are interruptible, this avoids burning CPU when a
56 # newer branch is pushed.
60 AUTOBUILD_JOB_NAME: $CI_JOB_NAME
61 image: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-${SAMBA_CI_CONTAINER_IMAGE}:${SAMBA_CI_CONTAINER_TAG}
67 key: ccache.${CI_JOB_NAME}
78 # ld will fail if coverage enabled, force link ld to ld.bfd
79 - if [ -n "$SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE" ]; then sudo ln -sf $(which ld.bfd) $(which ld); fi
80 # See bootstrap/.gitlab-ci.yml how to generate a new image
81 - echo "SAMBA_CI_CONTAINER_REGISTRY[${SAMBA_CI_CONTAINER_REGISTRY}]"
82 - echo "SAMBA_CI_CONTAINER_TAG[${SAMBA_CI_CONTAINER_TAG}]"
83 - bootstrap/template.py --sha1sum > /tmp/sha1sum-template.txt
84 - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-template.txt
85 - echo "${SAMBA_CI_CONTAINER_TAG}" > /tmp/sha1sum-tag.txt
86 - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-tag.txt
87 - diff -u bootstrap/sha1sum.txt /sha1sum.txt
88 - export CCACHE_BASEDIR="${PWD}"
89 - export CCACHE_DIR="${PWD}/ccache" && mkdir -pv "$CCACHE_DIR"
90 - export CC="ccache cc"
91 - export CXX="ccache c++"
99 - CCACHE_BASEDIR="${PWD}" CCACHE_DIR="${PWD}/ccache" ccache -s -c
110 - runner_system_failure
111 - stuck_or_timeout_failure
113 # gitlab predefines CI_JOB_NAME for each job. The gitlab job usually matches the
114 # autobuild name, which means we can define a default template that runs most autobuild jobs
115 - script/autobuild.py $AUTOBUILD_JOB_NAME $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase
117 # Ensure when adding a new job below that you also add it to
118 # the dependencies for 'pages' below for the code coverage page
122 extends: .shared_template
124 - script/autobuild.py ldb $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/ldb
125 - script/autobuild.py pidl $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/pidl
126 - script/autobuild.py replace $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/replace
127 - script/autobuild.py talloc $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/talloc
128 - script/autobuild.py tdb $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/tdb
129 - script/autobuild.py tevent $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/tevent
130 - script/autobuild.py samba-xc $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/samba-xc
131 - script/autobuild.py docs-xml $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/docs-xml
134 extends: .shared_template
137 extends: .shared_template
140 extends: .shared_template
143 extends: .shared_template
146 extends: .shared_template
149 extends: .shared_template
152 extends: .shared_template
155 extends: .shared_template
158 extends: .shared_template
161 extends: .shared_template
164 extends: .shared_template
165 image: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu1604:${SAMBA_CI_CONTAINER_TAG}
168 extends: .shared_template
171 extends: .shared_template
174 extends: .shared_template
177 extends: .shared_template
179 samba-ad-dc-4-mitkrb5:
180 extends: .shared_template
183 extends: .shared_template
184 image: $SAMBA_CI_CONTAINER_IMAGE_fedora32
187 extends: .shared_template
193 # These jobs are only run if the gitlab repo has private runners available.
194 # To enable private jobs, you must add the following var and value to
195 # your gitlab repo by navigating to:
196 # settings -> CI/CD -> Environment variables
197 - $SUPPORT_PRIVATE_TEST == "yes"
200 extends: .private_template
203 extends: .private_template
206 extends: .private_template
209 extends: .private_template
212 extends: .private_template
214 samba-ad-dc-1-mitkrb5:
215 extends: .private_template
217 # 'pages' is a special job which can publish artifacts in `public` dir to gitlab pages
219 image: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-${SAMBA_CI_CONTAINER_IMAGE}:${SAMBA_CI_CONTAINER_TAG}
224 dependencies: # tell gitlab to download artifacts for these jobs
241 - samba-ad-dc-4-mitkrb5
246 - samba-schemaupgrade
247 - samba-ad-dc-1-mitkrb5
250 - ./configure.developer
252 - lcov $(ls *.info | xargs -I{} echo -n "-a {} ") -o all.info
253 - genhtml all.info --output-directory public --prefix=$(pwd) --title "coverage report for $CI_COMMIT_REF_NAME $CI_COMMIT_SHORT_SHA"
260 - $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE == "--enable-coverage"
265 image: $SAMBA_CI_CONTAINER_IMAGE_fedora32
270 - wget https://scan.coverity.com/download/linux64 --post-data "token=$COVERITY_SCAN_TOKEN&project=$COVERITY_SCAN_PROJECT_NAME" -O /tmp/coverity_tool.tgz
271 - tar xf /tmp/coverity_tool.tgz
272 - ./configure.developer --with-system-mitkrb5 --with-experimental-mit-ad-dc
273 - cov-analysis-linux64-*/bin/cov-build --dir cov-int make -j$(nproc)
274 - tar czf cov-int.tar.gz cov-int
276 --form token=$COVERITY_SCAN_TOKEN
277 --form email=$COVERITY_SCAN_EMAIL
278 --form file=@cov-int.tar.gz
279 --form version="`git describe --tags`"
280 --form description="CI build"
281 https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME
287 - $COVERITY_SCAN_TOKEN != null
288 - $COVERITY_SCAN_PROJECT_NAME != null
289 - $COVERITY_SCAN_EMAIL != null
297 # We build samba-o3 on all supported distributions
301 extends: .shared_template
303 AUTOBUILD_JOB_NAME: samba-o3
306 # do not run o3 for coverage since they are using different images
307 - $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE == ""
310 extends: .samba-o3-template
311 image: $SAMBA_CI_CONTAINER_IMAGE_ubuntu1804
314 extends: .samba-o3-template
315 image: $SAMBA_CI_CONTAINER_IMAGE_ubuntu2004
318 extends: .samba-o3-template
319 image: $SAMBA_CI_CONTAINER_IMAGE_debian10
321 opensuse150-samba-o3:
322 extends: .samba-o3-template
323 image: $SAMBA_CI_CONTAINER_IMAGE_opensuse150
325 opensuse151-samba-o3:
326 extends: .samba-o3-template
327 image: $SAMBA_CI_CONTAINER_IMAGE_opensuse151
330 extends: .samba-o3-template
331 image: $SAMBA_CI_CONTAINER_IMAGE_centos7
333 # Git on CentOS doesn't support shallow git cloning
335 # We need a newer GnuTLS version on CentOS7
336 PKG_CONFIG_PATH: "/usr/lib64/compat-gnutls34/pkgconfig:/usr/lib64/compat-nettle32/pkgconfig"
339 extends: .samba-o3-template
340 image: $SAMBA_CI_CONTAINER_IMAGE_centos8
343 extends: .samba-o3-template
344 image: $SAMBA_CI_CONTAINER_IMAGE_fedora31
347 extends: .samba-o3-template
348 image: $SAMBA_CI_CONTAINER_IMAGE_fedora32
351 # Keep the samba-o3 sections at the end ...