1 # see https://docs.gitlab.com/ce/ci/yaml/README.html for all available options
5 # images: Build the images with the bootstrap script
6 # build_first: Build one thing first to find silly errors (fast job)
7 # (don't pay for 35 machines until something compiles)
8 # build: The main parallel job
9 # (keep these to 1hour as we are billed per hour)
10 # report: Code coverage reporting
21 # "--enable-coverage" or ""
22 SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE: ""
24 # we run autobuild.py inside a samba CI docker image located on gitlab's registry
25 # overwrite this variable if you want use your own image registry.
27 # Or better ask for access to the shared development repository, see
28 # https://wiki.samba.org/index.php/Samba_CI_on_gitlab#Getting_Access
30 SAMBA_CI_CONTAINER_REGISTRY: registry.gitlab.com/samba-team/devel/samba
32 # Set this to the contents of bootstrap/sha1sum.txt
33 # which is generated by bootstrap/template.py --render
35 SAMBA_CI_CONTAINER_TAG: c4c00eb35cae36d8d6e752ee01fd943432993721
37 # We use the ubuntu1804 image as default as
38 # it matches what we have on sn-devel-184.
40 SAMBA_CI_CONTAINER_IMAGE: ubuntu1804
42 # The following images are available
43 # Please see the samba-o3 sections at the end of this file!
44 # We should run that for each available image
46 SAMBA_CI_CONTAINER_IMAGE_ubuntu1604: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu1604:${SAMBA_CI_CONTAINER_TAG}
47 SAMBA_CI_CONTAINER_IMAGE_ubuntu1804: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu1804:${SAMBA_CI_CONTAINER_TAG}
48 SAMBA_CI_CONTAINER_IMAGE_ubuntu2004: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu2004:${SAMBA_CI_CONTAINER_TAG}
49 SAMBA_CI_CONTAINER_IMAGE_debian9: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-debian9:${SAMBA_CI_CONTAINER_TAG}
50 SAMBA_CI_CONTAINER_IMAGE_debian10: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-debian10:${SAMBA_CI_CONTAINER_TAG}
51 SAMBA_CI_CONTAINER_IMAGE_opensuse151: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-opensuse151:${SAMBA_CI_CONTAINER_TAG}
52 SAMBA_CI_CONTAINER_IMAGE_opensuse152: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-opensuse152:${SAMBA_CI_CONTAINER_TAG}
53 SAMBA_CI_CONTAINER_IMAGE_fedora32: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-fedora32:${SAMBA_CI_CONTAINER_TAG}
54 SAMBA_CI_CONTAINER_IMAGE_fedora33: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-fedora33:${SAMBA_CI_CONTAINER_TAG}
55 SAMBA_CI_CONTAINER_IMAGE_centos7: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-centos7:${SAMBA_CI_CONTAINER_TAG}
56 SAMBA_CI_CONTAINER_IMAGE_centos8: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-centos8:${SAMBA_CI_CONTAINER_TAG}
59 # The image creation details are specified in a separate file
60 # See bootstrap/README.md for details
61 - 'bootstrap/.gitlab-ci.yml'
64 # All Samba jobs are interruptible, this avoids burning CPU when a
65 # newer branch is pushed.
69 AUTOBUILD_JOB_NAME: $CI_JOB_NAME
70 image: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-${SAMBA_CI_CONTAINER_IMAGE}:${SAMBA_CI_CONTAINER_TAG}
76 key: ccache.${CI_JOB_NAME}
87 # ld will fail if coverage enabled, force link ld to ld.bfd
88 - if [ -n "$SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE" ]; then sudo ln -sf $(which ld.bfd) $(which ld); fi
89 # See bootstrap/.gitlab-ci.yml how to generate a new image
90 - echo "SAMBA_CI_CONTAINER_REGISTRY[${SAMBA_CI_CONTAINER_REGISTRY}]"
91 - echo "SAMBA_CI_CONTAINER_TAG[${SAMBA_CI_CONTAINER_TAG}]"
92 - bootstrap/template.py --sha1sum > /tmp/sha1sum-template.txt
93 - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-template.txt
94 - echo "${SAMBA_CI_CONTAINER_TAG}" > /tmp/sha1sum-tag.txt
95 - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-tag.txt
96 - diff -u bootstrap/sha1sum.txt /sha1sum.txt
97 - export CCACHE_BASEDIR="${PWD}"
98 - export CCACHE_DIR="${PWD}/ccache" && mkdir -pv "$CCACHE_DIR"
99 - export CC="ccache cc"
100 - export CXX="ccache c++"
108 - CCACHE_BASEDIR="${PWD}" CCACHE_DIR="${PWD}/ccache" ccache -s -c
119 - runner_system_failure
120 - stuck_or_timeout_failure
122 # gitlab predefines CI_JOB_NAME for each job. The gitlab job usually matches the
123 # autobuild name, which means we can define a default template that runs most autobuild jobs
124 - script/autobuild.py $AUTOBUILD_JOB_NAME $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase
126 # Ensure when adding a new job below that you also add it to
127 # the dependencies for 'pages' below for the code coverage page
131 extends: .shared_template
133 - script/autobuild.py ldb $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/ldb
134 - script/autobuild.py pidl $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/pidl
135 - script/autobuild.py replace $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/replace
136 - script/autobuild.py talloc $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/talloc
137 - script/autobuild.py tdb $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/tdb
138 - script/autobuild.py tevent $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/tevent
139 - script/autobuild.py samba-xc $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/samba-xc
140 - script/autobuild.py docs-xml $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE --verbose --nocleanup --keeplogs --tail --full-testbase /tmp/samba-testbase/docs-xml
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
167 extends: .shared_template
170 extends: .shared_template
173 extends: .shared_template
174 image: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-ubuntu1604:${SAMBA_CI_CONTAINER_TAG}
177 extends: .shared_template
180 extends: .shared_template
183 extends: .shared_template
186 extends: .shared_template
188 samba-ad-dc-4-mitkrb5:
189 extends: .shared_template
191 # This task is run first to ensure we compile before we start the
192 # main run as it is the fastest full compile of Samba.
195 extends: .shared_template
196 image: $SAMBA_CI_CONTAINER_IMAGE_fedora33
199 extends: .shared_template
205 # These jobs are only run if the gitlab repo has private runners available.
206 # To enable private jobs, you must add the following var and value to
207 # your gitlab repo by navigating to:
208 # settings -> CI/CD -> Environment variables
209 - $SUPPORT_PRIVATE_TEST == "yes"
212 extends: .private_template
215 extends: .private_template
218 extends: .private_template
221 extends: .private_template
224 extends: .private_template
226 samba-ad-dc-1-mitkrb5:
227 extends: .private_template
230 extends: .private_template
232 # 'pages' is a special job which can publish artifacts in `public` dir to gitlab pages
234 image: ${SAMBA_CI_CONTAINER_REGISTRY}/samba-ci-${SAMBA_CI_CONTAINER_IMAGE}:${SAMBA_CI_CONTAINER_TAG}
239 dependencies: # tell gitlab to download artifacts for these jobs
256 - samba-ad-dc-4-mitkrb5
261 - samba-schemaupgrade
262 - samba-ad-dc-1-mitkrb5
265 - ./configure.developer
267 - lcov $(ls *.info | xargs -I{} echo -n "-a {} ") -o all.info
268 - genhtml all.info --output-directory public --prefix=$(pwd) --title "coverage report for $CI_COMMIT_REF_NAME $CI_COMMIT_SHORT_SHA"
275 - $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE == "--enable-coverage"
280 image: $SAMBA_CI_CONTAINER_IMAGE_fedora33
285 - wget https://scan.coverity.com/download/linux64 --post-data "token=$COVERITY_SCAN_TOKEN&project=$COVERITY_SCAN_PROJECT_NAME" -O /tmp/coverity_tool.tgz
286 - tar xf /tmp/coverity_tool.tgz
287 - ./configure.developer --with-system-mitkrb5 --with-experimental-mit-ad-dc
288 - cov-analysis-linux64-*/bin/cov-build --dir cov-int make -j$(nproc)
289 - tar czf cov-int.tar.gz cov-int
291 --form token=$COVERITY_SCAN_TOKEN
292 --form email=$COVERITY_SCAN_EMAIL
293 --form file=@cov-int.tar.gz
294 --form version="`git describe --tags`"
295 --form description="CI build"
296 https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME
302 - $COVERITY_SCAN_TOKEN != null
303 - $COVERITY_SCAN_PROJECT_NAME != null
304 - $COVERITY_SCAN_EMAIL != null
312 # We build samba-o3 on all supported distributions
316 extends: .shared_template
318 AUTOBUILD_JOB_NAME: samba-o3
321 # do not run o3 for coverage since they are using different images
322 - $SAMBA_CI_AUTOBUILD_ENABLE_COVERAGE == ""
325 extends: .samba-o3-template
326 image: $SAMBA_CI_CONTAINER_IMAGE_ubuntu1804
329 extends: .samba-o3-template
330 image: $SAMBA_CI_CONTAINER_IMAGE_ubuntu2004
333 extends: .samba-o3-template
334 image: $SAMBA_CI_CONTAINER_IMAGE_debian10
336 opensuse151-samba-o3:
337 extends: .samba-o3-template
338 image: $SAMBA_CI_CONTAINER_IMAGE_opensuse151
340 opensuse152-samba-o3:
341 extends: .samba-o3-template
342 image: $SAMBA_CI_CONTAINER_IMAGE_opensuse152
345 extends: .samba-o3-template
346 image: $SAMBA_CI_CONTAINER_IMAGE_centos7
348 # Git on CentOS doesn't support shallow git cloning
350 # We need a newer GnuTLS version on CentOS7
351 PKG_CONFIG_PATH: "/usr/lib64/compat-gnutls34/pkgconfig:/usr/lib64/compat-nettle32/pkgconfig"
354 extends: .samba-o3-template
355 image: $SAMBA_CI_CONTAINER_IMAGE_centos8
358 extends: .samba-o3-template
359 image: $SAMBA_CI_CONTAINER_IMAGE_fedora32
362 extends: .samba-o3-template
363 image: $SAMBA_CI_CONTAINER_IMAGE_fedora33
366 # Keep the samba-o3 sections at the end ...