gitlab-ci: Use Debian stretch instead of Ubuntu bionic
[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 UPSTREAM_REPO: mesa/mesa
20 DEBIAN_TAG: "2019-04-16"
21 DEBIAN_VERSION: stretch-slim
22 DEBIAN_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG"
23
24 include:
25 - project: 'wayland/ci-templates'
26 ref: c73dae8b84697ef18e2dbbf4fed7386d9652b0cd
27 file: '/templates/debian.yml'
28
29 stages:
30 - containers-build
31 - build+test
32
33
34 # When to automatically run the CI
35 .ci-run-policy: &ci-run-policy
36 only:
37 - branches@mesa/mesa
38 - merge_requests
39 - /^ci([-/].*)?$/
40 retry:
41 max: 2
42 when:
43 - runner_system_failure
44
45
46 # CONTAINERS
47
48 debian:
49 extends: .debian@container-ifnot-exists
50 stage: containers-build
51 <<: *ci-run-policy
52 variables:
53 GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
54 DEBIAN_EXEC: 'bash .gitlab-ci/debian-install.sh'
55
56
57 # BUILD
58
59 .build:
60 <<: *ci-run-policy
61 image: $DEBIAN_IMAGE
62 stage: build+test
63 cache:
64 paths:
65 - ccache
66 artifacts:
67 when: on_failure
68 untracked: true
69 # Use ccache transparently, and print stats before/after
70 before_script:
71 - export PATH="/usr/lib/ccache:$PATH"
72 - export CCACHE_BASEDIR="$PWD"
73 - export CCACHE_DIR="$PWD/ccache"
74 - export CCACHE_COMPILERCHECK=content
75 - ccache --zero-stats || true
76 - ccache --show-stats || true
77 after_script:
78 - export CCACHE_DIR="$PWD/ccache"
79 - ccache --show-stats
80
81 .meson-build:
82 extends: .build
83 script:
84 # We need to control the version of llvm-config we're using, so we'll
85 # generate a native file to do so. This requires meson >=0.49
86 - if test -n "$LLVM_VERSION"; then
87 LLVM_CONFIG="llvm-config-${LLVM_VERSION}";
88 echo -e "[binaries]\nllvm-config = '`which $LLVM_CONFIG`'" > native.file;
89 $LLVM_CONFIG --version;
90 else
91 touch native.file;
92 fi
93 - meson --version
94 - meson _build
95 --native-file=native.file
96 -D build-tests=true
97 -D libunwind=${UNWIND}
98 ${DRI_LOADERS}
99 -D dri-drivers=${DRI_DRIVERS:-[]}
100 ${GALLIUM_ST}
101 -D gallium-drivers=${GALLIUM_DRIVERS:-[]}
102 -D vulkan-drivers=${VULKAN_DRIVERS:-[]}
103 -D I-love-half-baked-turnips=true
104 - cd _build
105 - meson configure
106 - ninja -j4
107 - ninja test
108
109 .scons-build:
110 extends: .build
111 variables:
112 SCONSFLAGS: "-j4"
113 script:
114 - if test -n "$LLVM_VERSION"; then
115 export LLVM_CONFIG="llvm-config-${LLVM_VERSION}";
116 fi
117 - scons $SCONS_TARGET
118 - eval $SCONS_CHECK_COMMAND
119
120 # NOTE: Building SWR is 2x (yes two) times slower than all the other
121 # gallium drivers combined.
122 # Start this early so that it doesn't limit the total run time.
123 meson-gallium-swr:
124 extends: .meson-build
125 variables:
126 UNWIND: "true"
127 DRI_LOADERS: >
128 -D glx=disabled
129 -D egl=false
130 -D gbm=false
131 GALLIUM_ST: >
132 -D dri3=false
133 -D gallium-vdpau=false
134 -D gallium-xvmc=false
135 -D gallium-omx=disabled
136 -D gallium-va=false
137 -D gallium-xa=false
138 -D gallium-nine=false
139 -D gallium-opencl=disabled
140 GALLIUM_DRIVERS: "swr"
141 LLVM_VERSION: "6.0"
142
143 meson-clang:
144 extends: .meson-build
145 variables:
146 UNWIND: "true"
147 DRI_DRIVERS: "auto"
148 GALLIUM_DRIVERS: "auto"
149 CC: "ccache clang-7"
150 CXX: "ccache clang++-7"
151
152 meson-vulkan:
153 extends: .meson-build
154 variables:
155 UNWIND: "false"
156 DRI_LOADERS: >
157 -D glx=disabled
158 -D gbm=false
159 -D egl=false
160 -D platforms=x11,wayland,drm
161 -D osmesa=none
162 GALLIUM_ST: >
163 -D dri3=true
164 -D gallium-vdpau=false
165 -D gallium-xvmc=false
166 -D gallium-omx=disabled
167 -D gallium-va=false
168 -D gallium-xa=false
169 -D gallium-nine=false
170 -D gallium-opencl=disabled
171 VULKAN_DRIVERS: intel,amd,freedreno
172 LLVM_VERSION: "7"
173
174 meson-loader-classic-dri:
175 extends: .meson-build
176 variables:
177 UNWIND: "false"
178 DRI_LOADERS: >
179 -D glx=dri
180 -D gbm=true
181 -D egl=true
182 -D platforms=x11,wayland,drm,surfaceless
183 -D osmesa=classic
184 DRI_DRIVERS: "i915,i965,r100,r200,swrast,nouveau"
185 GALLIUM_ST: >
186 -D dri3=true
187 -D gallium-vdpau=false
188 -D gallium-xvmc=false
189 -D gallium-omx=disabled
190 -D gallium-va=false
191 -D gallium-xa=false
192 -D gallium-nine=false
193 -D gallium-opencl=disabled
194
195 meson-glvnd:
196 extends: .meson-build
197 variables:
198 UNWIND: "true"
199 DRI_LOADERS: >
200 -D glvnd=true
201 -D egl=true
202 -D gbm=true
203 -D glx=dri
204 DRI_DRIVERS: "i965"
205 GALLIUM_ST: >
206 -D gallium-vdpau=false
207 -D gallium-xvmc=false
208 -D gallium-omx=disabled
209 -D gallium-va=false
210 -D gallium-xa=false
211 -D gallium-nine=false
212 -D gallium-opencl=disabled
213
214 meson-gallium-radeonsi:
215 extends: .meson-build
216 variables:
217 UNWIND: "true"
218 DRI_LOADERS: >
219 -D glx=disabled
220 -D egl=false
221 -D gbm=false
222 GALLIUM_ST: >
223 -D dri3=false
224 -D gallium-vdpau=false
225 -D gallium-xvmc=false
226 -D gallium-omx=disabled
227 -D gallium-va=false
228 -D gallium-xa=false
229 -D gallium-nine=false
230 -D gallium-opencl=disabled
231 GALLIUM_DRIVERS: "radeonsi"
232 LLVM_VERSION: "7"
233
234 meson-gallium-drivers-other:
235 extends: .meson-build
236 variables:
237 UNWIND: "true"
238 DRI_LOADERS: >
239 -D glx=disabled
240 -D egl=false
241 -D gbm=false
242 GALLIUM_ST: >
243 -D dri3=false
244 -D gallium-vdpau=false
245 -D gallium-xvmc=false
246 -D gallium-omx=disabled
247 -D gallium-va=false
248 -D gallium-xa=false
249 -D gallium-nine=false
250 -D gallium-opencl=disabled
251 GALLIUM_DRIVERS: "i915,iris,nouveau,kmsro,r300,r600,freedreno,svga,swrast,v3d,vc4,virgl,etnaviv,panfrost,lima"
252 LLVM_VERSION: "5.0"
253
254 meson-gallium-clover-llvm:
255 extends: .meson-build
256 variables:
257 UNWIND: "true"
258 DRI_LOADERS: >
259 -D glx=disabled
260 -D egl=false
261 -D gbm=false
262 GALLIUM_ST: >
263 -D dri3=false
264 -D gallium-vdpau=false
265 -D gallium-xvmc=false
266 -D gallium-omx=disabled
267 -D gallium-va=false
268 -D gallium-xa=false
269 -D gallium-nine=false
270 -D gallium-opencl=icd
271 GALLIUM_DRIVERS: "r600,radeonsi"
272
273 meson-gallium-clover-llvm39:
274 extends: meson-gallium-clover-llvm
275 variables:
276 GALLIUM_DRIVERS: "r600"
277 LLVM_VERSION: "3.9"
278
279 meson-gallium-st-other:
280 extends: .meson-build
281 variables:
282 UNWIND: "true"
283 DRI_LOADERS: >
284 -D glx=disabled
285 -D egl=false
286 -D gbm=false
287 GALLIUM_ST: >
288 -D dri3=true
289 -D gallium-extra-hud=true
290 -D gallium-vdpau=true
291 -D gallium-xvmc=true
292 -D gallium-omx=bellagio
293 -D gallium-va=true
294 -D gallium-xa=true
295 -D gallium-nine=true
296 -D gallium-opencl=disabled
297 -D osmesa=gallium
298 GALLIUM_DRIVERS: "nouveau,swrast"
299 LLVM_VERSION: "5.0"
300
301 scons-nollvm:
302 extends: .scons-build
303 variables:
304 SCONS_TARGET: "llvm=0"
305 SCONS_CHECK_COMMAND: "scons llvm=0 check"
306
307 scons-llvm:
308 extends: .scons-build
309 variables:
310 SCONS_TARGET: "llvm=1"
311 SCONS_CHECK_COMMAND: "scons llvm=1 check"
312 LLVM_VERSION: "3.9"
313
314 scons-swr:
315 extends: .scons-build
316 variables:
317 SCONS_TARGET: "swr=1"
318 SCONS_CHECK_COMMAND: "true"
319 LLVM_VERSION: "6.0"