gitlab-ci: drop most autotools builds
[mesa.git] / .gitlab-ci.yml
1 # This is the tag of the docker image used for the build jobs. If the
2 # image doesn't exist yet, the containers-build stage generates it.
3 #
4 # In order to generate a new image, one should generally change the tag.
5 # While removing the image from the registry would also work, that's not
6 # recommended except for ephemeral images during development: Replacing
7 # an image after a significant amount of time might pull in newer
8 # versions of gcc/clang or other packages, which might break the build
9 # with older commits using the same tag.
10 #
11 # After merging a change resulting in generating a new image to the
12 # main repository, it's recommended to remove the image from the source
13 # repository's container registry, so that the image from the main
14 # repository's registry will be used there as well.
15 #
16 # The format of the tag is "%Y-%m-%d-${counter}" where ${counter} stays
17 # at "01" unless you have multiple updates on the same day :)
18 variables:
19 UBUNTU_TAG: 2019-03-05-01
20 UBUNTU_IMAGE: "$CI_REGISTRY_IMAGE/ubuntu:$UBUNTU_TAG"
21 UBUNTU_IMAGE_MAIN: "registry.freedesktop.org/mesa/mesa/ubuntu:$UBUNTU_TAG"
22
23 cache:
24 paths:
25 - ccache
26
27 stages:
28 - containers-build
29 - build+test
30
31
32 # When to automatically run the CI
33 .ci-run-policy:
34 only:
35 - master
36 - merge_requests
37 - /^ci([-/].*)?$/
38
39
40 # CONTAINERS
41
42 ubuntu:
43 extends: .ci-run-policy
44 stage: containers-build
45 image: docker:stable
46 services:
47 - docker:dind
48 variables:
49 DOCKER_HOST: tcp://docker:2375
50 DOCKER_DRIVER: overlay2
51 script:
52 # Enable experimental features such as `docker manifest inspect`
53 - mkdir -p ~/.docker
54 - "echo '{\"experimental\": \"enabled\"}' > ~/.docker/config.json"
55 - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
56 # Check if the image (with the specific tag) already exists
57 - docker manifest inspect $UBUNTU_IMAGE && exit || true
58 # Try to re-use the image from the main repository's registry
59 - docker image pull $UBUNTU_IMAGE_MAIN &&
60 docker image tag $UBUNTU_IMAGE_MAIN $UBUNTU_IMAGE &&
61 docker image push $UBUNTU_IMAGE && exit || true
62 - docker build -t $UBUNTU_IMAGE -f .gitlab-ci/Dockerfile.ubuntu .
63 - docker push $UBUNTU_IMAGE
64
65
66 # BUILD
67
68 .build:
69 extends: .ci-run-policy
70 image: $UBUNTU_IMAGE
71 stage: build+test
72 artifacts:
73 when: on_failure
74 untracked: true
75 # Use ccache transparently, and print stats before/after
76 before_script:
77 - export PATH="/usr/lib/ccache:$PATH"
78 - export CCACHE_BASEDIR="$PWD"
79 - export CCACHE_DIR="$PWD/ccache"
80 - export CCACHE_COMPILERCHECK=content
81 - ccache --zero-stats || true
82 - ccache --show-stats || true
83 after_script:
84 - export CCACHE_DIR="$PWD/ccache"
85 - ccache --show-stats
86
87 .meson-build:
88 extends: .build
89 script:
90 # We need to control the version of llvm-config we're using, so we'll
91 # generate a native file to do so. This requires meson >=0.49
92 - if test -n "$LLVM_VERSION"; then
93 LLVM_CONFIG="llvm-config-${LLVM_VERSION}";
94 echo -e "[binaries]\nllvm-config = '`which $LLVM_CONFIG`'" > native.file;
95 $LLVM_CONFIG --version;
96 else
97 touch native.file;
98 fi
99 - meson --version
100 - meson _build
101 --native-file=native.file
102 -D build-tests=true
103 -D libunwind=${UNWIND}
104 ${DRI_LOADERS}
105 -D dri-drivers=${DRI_DRIVERS:-[]}
106 ${GALLIUM_ST}
107 -D gallium-drivers=${GALLIUM_DRIVERS:-[]}
108 -D vulkan-drivers=${VULKAN_DRIVERS:-[]}
109 -D I-love-half-baked-turnips=true
110 - cd _build
111 - meson configure
112 - ninja -j4
113 - ninja test
114
115 .scons-build:
116 extends: .build
117 variables:
118 SCONSFLAGS: "-j4"
119 script:
120 - if test -n "$LLVM_VERSION"; then
121 export LLVM_CONFIG="llvm-config-${LLVM_VERSION}";
122 fi
123 - scons $SCONS_TARGET
124 - eval $SCONS_CHECK_COMMAND
125
126 meson-vulkan:
127 extends: .meson-build
128 variables:
129 UNWIND: "false"
130 DRI_LOADERS: >
131 -D glx=disabled
132 -D gbm=false
133 -D egl=false
134 -D platforms=x11,wayland,drm
135 -D osmesa=none
136 GALLIUM_ST: >
137 -D dri3=true
138 -D gallium-vdpau=false
139 -D gallium-xvmc=false
140 -D gallium-omx=disabled
141 -D gallium-va=false
142 -D gallium-xa=false
143 -D gallium-nine=false
144 -D gallium-opencl=disabled
145 VULKAN_DRIVERS: intel,amd,freedreno
146 LLVM_VERSION: "7"
147
148 meson-loader-classic-dri:
149 extends: .meson-build
150 variables:
151 UNWIND: "false"
152 DRI_LOADERS: >
153 -D glx=dri
154 -D gbm=true
155 -D egl=true
156 -D platforms=x11,wayland,drm,surfaceless
157 -D osmesa=classic
158 DRI_DRIVERS: "i915,i965,r100,r200,swrast,nouveau"
159 GALLIUM_ST: >
160 -D dri3=true
161 -D gallium-vdpau=false
162 -D gallium-xvmc=false
163 -D gallium-omx=disabled
164 -D gallium-va=false
165 -D gallium-xa=false
166 -D gallium-nine=false
167 -D gallium-opencl=disabled
168
169 meson-glvnd:
170 extends: .meson-build
171 variables:
172 UNWIND: "true"
173 DRI_LOADERS: >
174 -D glvnd=true
175 -D egl=true
176 -D gbm=true
177 -D glx=dri
178 DRI_DRIVERS: "i965"
179 GALLIUM_ST: >
180 -D gallium-vdpau=false
181 -D gallium-xvmc=false
182 -D gallium-omx=disabled
183 -D gallium-va=false
184 -D gallium-xa=false
185 -D gallium-nine=false
186 -D gallium-opencl=disabled
187
188 meson-clang:
189 extends: .meson-build
190 variables:
191 UNWIND: "true"
192 DRI_DRIVERS: "auto"
193 GALLIUM_DRIVERS: "auto"
194 CC: clang-7
195 CXX: clang++-7
196
197 # NOTE: Building SWR is 2x (yes two) times slower than all the other
198 # gallium drivers combined.
199 # Start this early so that it doesn't hunder the run time.
200 meson-gallium-swr:
201 extends: .meson-build
202 variables:
203 UNWIND: "true"
204 DRI_LOADERS: >
205 -D glx=disabled
206 -D egl=false
207 -D gbm=false
208 GALLIUM_ST: >
209 -D dri3=false
210 -D gallium-vdpau=false
211 -D gallium-xvmc=false
212 -D gallium-omx=disabled
213 -D gallium-va=false
214 -D gallium-xa=false
215 -D gallium-nine=false
216 -D gallium-opencl=disabled
217 GALLIUM_DRIVERS: "swr"
218 LLVM_VERSION: "6.0"
219
220 meson-gallium-radeonsi:
221 extends: .meson-build
222 variables:
223 UNWIND: "true"
224 DRI_LOADERS: >
225 -D glx=disabled
226 -D egl=false
227 -D gbm=false
228 GALLIUM_ST: >
229 -D dri3=false
230 -D gallium-vdpau=false
231 -D gallium-xvmc=false
232 -D gallium-omx=disabled
233 -D gallium-va=false
234 -D gallium-xa=false
235 -D gallium-nine=false
236 -D gallium-opencl=disabled
237 GALLIUM_DRIVERS: "radeonsi"
238 LLVM_VERSION: "7"
239
240 meson-gallium-drivers-other:
241 extends: .meson-build
242 variables:
243 UNWIND: "true"
244 DRI_LOADERS: >
245 -D glx=disabled
246 -D egl=false
247 -D gbm=false
248 GALLIUM_ST: >
249 -D dri3=false
250 -D gallium-vdpau=false
251 -D gallium-xvmc=false
252 -D gallium-omx=disabled
253 -D gallium-va=false
254 -D gallium-xa=false
255 -D gallium-nine=false
256 -D gallium-opencl=disabled
257 GALLIUM_DRIVERS: "i915,iris,nouveau,kmsro,r300,r600,freedreno,svga,swrast,v3d,vc4,virgl,etnaviv,panfrost"
258 LLVM_VERSION: "5.0"
259
260 meson-gallium-clover-llvm:
261 extends: .meson-build
262 variables:
263 UNWIND: "true"
264 DRI_LOADERS: >
265 -D glx=disabled
266 -D egl=false
267 -D gbm=false
268 GALLIUM_ST: >
269 -D dri3=false
270 -D gallium-vdpau=false
271 -D gallium-xvmc=false
272 -D gallium-omx=disabled
273 -D gallium-va=false
274 -D gallium-xa=false
275 -D gallium-nine=false
276 -D gallium-opencl=icd
277 GALLIUM_DRIVERS: "r600,radeonsi"
278
279 meson-gallium-clover-llvm39:
280 extends: meson-gallium-clover-llvm
281 variables:
282 GALLIUM_DRIVERS: "r600"
283 LLVM_VERSION: "3.9"
284
285 meson-gallium-st-other:
286 extends: .meson-build
287 variables:
288 UNWIND: "true"
289 DRI_LOADERS: >
290 -D glx=disabled
291 -D egl=false
292 -D gbm=false
293 GALLIUM_ST: >
294 -D dri3=true
295 -D gallium-vdpau=true
296 -D gallium-xvmc=true
297 -D gallium-omx=bellagio
298 -D gallium-va=true
299 -D gallium-xa=true
300 -D gallium-nine=true
301 -D gallium-opencl=disabled
302 -D osmesa=gallium
303 GALLIUM_DRIVERS: "nouveau,swrast"
304 LLVM_VERSION: "5.0"
305
306 autotools:
307 extends: .build
308 variables:
309 MAKEFLAGS: "-j4"
310 LLVM_CONFIG: llvm-config-7
311 script:
312 - mkdir build
313 - cd build
314 - ../autogen.sh
315 --enable-autotools
316 --enable-debug
317 --disable-llvm-shared-libs
318 - make
319 - make check
320
321 scons-nollvm:
322 extends: .scons-build
323 variables:
324 SCONS_TARGET: "llvm=0"
325 SCONS_CHECK_COMMAND: "scons llvm=0 check"
326
327 scons-llvm:
328 extends: .scons-build
329 variables:
330 SCONS_TARGET: "llvm=1"
331 SCONS_CHECK_COMMAND: "scons llvm=1 check"
332 LLVM_VERSION: "3.9"
333
334 scons-swr:
335 extends: .scons-build
336 variables:
337 SCONS_TARGET: "swr=1"
338 SCONS_CHECK_COMMAND: "true"
339 LLVM_VERSION: "6.0"