os: Explicitly include X11/Xmd.h for CARD32 definition to fix building on i686
[xserver.git] / .gitlab-ci.yml
blobdd055e284b9028b8e64cd4d8224c4cc5fbdc0b99
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     FDO_DISTRIBUTION_VERSION: bullseye-slim
21     FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/debian-install.sh'
22     FDO_DISTRIBUTION_TAG: "2024-03-26-explicit-sync-2"
23     MESON_BUILDDIR: "build"
25 include:
26   - project: 'freedesktop/ci-templates'
27     ref: *template_sha
28     file: '/templates/debian.yml'
29   - project: 'freedesktop/ci-templates'
30     ref: *template_sha
31     file: '/templates/ci-fairy.yml'
32   - template: Security/SAST.gitlab-ci.yml
34 stages:
35     - docker-image
36     - build-and-test
37     - drivers
38     - test
40 .ci-run-policy:
41   # Retry jobs after runner system failures
42   retry:
43     max: 2
44     when:
45       - runner_system_failure
46   # Cancel CI run if a newer commit is pushed to the same branch
47   interruptible: true
49 # This is everything but the DDXen
50 .dix_paths: &dix_paths
51   # Directories
52   - .gitlab-ci/**/*
53   - composite/**/*
54   - config/**/*
55   - damageext/**/*
56   - dbe/**/*
57   - dix/**/*
58   - doc/**/*
59   - dri3/**/*
60   - exa/**/*
61   - fb/**/*
62   - glamor/**/*
63   - glx/**/*
64   - include/**/*
65   - m4/**/*
66   - man/**/*
67   - mi/**/*
68   - miext/**/*
69   - os/**/*
70   - present/**/*
71   - pseudoramiX/**/*
72   - randr/**/*
73   - record/**/*
74   - render/**/*
75   - test/**/*
76   - Xext/**/*
77   - xfixes/**/*
78   - Xi/**/*
79   - xkb/**/*
80   # Files
81   - hw/meson.build
82   - .gitlab-ci.yml
83   - meson*
84   - xorg-server.m4
85   - xorg-server.pc.in
86   - xserver.ent.in
88 .xorg_paths: &xorg_paths
89   - hw/xfree86/**/*
91 .xwayland_paths: &xwayland_paths
92   - hw/xwayland/**/*
94 .all_ddx_paths:
95   - hw/**/*
97 debian-bullseye:
98   extends:
99     - .fdo.container-build@debian
100     - .ci-run-policy
101   stage: docker-image
102   variables:
103     GIT_STRATEGY: none
105 .common-build-and-test:
106     extends:
107         - .fdo.distribution-image@debian
108         - .ci-run-policy
109     stage: build-and-test
110     artifacts:
111         when: always
112         paths:
113             - $MESON_BUILDDIR/meson-logs/
114             - $MESON_BUILDDIR/test/piglit-results/
115     variables:
116         MESON_ARGS: -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=true -Dwerror=true
117         CCACHE_COMPILERCHECK: content
118         CCACHE_DIR: /cache/xserver/cache
119         LC_ALL: C.UTF-8
120     before_script:
121         - export CCACHE_BASEDIR="$PWD"
122         - export PATH="/usr/lib/ccache:$PATH"
123         - ccache --show-stats
124     after_script:
125         - ccache --show-stats
127 meson:
128     extends: .common-build-and-test
129     script:
130         - .gitlab-ci/meson-build.sh --run-test
131         - .gitlab-ci/check-piglit-results.sh
132         - .gitlab-ci/manpages-check
133     variables:
134       XTEST_DIR: /root/xts
135       PIGLIT_DIR: /root/piglit
136       LP_NUM_THREADS: 0
138 meson-noglamor:
139     extends: meson
140     variables:
141         MESON_EXTRA_ARGS: >
142           -Dglamor=false
144 meson-nolibdecor:
145     extends: meson
146     variables:
147         MESON_EXTRA_ARGS: >
148           -Dlibdecor=false
150 mingw-cross-build:
151     extends: .common-build-and-test
152     script:
153         - .gitlab-ci/meson-build.sh --run-install
154     variables:
155       MESON_ARGS: --cross-file=.gitlab-ci/cross-i686-w64-mingw32.txt -Dglx=false -Dsecure-rpc=false -Dlisten_tcp=true
157 meson-dist:
158     extends: .common-build-and-test
159     artifacts:
160         when: always
161         paths:
162             - $MESON_BUILDDIR/meson-logs/
163             - $MESON_BUILDDIR/xserver-*/$MESON_BUILDDIR/meson-logs/
164     script:
165         - .gitlab-ci/meson-build.sh --run-dist
166         - mkdir xserver-tarball
167         - tar xf $MESON_BUILDDIR/meson-dist/xserver-*.tar.xz -C xserver-tarball --strip-components=1
168         - .gitlab-ci/meson-build.sh -C xserver-tarball --skip-test --skip-dist --run-install
169     variables:
170       MESON_DIST_ARGS: --no-tests
171       DESTDIR: xserver-tarball/install/
173 xf86-driver-build-test:
174     extends:
175         - .fdo.distribution-image@debian
176         - .ci-run-policy
177     stage: drivers
178     parallel:
179         matrix:
180             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-evdev
181               SHA: xf86-input-evdev-2.10.6
182             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput
183               SHA: xf86-input-libinput-1.4.0
184             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-mouse
185               SHA: xf86-input-mouse-1.9.5
186             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-synaptics
187               SHA: xf86-input-synaptics-1.9.2
188             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu
189               SHA: xf86-video-amdgpu-23.0.0
190             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ati
191               SHA: xf86-video-ati-22.0.0
192             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-qxl
193               SHA: xf86-video-qxl-0.1.6
194             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vesa
195               SHA: xf86-video-vesa-2.6.0
196             - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vmware
197               SHA: xf86-video-vmware-13.4.0
198     script:
199         # Install the server first
200         - .gitlab-ci/meson-build.sh --skip-test --run-install
201         - unset MESON_EXTRA_ARGS
202         - DRIVER=$(basename $REPO)
203         - git clone "$REPO" "$DRIVER"
204         - GIT_DIR="$DRIVER/.git" git checkout -f "$SHA"
205         - |
206           if [[ -e "$DRIVER/meson.build" ]]; then
207             .gitlab-ci/meson-build.sh -C "$DRIVER" --skip-test
208           else
209              pushd "$DRIVER" || exit 1
210              ./autogen.sh && make
211           fi
212     needs:
213         - "meson"
214     variables:
215         GIT_DEPTH: 1
216         MESON_ARGS: -Dprefix=/usr/
217         MESON_EXTRA_ARGS: -Dxwayland=false -Dxnest=false -Dxvfb=false -Dxquartz=false -Ddocs=false
218     rules:
219       - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
220         changes:
221           *dix_paths
222       - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
223         changes:
224           *xorg_paths
227 # Verify that commit messages are as expected
229 check-commits:
230   extends:
231     - .fdo.ci-fairy
232   needs: []
233   stage: test
234   script:
235     - ci-fairy check-commits --junit-xml=results.xml
236   except:
237     - master@xorg/xserver
238   variables:
239     GIT_DEPTH: 100
240   artifacts:
241     reports:
242       junit: results.xml
243   allow_failure: true
246 # Verify that the merge request has the allow-collaboration checkbox ticked
248 check-merge-request:
249   extends:
250     - .fdo.ci-fairy
251   needs: []
252   stage: test
253   rules:
254     - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
255   script:
256     - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
257   artifacts:
258     when: on_failure
259     reports:
260       junit: results.xml
261   allow_failure: true
264 # Workflow rules needed due to:
265 # https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/438
267 workflow:
268   rules:
269     - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
270     - if: $CI_OPEN_MERGE_REQUESTS
271       when: never
272     - if: $CI_PIPELINE_SOURCE == 'push'