libcli: Speed up sddl_decode_ace()
[samba4-gss.git] / bootstrap / .gitlab-ci.yml
blob0b37863d35ad721862450191fb7706e532cc7ef6
1 ---
2 .build_image_template:
3   image: quay.io/podman/stable:latest
4   stage: images
5   tags:
6     # We need to make sure we only use gitlab.com
7     # runners and not our own runners, as our current runners
8     # don't allow 'docker build ...' to run.
9     - saas-linux-small-amd64
10   variables:
11     SAMBA_CI_IS_BROKEN_IMAGE: "no"
12     SAMBA_CI_TEST_JOB: "samba-o3"
13     SAMBA_CI_PLATFORM: "linux/amd64"
14   before_script:
15     # install prerequisites
16     - dnf install -qy diffutils
17     # Ensure we are generating correct the container
18     - uname -a
19     - cat /etc/os-release
20     - echo "SAMBA_CI_CONTAINER_REGISTRY[${SAMBA_CI_CONTAINER_REGISTRY}]"
21     - echo "SAMBA_CI_CONTAINER_TAG[${SAMBA_CI_CONTAINER_TAG}]"
22     - echo "SAMBA_CI_IS_BROKEN_IMAGE[${SAMBA_CI_IS_BROKEN_IMAGE}]"
23     - echo "SAMBA_CI_REBUILD_IMAGES[${SAMBA_CI_REBUILD_IMAGES}]"
24     - echo "SAMBA_CI_REBUILD_BROKEN_IMAGES[${SAMBA_CI_REBUILD_BROKEN_IMAGES}]"
25     - echo "GITLAB_USER_LOGIN[${GITLAB_USER_LOGIN}]"
26     - echo "${SAMBA_CI_CONTAINER_TAG}" > /tmp/sha1sum-tag.txt
27     - diff -u bootstrap/sha1sum.txt /tmp/sha1sum-tag.txt
28   script: |
29     set -xueo pipefail
30     ci_image_name=samba-ci-${CI_JOB_NAME}
31     podman build --platform ${SAMBA_CI_PLATFORM} --tag ${ci_image_name} --build-arg SHA1SUM=${SAMBA_CI_CONTAINER_TAG} bootstrap/generated-dists/${CI_JOB_NAME}
32     ci_image_path="${SAMBA_CI_CONTAINER_REGISTRY}/${ci_image_name}"
33     timestamp=$(date +%Y%m%d%H%M%S)
34     container_hash=$(podman image inspect --format='{{ .Id }}' ${ci_image_name} | cut -c 1-9)
35     timestamp_tag=${SAMBA_CI_CONTAINER_TAG}-${timestamp}-${GITLAB_USER_LOGIN}-${container_hash}
36     samba_repo_root=/home/samba/samba
37     # Ensure we are generating the correct container that we expect to be in
38     echo "${SAMBA_CI_CONTAINER_TAG}" > /tmp/sha1sum-tag.txt
39     diff -u bootstrap/sha1sum.txt /tmp/sha1sum-tag.txt
40     podman run --volume $(pwd):${samba_repo_root} --workdir ${samba_repo_root} ${ci_image_name} \
41         /bin/bash -c "echo \"${SAMBA_CI_CONTAINER_TAG}\" > /tmp/sha1sum-tag.txt; diff -u bootstrap/sha1sum.txt /tmp/sha1sum-tag.txt"
42     podman run --volume $(pwd):${samba_repo_root} --workdir ${samba_repo_root} ${ci_image_name} \
43         diff -u bootstrap/sha1sum.txt /sha1sum.txt
44     podman run --volume $(pwd):${samba_repo_root} --workdir ${samba_repo_root} ${ci_image_name} \
45         bootstrap/template.py --sha1sum > /tmp/sha1sum-template.txt
46     diff -u bootstrap/sha1sum.txt /tmp/sha1sum-template.txt
47     # run smoke test with samba-o3 or samba-fuzz
48     podman run --volume $(pwd):/src:ro ${ci_image_name} \
49         /bin/bash -c "git config --global --add safe.directory /src/.git && git clone /src samba && cd samba && export PKG_CONFIG_PATH=/usr/lib64/compat-gnutls34/pkgconfig:/usr/lib64/compat-nettle32/pkgconfig && script/autobuild.py ${SAMBA_CI_TEST_JOB} --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase"
50     podman tag ${ci_image_name} ${ci_image_path}:${SAMBA_CI_CONTAINER_TAG}
51     podman tag ${ci_image_name} ${ci_image_path}:${timestamp_tag}
52     # We build all images, but only upload is it's not marked as broken
53     test x"${SAMBA_CI_IS_BROKEN_IMAGE}" = x"yes" || { \
54         podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY; \
55         podman push ${ci_image_path}:${SAMBA_CI_CONTAINER_TAG}; \
56         podman push ${ci_image_path}:${timestamp_tag}; \
57     }
58     echo "Success for ${ci_image_path}:${timestamp_tag}"
59     test x"${SAMBA_CI_IS_BROKEN_IMAGE}" = x"no" || { \
60          echo "The image ${CI_JOB_NAME} is marked as broken and should have failed!"; \
61          echo "Replace .build_image_template_force_broken with .build_image_template!"; \
62          echo "Add a .samba-o3-template section at the end of the main .gitlab-ci.yml!"; \
63          /bin/false; \
64     }
65   only:
66     variables:
67       #
68       # You need a custom pipeline which passes
69       # SAMBA_CI_REBUILD_IMAGES="yes".
70       #
71       # https://gitlab.com/samba-team/devel/samba/pipelines/new
72       #
73       - $SAMBA_CI_REBUILD_IMAGES == "yes"
75 .build_image_template_force_broken:
76   extends: .build_image_template
77   variables:
78     SAMBA_CI_IS_BROKEN_IMAGE: "yes"
79   only:
80     variables:
81       #
82       # You need a custom pipeline which passes
83       # SAMBA_CI_REBUILD_BROKEN_IMAGES="yes"
84       # in order to build broken images for debugging
85       #
86       # https://gitlab.com/samba-team/devel/samba/pipelines/new
87       #
88       - $SAMBA_CI_REBUILD_BROKEN_IMAGES == "yes"
90 ubuntu2004:
91   extends: .build_image_template
93 ubuntu2204:
94   extends: .build_image_template
96 debian11:
97   extends: .build_image_template
99 debian12:
100   extends: .build_image_template
102 fedora41:
103   extends: .build_image_template
105 debian11-32bit:
106   extends: .build_image_template
107   variables:
108     SAMBA_CI_TEST_JOB: "samba-32bit"
109     SAMBA_CI_PLATFORM: "linux/i386"
111 rocky8:
112   extends: .build_image_template
114 centos9s:
115   extends: .build_image_template
117 opensuse155:
118   extends: .build_image_template