gitlab-ci: Only keep the build logs as artifacts.
[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 variables:
16 UPSTREAM_REPO: mesa/mesa
17 DEBIAN_TAG: "2019-07-11"
18 DEBIAN_VERSION: stretch-slim
19 DEBIAN_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG"
20
21 include:
22 - project: 'wayland/ci-templates'
23 ref: c73dae8b84697ef18e2dbbf4fed7386d9652b0cd
24 file: '/templates/debian.yml'
25
26 stages:
27 - containers-build
28 - build+test
29
30
31 # When to automatically run the CI
32 .ci-run-policy: &ci-run-policy
33 only:
34 - branches@mesa/mesa
35 - merge_requests
36 - /^ci([-/].*)?$/
37 retry:
38 max: 2
39 when:
40 - runner_system_failure
41
42
43 # CONTAINERS
44
45 debian:
46 extends: .debian@container-ifnot-exists
47 stage: containers-build
48 <<: *ci-run-policy
49 variables:
50 GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
51 DEBIAN_EXEC: 'bash .gitlab-ci/debian-install.sh'
52
53
54 # BUILD
55
56 .build:
57 <<: *ci-run-policy
58 image: $DEBIAN_IMAGE
59 stage: build+test
60 cache:
61 paths:
62 - ccache
63 artifacts:
64 when: always
65 paths:
66 - _build/meson-logs/*.txt
67 # scons:
68 - _build/*/config.log
69 variables:
70 CCACHE_COMPILERCHECK: "content"
71 # Use ccache transparently, and print stats before/after
72 before_script:
73 - export PATH="/usr/lib/ccache:$PATH"
74 - export CCACHE_BASEDIR="$PWD"
75 - export CCACHE_DIR="$PWD/ccache"
76 - ccache --zero-stats || true
77 - ccache --show-stats || true
78 after_script:
79 - export CCACHE_DIR="$PWD/ccache"
80 - ccache --show-stats
81
82 .meson-build:
83 extends: .build
84 script:
85 - .gitlab-ci/meson-build.sh
86
87 .scons-build:
88 extends: .build
89 variables:
90 SCONSFLAGS: "-j4"
91 script:
92 - if test -n "$LLVM_VERSION"; then
93 export LLVM_CONFIG="llvm-config-${LLVM_VERSION}";
94 fi
95 - scons $SCONS_TARGET
96 - eval $SCONS_CHECK_COMMAND
97
98 # NOTE: Building SWR is 2x (yes two) times slower than all the other
99 # gallium drivers combined.
100 # Start this early so that it doesn't limit the total run time.
101 #
102 # We also put softpipe (and therefore gallium nine, which requires
103 # it) here, since softpipe/llvmpipe can't be built alongside classic
104 # swrast.
105 #
106 # Putting glvnd here is arbitrary, but we want it in one of the builds
107 # for coverage.
108 meson-swr-glvnd:
109 extends: .meson-build
110 variables:
111 UNWIND: "true"
112 DRI_LOADERS: >
113 -D glvnd=true
114 -D egl=true
115 GALLIUM_ST: >
116 -D dri3=true
117 -D gallium-vdpau=false
118 -D gallium-xvmc=false
119 -D gallium-omx=disabled
120 -D gallium-va=false
121 -D gallium-xa=false
122 -D gallium-nine=true
123 -D gallium-opencl=disabled
124 -D osmesa=gallium
125 GALLIUM_DRIVERS: "swr,swrast,iris"
126 LLVM_VERSION: "6.0"
127
128 meson-clang:
129 extends: .meson-build
130 variables:
131 UNWIND: "true"
132 DRI_DRIVERS: "auto"
133 GALLIUM_DRIVERS: "auto"
134 VULKAN_DRIVERS: intel,amd,freedreno
135 CC: "ccache clang-8"
136 CXX: "ccache clang++-8"
137 before_script:
138 - export CCACHE_BASEDIR="$PWD" CCACHE_DIR="$PWD/ccache"
139 - ccache --zero-stats --show-stats || true
140 # clang++ breaks if it picks up the GCC 8 directory without libstdc++.so
141 - apt-get remove -y libgcc-8-dev
142
143 scons-swr:
144 extends: .scons-build
145 variables:
146 SCONS_TARGET: "swr=1"
147 SCONS_CHECK_COMMAND: "true"
148 LLVM_VERSION: "6.0"
149
150 scons-win64:
151 extends: .scons-build
152 variables:
153 SCONS_TARGET: platform=windows machine=x86_64
154 SCONS_CHECK_COMMAND: "true"
155
156 meson-main:
157 extends: .meson-build
158 variables:
159 UNWIND: "true"
160 DRI_LOADERS: >
161 -D glx=dri
162 -D gbm=true
163 -D egl=true
164 -D platforms=x11,wayland,drm,surfaceless
165 -D osmesa=classic
166 DRI_DRIVERS: "i915,i965,r100,r200,swrast,nouveau"
167 GALLIUM_ST: >
168 -D dri3=true
169 -D gallium-extra-hud=true
170 -D gallium-vdpau=true
171 -D gallium-xvmc=true
172 -D gallium-omx=bellagio
173 -D gallium-va=true
174 -D gallium-xa=true
175 -D gallium-nine=false
176 -D gallium-opencl=disabled
177 GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,svga,v3d,vc4,virgl,etnaviv,panfrost,lima"
178 LLVM_VERSION: "7"
179 EXTRA_OPTION: >
180 -D tools=all
181
182 meson-clover:
183 extends: .meson-build
184 variables:
185 UNWIND: "true"
186 DRI_LOADERS: >
187 -D glx=disabled
188 -D egl=false
189 -D gbm=false
190 GALLIUM_ST: >
191 -D dri3=false
192 -D gallium-vdpau=false
193 -D gallium-xvmc=false
194 -D gallium-omx=disabled
195 -D gallium-va=false
196 -D gallium-xa=false
197 -D gallium-nine=false
198 -D gallium-opencl=icd
199 script:
200 - export GALLIUM_DRIVERS="r600,radeonsi"
201 - .gitlab-ci/meson-build.sh
202 - LLVM_VERSION=7 .gitlab-ci/meson-build.sh
203 - export GALLIUM_DRIVERS="i915,r600"
204 - LLVM_VERSION=3.9 .gitlab-ci/meson-build.sh
205 - LLVM_VERSION=4.0 .gitlab-ci/meson-build.sh
206 - LLVM_VERSION=5.0 .gitlab-ci/meson-build.sh
207 - LLVM_VERSION=6.0 .gitlab-ci/meson-build.sh
208
209 meson-vulkan:
210 extends: .meson-build
211 variables:
212 UNWIND: "false"
213 DRI_LOADERS: >
214 -D glx=disabled
215 -D gbm=false
216 -D egl=false
217 -D platforms=x11,wayland,drm
218 -D osmesa=none
219 GALLIUM_ST: >
220 -D dri3=true
221 -D gallium-vdpau=false
222 -D gallium-xvmc=false
223 -D gallium-omx=disabled
224 -D gallium-va=false
225 -D gallium-xa=false
226 -D gallium-nine=false
227 -D gallium-opencl=disabled
228 VULKAN_DRIVERS: intel,amd,freedreno
229 LLVM_VERSION: "7"
230 EXTRA_OPTION: >
231 -D vulkan-overlay-layer=true
232
233 .meson-cross:
234 extends: .meson-build
235 variables:
236 UNWIND: "false"
237 DRI_LOADERS: >
238 -D glx=disabled
239 -D gbm=false
240 -D egl=false
241 -D platforms=surfaceless
242 -D osmesa=none
243 GALLIUM_ST: >
244 -D dri3=false
245 -D gallium-vdpau=false
246 -D gallium-xvmc=false
247 -D gallium-omx=disabled
248 -D gallium-va=false
249 -D gallium-xa=false
250 -D gallium-nine=false
251 -D llvm=false
252 CROSS: >
253 --cross /tmp/cross_file.txt
254
255 script:
256 - /usr/share/meson/debcrossgen --arch ${ARCH} -o /tmp/cross_file.txt
257 # Work around a bug in debcrossgen that should be fixed in the next release
258 - sed -i "s|cpu_family = 'i686'|cpu_family = 'x86'|g" /tmp/cross_file.txt
259 - .gitlab-ci/meson-build.sh
260
261 meson-armhf:
262 extends: .meson-cross
263 variables:
264 ARCH: armhf
265 VULKAN_DRIVERS: freedreno
266 GALLIUM_DRIVERS: "etnaviv,freedreno,kmsro,lima,nouveau,panfrost,tegra,v3d,vc4"
267 # Disable the tests since we're cross compiling.
268 EXTRA_OPTION: >
269 -D build-tests=false
270 -D I-love-half-baked-turnips=true
271 -D vulkan-overlay-layer=true
272
273 meson-arm64:
274 extends: .meson-cross
275 variables:
276 ARCH: arm64
277 VULKAN_DRIVERS: freedreno
278 GALLIUM_DRIVERS: "etnaviv,freedreno,kmsro,lima,nouveau,panfrost,tegra,v3d,vc4"
279 # Disable the tests since we're cross compiling.
280 EXTRA_OPTION: >
281 -D build-tests=false
282 -D I-love-half-baked-turnips=true
283 -D vulkan-overlay-layer=true
284
285 meson-i386:
286 extends: .meson-cross
287 variables:
288 ARCH: i386
289 VULKAN_DRIVERS: intel
290 GALLIUM_DRIVERS: "swrast"
291 # Disable i386 tests, because u_format_tests gets precision
292 # failures in dxtn unpacking
293 EXTRA_OPTION: >
294 -D build-tests=false
295 -D vulkan-overlay-layer=true
296
297 scons-nollvm:
298 extends: .scons-build
299 variables:
300 SCONS_TARGET: "llvm=0"
301 SCONS_CHECK_COMMAND: "scons llvm=0 check"
302
303 scons-llvm:
304 extends: .scons-build
305 variables:
306 SCONS_TARGET: "llvm=1"
307 SCONS_CHECK_COMMAND: "scons llvm=1 check"
308 LLVM_VERSION: "3.4"
309 # LLVM 3.4 packages were built with an old libstdc++ ABI
310 CXX: "g++ -D_GLIBCXX_USE_CXX11_ABI=0"