mi: unexport SetInstalledmiColormap() macro
[xserver.git] / .gitlab-ci.yml
blobab17016d616676c6deb2ae4ccd60dafc1c946182
1 # vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml:
3 # This CI uses the freedesktop.org ci-templates.
4 # Please see the ci-templates documentation for details:
5 # https://freedesktop.pages.freedesktop.org/ci-templates/
7 .templates_sha: &template_sha c5626190ec14b475271288dda7a7dae8dbe0cd76 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
9 # FDO_DISTRIBUTION_TAG is the tag of the docker image used for the build jobs.
10 # If the image doesn't exist yet, the docker-image stage generates it.
12 # In order to generate a new image, one should generally change the tag.
13 # While removing the image from the registry would also work, that's not
14 # recommended except for ephemeral images during development: Replacing an
15 # image after a significant amount of time might pull in newer versions of
16 # gcc/clang or other packages, which might break the build with older commits
17 # using the same tag.
18 variables:
19     FDO_UPSTREAM_REPO:    'xorg/xserver'
20     MESON_BUILDDIR:       'build'
21     REPO_URL_XORGPROTO:   'https://gitlab.freedesktop.org/xorg/proto/xorgproto.git'
22     XORG_DEBIAN_VERSION:  'bullseye-slim'
23     XORG_DEBIAN_EXEC:     'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/debian-install.sh'
24     XORG_DEBIAN_TAG:      '2024-11-14-wayland-protocols-1-38'
25     XORG_FREEBSD_VERSION: '14.0'
26     XORG_FREEBSD_EXEC:    ''
27     XORG_FREEBSD_TAG:     '2024-06-10.0'
29 include:
30   - project: 'freedesktop/ci-templates'
31     ref: *template_sha
32     file:
33       - '/templates/debian.yml'
34       - '/templates/freebsd.yml'
35       - '/templates/ci-fairy.yml'
36   - template: Security/SAST.gitlab-ci.yml
38 stages:
39     - docker-image
40     - build-and-test
41     - drivers
42     - test
44 .ci-run-policy:
45   # Retry jobs after runner system failures
46   retry:
47     max: 2
48     when:
49       - runner_system_failure
50   # Cancel CI run if a newer commit is pushed to the same branch
51   interruptible: true
53 # This is everything but the DDXen
54 .dix_paths: &dix_paths
55   # Directories
56   - .gitlab-ci/**/*
57   - composite/**/*
58   - config/**/*
59   - damageext/**/*
60   - dbe/**/*
61   - dix/**/*
62   - doc/**/*
63   - dri3/**/*
64   - exa/**/*
65   - fb/**/*
66   - glamor/**/*
67   - glx/**/*
68   - include/**/*
69   - m4/**/*
70   - man/**/*
71   - mi/**/*
72   - miext/**/*
73   - os/**/*
74   - present/**/*
75   - pseudoramiX/**/*
76   - randr/**/*
77   - record/**/*
78   - render/**/*
79   - test/**/*
80   - Xext/**/*
81   - xfixes/**/*
82   - Xi/**/*
83   - xkb/**/*
84   # Files
85   - hw/meson.build
86   - .gitlab-ci.yml
87   - meson*
88   - xorg-server.m4
89   - xorg-server.pc.in
90   - xserver.ent.in
92 .xorg_paths: &xorg_paths
93   - hw/xfree86/**/*
95 .xwayland_paths: &xwayland_paths
96   - hw/xwayland/**/*
98 .all_ddx_paths:
99   - hw/**/*
101 .debian:
102   variables:
103     FDO_DISTRIBUTION_VERSION:   '$XORG_DEBIAN_VERSION'
104     FDO_DISTRIBUTION_EXEC:      '$XORG_DEBIAN_EXEC'
105     FDO_DISTRIBUTION_TAG:       '$XORG_DEBIAN_TAG'
107 .freebsd:
108   variables:
109     FDO_DISTRIBUTION_TAG:       '$XORG_FREEBSD_TAG'
110     FDO_DISTRIBUTION_VERSION:   '$XORG_FREEBSD_VERSION'
111     FDO_DISTRIBUTION_EXEC:      ''
112     FDO_DISTRIBUTION_PACKAGES:  'git gcc pkgconf autoconf automake libtool xorg-macros xorgproto bash meson ninja pixman xtrans libXau libXdmcp libXfont2 libxkbfile libxcvt libpciaccess font-util libepoll-shim'
114 debian-bullseye:
115   extends:
116     - .fdo.container-build@debian
117     - .ci-run-policy
118     - .debian
119   stage: docker-image
120   variables:
121     GIT_STRATEGY: none
123 freebsd-image:
124   extends:
125     - .fdo.qemu-build@freebsd@x86_64
126     - .freebsd
127   stage: docker-image
128   variables:
129     GIT_STRATEGY:               none
131 .xorg-image@debian:
132     extends:
133         - .fdo.distribution-image@debian
134         - .debian
136 .xorg-image@freebsd:
137     extends:
138         - .fdo.distribution-image@freebsd
139         - .freebsd
140     variables:
141         GIT_DEPTH:                1
142         PKG_CONFIG_PATH:          /usr/share/pkgconfig:/usr/lib/pkgconfig:/usr/pkg/share/pkgconfig:/usr/pkg/lib/pkgconfig:/usr/local/libdata/pkgconfig
144 .common-build-and-test:
145     extends:
146         - .xorg-image@debian
147         - .ci-run-policy
148     stage: build-and-test
149     artifacts:
150         when: always
151         paths:
152             - $MESON_BUILDDIR/meson-logs/
153             - $MESON_BUILDDIR/test/piglit-results/
154     variables:
155         MESON_ARGS: -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=true -Dwerror=true -Dxcsecurity=true
156         CCACHE_COMPILERCHECK: content
157         CCACHE_DIR: /cache/xserver/cache
158         LC_ALL: C.UTF-8
159     before_script:
160         - export CCACHE_BASEDIR="$PWD"
161         - export PATH="/usr/lib/ccache:$PATH"
162         - ccache --show-stats
163     after_script:
164         - ccache --show-stats
166 meson:
167     extends: .common-build-and-test
168     script:
169         - .gitlab-ci/meson-build.sh --run-test
170         - .gitlab-ci/check-piglit-results.sh
171         - .gitlab-ci/manpages-check
172         - .gitlab-ci/check-ddx-build.sh
173     variables:
174       XTEST_DIR: /root/xts
175       PIGLIT_DIR: /root/piglit
176       LP_NUM_THREADS: 0
177       MESON_DDX_BUILD_ARGS: >
178         -Dxwayland=${BUILD_XWAYLAND} -Dxorg=${BUILD_XORG} -Dxephyr=${BUILD_XEPHYR} -Dxvfb=${BUILD_XVFB} -Dxnest=${BUILD_XNEST}
179       BUILD_XEPHYR: true
180       BUILD_XNEST: true
181       BUILD_XORG: true
182       BUILD_XVFB: true
183       BUILD_XWAYLAND: true
184       MESON_EXTRA_ARGS: ${MESON_DDX_BUILD_ARGS}
186 meson-noglamor:
187     extends: meson
188     variables:
189         MESON_EXTRA_ARGS: -Dglamor=false ${MESON_DDX_BUILD_ARGS}
191 xwayland-nolibdecor:
192     extends: meson
193     variables:
194         BUILD_XEPHYR: false
195         BUILD_XNEST: false
196         BUILD_XORG: false
197         BUILD_XVFB: false
198         MESON_EXTRA_ARGS: -Dlibdecor=false ${MESON_DDX_BUILD_ARGS}
200 mingw-cross-build:
201     extends: .common-build-and-test
202     script:
203         - .gitlab-ci/meson-build.sh --run-install
204     variables:
205       MESON_ARGS: --cross-file=.gitlab-ci/cross-i686-w64-mingw32.txt -Dglx=false -Dlisten_tcp=true
207 freebsd:
208     stage: build-and-test
209     extends:
210         - .xorg-image@freebsd
211     variables:
212         MESON_ARGS: -Dglx=false -Dglamor=false -Dudev=false -Dudev_kms=false
213     script:
214       # running of of disk space without this
215       # needed until https://gitlab.freedesktop.org/freedesktop/ci-templates/-/issues/67 is fixed
216       - git gc
217       - git clone --depth=1 $REPO_URL_XORGPROTO dep.xorgproto
218       - /app/vmctl start
219       - set +e
220       - scp -r $PWD "vm:"
221       # need to install newer xorgproto
222       - /app/vmctl exec "cd $CI_PROJECT_NAME/dep.xorgproto && ./autogen.sh --prefix=/usr && make && make install"
223       - /app/vmctl exec "cd $CI_PROJECT_NAME && PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\" MESON_ARGS=\"$MESON_ARGS\" MESON_BUILDDIR=\"$MESON_BUILDDIR\" .gitlab-ci/meson-build.sh --skip-test" && touch .success
224       # test not working yet, so skipped
225       # - scp -r vm:$CI_PROJECT_NAME/test-results.xml .
226       - /app/vmctl stop
227       - set -e
228       - test -e .success || exit 1
230 meson-dist:
231     extends: .common-build-and-test
232     artifacts:
233         when: always
234         paths:
235             - $MESON_BUILDDIR/meson-logs/
236             - $MESON_BUILDDIR/xserver-*/$MESON_BUILDDIR/meson-logs/
237     script:
238         - .gitlab-ci/meson-build.sh --run-dist
239         - mkdir xserver-tarball
240         - tar xf $MESON_BUILDDIR/meson-dist/xserver-*.tar.xz -C xserver-tarball --strip-components=1
241         - .gitlab-ci/meson-build.sh -C xserver-tarball --skip-test --skip-dist --run-install
242     variables:
243       MESON_DIST_ARGS: --no-tests
244       DESTDIR: xserver-tarball/install/
246 xf86-driver-build-test:
247     extends:
248         - .xorg-image@debian
249         - .ci-run-policy
250     stage: drivers
251     parallel:
252         matrix:
253             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-evdev
254               SHA: xf86-input-evdev-2.10.6
255             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput
256               SHA: xf86-input-libinput-1.4.0
257             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-mouse
258               SHA: xf86-input-mouse-1.9.5
259             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-synaptics
260               SHA: xf86-input-synaptics-1.9.2
261             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu
262               SHA: xf86-video-amdgpu-23.0.0
263             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ati
264               SHA: xf86-video-ati-22.0.0
265             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-qxl
266               SHA: master
267             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vesa
268               SHA: xf86-video-vesa-2.6.0
269             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vmware
270               SHA: xf86-video-vmware-13.4.0
271     script:
272         # Install the server first
273         - .gitlab-ci/meson-build.sh --skip-test --run-install
274         - unset MESON_EXTRA_ARGS
275         - DRIVER=$(basename $REPO)
276         - git clone "$REPO" "$DRIVER"
277         - git -C "$DRIVER" checkout "$SHA"
278         - |
279           if [[ -e "$DRIVER/meson.build" ]]; then
280             .gitlab-ci/meson-build.sh -C "$DRIVER" --skip-test
281           else
282              pushd "$DRIVER" || exit 1
283              ./autogen.sh && make
284           fi
285     needs:
286         - "meson"
287     variables:
288         GIT_DEPTH: 1
289         MESON_ARGS: -Dprefix=/usr/
290         MESON_EXTRA_ARGS: -Dxwayland=false -Dxnest=false -Dxvfb=false -Dxquartz=false -Ddocs=false
291     rules:
292       - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
293         changes:
294           *dix_paths
295       - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
296         changes:
297           *xorg_paths
300 # Verify that commit messages are as expected
302 check-commits:
303   extends:
304     - .fdo.ci-fairy
305   needs: []
306   stage: test
307   script:
308     - ci-fairy check-commits --junit-xml=results.xml
309   except:
310     - master@xorg/xserver
311   variables:
312     GIT_DEPTH: 100
313   artifacts:
314     reports:
315       junit: results.xml
316   allow_failure: true
319 # Verify that the merge request has the allow-collaboration checkbox ticked
321 check-merge-request:
322   extends:
323     - .fdo.ci-fairy
324   needs: []
325   stage: test
326   rules:
327     - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
328   script:
329     - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
330   artifacts:
331     when: on_failure
332     reports:
333       junit: results.xml
334   allow_failure: true
337 # Workflow rules needed due to:
338 # https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/438
340 workflow:
341   rules:
342     - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
343     - if: $CI_OPEN_MERGE_REQUESTS
344       when: never
345     - if: $CI_PIPELINE_SOURCE == 'push'