blob: 87968b61328f94ee74c02904be6372c22baacb3d [file] [log] [blame]
Eric Engestrom329f5cd2019-01-20 11:21:45 +00001# 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 :)
18variables:
Andres Gomezcf79d622019-03-05 13:55:17 +020019 UBUNTU_TAG: 2019-03-05-01
Eric Engestrom3dc5faf2019-02-08 17:43:55 +000020 UBUNTU_IMAGE: "$CI_REGISTRY_IMAGE/ubuntu:$UBUNTU_TAG"
Michel Dänzerd6c55f62019-02-08 10:14:58 +010021 UBUNTU_IMAGE_MAIN: "registry.freedesktop.org/mesa/mesa/ubuntu:$UBUNTU_TAG"
Eric Engestrom329f5cd2019-01-20 11:21:45 +000022
Eric Engestrom329f5cd2019-01-20 11:21:45 +000023stages:
24 - containers-build
Eric Engestrom46d23c02019-01-20 11:26:53 +000025 - build+test
Eric Engestrom329f5cd2019-01-20 11:21:45 +000026
27
Eric Engestrom7f5d9c22019-02-22 15:52:08 +000028# When to automatically run the CI
29.ci-run-policy:
30 only:
31 - master
32 - merge_requests
33 - /^ci([-/].*)?$/
Michel Dänzer6140ed32019-03-26 18:39:41 +010034 retry:
35 max: 2
36 when:
37 - runner_system_failure
Eric Engestrom7f5d9c22019-02-22 15:52:08 +000038
39
Eric Engestrom329f5cd2019-01-20 11:21:45 +000040# CONTAINERS
41
Eric Engestromfaf9e402019-02-26 14:40:29 +000042ubuntu:
Eric Engestrom7f5d9c22019-02-22 15:52:08 +000043 extends: .ci-run-policy
Eric Engestrom329f5cd2019-01-20 11:21:45 +000044 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
Michel Dänzerd6c55f62019-02-08 10:14:58 +010058 # 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
Eric Engestrom329f5cd2019-01-20 11:21:45 +000062 - docker build -t $UBUNTU_IMAGE -f .gitlab-ci/Dockerfile.ubuntu .
63 - docker push $UBUNTU_IMAGE
Eric Engestrom46d23c02019-01-20 11:26:53 +000064
65
66# BUILD
67
68.build:
Eric Engestrom7f5d9c22019-02-22 15:52:08 +000069 extends: .ci-run-policy
Eric Engestrom46d23c02019-01-20 11:26:53 +000070 image: $UBUNTU_IMAGE
71 stage: build+test
Michel Dänzera3f34f92019-03-26 18:35:59 +010072 cache:
73 paths:
74 - ccache
Eric Engestrom46d23c02019-01-20 11:26:53 +000075 artifacts:
76 when: on_failure
77 untracked: true
Eric Engestrom23b485c2019-02-12 16:59:27 +000078 # Use ccache transparently, and print stats before/after
79 before_script:
80 - export PATH="/usr/lib/ccache:$PATH"
81 - export CCACHE_BASEDIR="$PWD"
82 - export CCACHE_DIR="$PWD/ccache"
83 - export CCACHE_COMPILERCHECK=content
84 - ccache --zero-stats || true
85 - ccache --show-stats || true
86 after_script:
87 - export CCACHE_DIR="$PWD/ccache"
88 - ccache --show-stats
Eric Engestrom46d23c02019-01-20 11:26:53 +000089
90.meson-build:
91 extends: .build
Eric Engestrom23b485c2019-02-12 16:59:27 +000092 script:
Eric Engestrom46d23c02019-01-20 11:26:53 +000093 # We need to control the version of llvm-config we're using, so we'll
94 # generate a native file to do so. This requires meson >=0.49
95 - if test -n "$LLVM_VERSION"; then
96 LLVM_CONFIG="llvm-config-${LLVM_VERSION}";
97 echo -e "[binaries]\nllvm-config = '`which $LLVM_CONFIG`'" > native.file;
98 $LLVM_CONFIG --version;
99 else
100 touch native.file;
101 fi
102 - meson --version
103 - meson _build
104 --native-file=native.file
105 -D build-tests=true
106 -D libunwind=${UNWIND}
107 ${DRI_LOADERS}
108 -D dri-drivers=${DRI_DRIVERS:-[]}
109 ${GALLIUM_ST}
110 -D gallium-drivers=${GALLIUM_DRIVERS:-[]}
111 -D vulkan-drivers=${VULKAN_DRIVERS:-[]}
Bas Nieuwenhuizen158d45d2019-03-13 00:15:09 +0100112 -D I-love-half-baked-turnips=true
Eric Engestrom46d23c02019-01-20 11:26:53 +0000113 - cd _build
114 - meson configure
Eric Engestrom68a93832019-02-13 14:25:45 +0000115 - ninja -j4
Eric Engestrom46d23c02019-01-20 11:26:53 +0000116 - ninja test
117
Eric Engestrom06b245b2019-01-23 15:46:10 +0000118.scons-build:
119 extends: .build
120 variables:
121 SCONSFLAGS: "-j4"
122 script:
Eric Engestromd4c6d4d2019-01-28 16:30:36 +0000123 - if test -n "$LLVM_VERSION"; then
124 export LLVM_CONFIG="llvm-config-${LLVM_VERSION}";
125 fi
Eric Engestrom06b245b2019-01-23 15:46:10 +0000126 - scons $SCONS_TARGET
127 - eval $SCONS_CHECK_COMMAND
128
Michel Dänzera2cce702019-03-20 15:58:31 +0100129autotools:
130 extends: .build
131 variables:
Michel Dänzer6d0a7f72019-03-20 11:00:06 +0100132 MAKEFLAGS: "-j8"
Michel Dänzera2cce702019-03-20 15:58:31 +0100133 LLVM_CONFIG: llvm-config-7
134 script:
135 - mkdir build
136 - cd build
137 - ../autogen.sh
138 --enable-autotools
139 --enable-debug
140 --disable-llvm-shared-libs
141 - make
142 - make check
143
144# NOTE: Building SWR is 2x (yes two) times slower than all the other
145# gallium drivers combined.
146# Start this early so that it doesn't limit the total run time.
147meson-gallium-swr:
148 extends: .meson-build
149 variables:
150 UNWIND: "true"
151 DRI_LOADERS: >
152 -D glx=disabled
153 -D egl=false
154 -D gbm=false
155 GALLIUM_ST: >
156 -D dri3=false
157 -D gallium-vdpau=false
158 -D gallium-xvmc=false
159 -D gallium-omx=disabled
160 -D gallium-va=false
161 -D gallium-xa=false
162 -D gallium-nine=false
163 -D gallium-opencl=disabled
164 GALLIUM_DRIVERS: "swr"
165 LLVM_VERSION: "6.0"
166
167meson-clang:
168 extends: .meson-build
169 variables:
170 UNWIND: "true"
171 DRI_DRIVERS: "auto"
172 GALLIUM_DRIVERS: "auto"
Michel Dänzer1aca01d2019-03-26 10:04:27 +0100173 CC: "ccache clang-7"
174 CXX: "ccache clang++-7"
Michel Dänzera2cce702019-03-20 15:58:31 +0100175
Eric Engestromfaf9e402019-02-26 14:40:29 +0000176meson-vulkan:
Eric Engestrom46d23c02019-01-20 11:26:53 +0000177 extends: .meson-build
178 variables:
179 UNWIND: "false"
180 DRI_LOADERS: >
181 -D glx=disabled
182 -D gbm=false
183 -D egl=false
184 -D platforms=x11,wayland,drm
185 -D osmesa=none
186 GALLIUM_ST: >
187 -D dri3=true
188 -D gallium-vdpau=false
189 -D gallium-xvmc=false
190 -D gallium-omx=disabled
191 -D gallium-va=false
192 -D gallium-xa=false
193 -D gallium-nine=false
194 -D gallium-opencl=disabled
Bas Nieuwenhuizen158d45d2019-03-13 00:15:09 +0100195 VULKAN_DRIVERS: intel,amd,freedreno
Eric Engestrom46d23c02019-01-20 11:26:53 +0000196 LLVM_VERSION: "7"
Eric Engestrom89a74672019-01-21 09:42:37 +0000197
Eric Engestromfaf9e402019-02-26 14:40:29 +0000198meson-loader-classic-dri:
Eric Engestromd73265e2019-01-28 17:38:17 +0000199 extends: .meson-build
200 variables:
201 UNWIND: "false"
202 DRI_LOADERS: >
203 -D glx=dri
204 -D gbm=true
205 -D egl=true
206 -D platforms=x11,wayland,drm,surfaceless
207 -D osmesa=classic
208 DRI_DRIVERS: "i915,i965,r100,r200,swrast,nouveau"
209 GALLIUM_ST: >
210 -D dri3=true
211 -D gallium-vdpau=false
212 -D gallium-xvmc=false
213 -D gallium-omx=disabled
214 -D gallium-va=false
215 -D gallium-xa=false
216 -D gallium-nine=false
217 -D gallium-opencl=disabled
218
Eric Engestromfaf9e402019-02-26 14:40:29 +0000219meson-glvnd:
Eric Engestromba26bc42019-01-29 08:57:17 +0000220 extends: .meson-build
221 variables:
222 UNWIND: "true"
223 DRI_LOADERS: >
224 -D glvnd=true
225 -D egl=true
226 -D gbm=true
227 -D glx=dri
228 DRI_DRIVERS: "i965"
229 GALLIUM_ST: >
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
Eric Engestromfaf9e402019-02-26 14:40:29 +0000238meson-gallium-radeonsi:
Eric Engestrom06e8f192019-01-28 17:45:26 +0000239 extends: .meson-build
240 variables:
241 UNWIND: "true"
242 DRI_LOADERS: >
243 -D glx=disabled
244 -D egl=false
245 -D gbm=false
246 GALLIUM_ST: >
247 -D dri3=false
248 -D gallium-vdpau=false
249 -D gallium-xvmc=false
250 -D gallium-omx=disabled
251 -D gallium-va=false
252 -D gallium-xa=false
253 -D gallium-nine=false
254 -D gallium-opencl=disabled
255 GALLIUM_DRIVERS: "radeonsi"
256 LLVM_VERSION: "7"
257
Eric Engestromfaf9e402019-02-26 14:40:29 +0000258meson-gallium-drivers-other:
Eric Engestromd407ead2019-01-28 17:47:09 +0000259 extends: .meson-build
260 variables:
261 UNWIND: "true"
262 DRI_LOADERS: >
263 -D glx=disabled
264 -D egl=false
265 -D gbm=false
266 GALLIUM_ST: >
267 -D dri3=false
268 -D gallium-vdpau=false
269 -D gallium-xvmc=false
270 -D gallium-omx=disabled
271 -D gallium-va=false
272 -D gallium-xa=false
273 -D gallium-nine=false
274 -D gallium-opencl=disabled
Eric Engestromdb944992019-03-09 22:53:27 +0000275 GALLIUM_DRIVERS: "i915,iris,nouveau,kmsro,r300,r600,freedreno,svga,swrast,v3d,vc4,virgl,etnaviv,panfrost"
Eric Engestromd407ead2019-01-28 17:47:09 +0000276 LLVM_VERSION: "5.0"
277
Eric Engestrom3006f9d2019-03-06 17:59:03 +0000278meson-gallium-clover-llvm:
Eric Engestromb5a70af2019-01-28 18:05:22 +0000279 extends: .meson-build
280 variables:
281 UNWIND: "true"
282 DRI_LOADERS: >
283 -D glx=disabled
284 -D egl=false
285 -D gbm=false
286 GALLIUM_ST: >
287 -D dri3=false
288 -D gallium-vdpau=false
289 -D gallium-xvmc=false
290 -D gallium-omx=disabled
291 -D gallium-va=false
292 -D gallium-xa=false
293 -D gallium-nine=false
294 -D gallium-opencl=icd
Eric Engestrom8dab7072019-01-28 18:09:24 +0000295 GALLIUM_DRIVERS: "r600,radeonsi"
Eric Engestrom3006f9d2019-03-06 17:59:03 +0000296
297meson-gallium-clover-llvm39:
298 extends: meson-gallium-clover-llvm
299 variables:
300 GALLIUM_DRIVERS: "r600"
301 LLVM_VERSION: "3.9"
Eric Engestrom8dab7072019-01-28 18:09:24 +0000302
Eric Engestromfaf9e402019-02-26 14:40:29 +0000303meson-gallium-st-other:
Eric Engestromf33517b2019-01-28 18:13:55 +0000304 extends: .meson-build
305 variables:
306 UNWIND: "true"
307 DRI_LOADERS: >
308 -D glx=disabled
309 -D egl=false
310 -D gbm=false
311 GALLIUM_ST: >
312 -D dri3=true
313 -D gallium-vdpau=true
314 -D gallium-xvmc=true
315 -D gallium-omx=bellagio
316 -D gallium-va=true
317 -D gallium-xa=true
318 -D gallium-nine=true
319 -D gallium-opencl=disabled
320 -D osmesa=gallium
321 GALLIUM_DRIVERS: "nouveau,swrast"
322 LLVM_VERSION: "5.0"
323
Eric Engestromfaf9e402019-02-26 14:40:29 +0000324scons-nollvm:
Eric Engestrom06b245b2019-01-23 15:46:10 +0000325 extends: .scons-build
326 variables:
327 SCONS_TARGET: "llvm=0"
328 SCONS_CHECK_COMMAND: "scons llvm=0 check"
Eric Engestromd4c6d4d2019-01-28 16:30:36 +0000329
Eric Engestromfaf9e402019-02-26 14:40:29 +0000330scons-llvm:
Eric Engestromd4c6d4d2019-01-28 16:30:36 +0000331 extends: .scons-build
332 variables:
333 SCONS_TARGET: "llvm=1"
334 SCONS_CHECK_COMMAND: "scons llvm=1 check"
335 LLVM_VERSION: "3.9"
Eric Engestrom6a19ec92019-01-28 16:33:22 +0000336
Eric Engestromfaf9e402019-02-26 14:40:29 +0000337scons-swr:
Eric Engestrom6a19ec92019-01-28 16:33:22 +0000338 extends: .scons-build
339 variables:
340 SCONS_TARGET: "swr=1"
341 SCONS_CHECK_COMMAND: "true"
342 LLVM_VERSION: "6.0"