gitlab-ci/lava: Add needs: for container image to test jobs
[mesa.git] / .gitlab-ci / lava-gitlab-ci.yml
1 variables:
2 LAVA_DEBIAN_VERSION: testing-slim
3 LAVA_IMAGE_TAG: "lava-2019-09-20-1"
4
5 include:
6 - project: 'wayland/ci-templates'
7 ref: 1f7f57c64ff4ebbf7292e3b7a13600518b8cb24c
8 file: '/templates/debian.yml'
9
10 # When to automatically run the CI
11 .ci-run-policy:
12 only:
13 - branches@mesa/mesa
14 - merge_requests
15 - /^ci([-/].*)?$/
16 retry:
17 max: 2
18 when:
19 - runner_system_failure
20
21 # Build Docker image with deqp, the rootfs and the build deps for Mesa
22 .lava-container:
23 extends:
24 - .debian@container-ifnot-exists
25 - .ci-run-policy
26 stage: containers
27 variables:
28 GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
29 DEBIAN_TAG: '${DEBIAN_ARCH}-${LAVA_IMAGE_TAG}'
30 DEBIAN_EXEC: 'DEBIAN_ARCH=${DEBIAN_ARCH}
31 GCC_ARCH=${GCC_ARCH}
32 KERNEL_ARCH=${KERNEL_ARCH}
33 VOLT_ARCH=${VOLT_ARCH}
34 DEFCONFIG=${DEFCONFIG}
35 DEVICE_TREES=${DEVICE_TREES}
36 KERNEL_IMAGE_NAME=${KERNEL_IMAGE_NAME}
37 bash .gitlab-ci/lava-debian-install.sh'
38 DEBIAN_VERSION: ${LAVA_DEBIAN_VERSION}
39
40 lava-container:armhf:
41 extends: .lava-container
42 variables:
43 DEBIAN_ARCH: "armhf"
44 GCC_ARCH: "arm-linux-gnueabihf"
45 KERNEL_ARCH: "arm"
46 VOLT_ARCH: "armhf"
47 DEFCONFIG: "arch/arm/configs/multi_v7_defconfig"
48 DEVICE_TREES: "arch/arm/boot/dts/rk3288-veyron-jaq.dtb"
49 KERNEL_IMAGE_NAME: "zImage"
50
51 lava-container:arm64:
52 extends: .lava-container
53 variables:
54 DEBIAN_ARCH: "arm64"
55 GCC_ARCH: "aarch64-linux-gnu"
56 KERNEL_ARCH: "arm64"
57 VOLT_ARCH: "aarch64"
58 DEFCONFIG: "arch/arm64/configs/defconfig"
59 DEVICE_TREES: "arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dtb"
60 KERNEL_IMAGE_NAME: "Image"
61
62 .lava-build:
63 stage: build
64 image: $CI_REGISTRY_IMAGE/debian/$LAVA_DEBIAN_VERSION:$DEBIAN_ARCH-$LAVA_IMAGE_TAG
65 extends:
66 - .ci-run-policy
67 cache:
68 key: ${CI_JOB_NAME}
69 paths:
70 - ccache
71 variables:
72 CCACHE_COMPILERCHECK: "content"
73 # Use ccache transparently, and print stats before/after
74 before_script:
75 - mkdir -p results mesa-build
76 - mkdir -p ccache
77 - export PATH="/usr/lib/ccache:$PATH"
78 - export CCACHE_BASEDIR="$PWD"
79 - export CCACHE_DIR="$PWD/ccache"
80 - ccache --max-size=1500M
81 - ccache --zero-stats || true
82 - ccache --show-stats || true
83 script:
84 # Build Mesa
85 - /usr/share/meson/debcrossgen --arch ${DEBIAN_ARCH} -o /tmp/cross_file.txt
86 - meson . mesa-build
87 --cross-file /tmp/cross_file.txt
88 --libdir /artifacts/rootfs/mesa/lib/
89 --buildtype debugoptimized
90 -D gallium-drivers=kmsro,panfrost
91 -D dri-drivers=
92 -D prefix=/artifacts/rootfs/mesa
93 -D glx=disabled
94 -D gbm=false
95 -D egl=true
96 -D platforms=surfaceless
97 -D osmesa=none
98 -D dri3=false
99 -D gallium-vdpau=false
100 -D gallium-xvmc=false
101 -D gallium-omx=disabled
102 -D gallium-va=false
103 -D gallium-xa=false
104 -D gallium-nine=false
105 -D llvm=false
106 - ninja -C mesa-build -j4
107 - ninja -C mesa-build install
108 - find /artifacts/rootfs/mesa/lib -name \*.so -exec ${GCC_ARCH}-strip {} \;
109
110 - du -sh /artifacts/rootfs/mesa/*
111 - rm -rf /artifacts/rootfs/mesa/include
112
113 # Pack rootfs
114 - cp .gitlab-ci/lava-deqp-runner.sh /artifacts/rootfs/deqp/.
115 - cp .gitlab-ci/deqp-*-fails.txt /artifacts/rootfs/deqp/.
116 - du -sh /artifacts/rootfs/deqp/*
117 - find /artifacts/rootfs/ -type f -printf "%s\t%p\n" | sort -n
118 - pushd /artifacts/rootfs/ ; find -H | cpio -H newc -v -o | gzip -c - > $CI_PROJECT_DIR/results/panfrost-rootfs-${DEBIAN_ARCH}.cpio.gz; popd
119
120 # Copy kernel and DT
121 - cp /artifacts/${KERNEL_IMAGE_NAME} /artifacts/*.dtb $CI_PROJECT_DIR/results/.
122
123 # Generate LAVA job
124 - cd $CI_PROJECT_DIR
125 - .gitlab-ci/generate_lava.py
126 --template .gitlab-ci/lava-deqp.yml.jinja2
127 --arch ${DEBIAN_ARCH}
128 --base-artifacts-url $CI_PROJECT_URL/-/jobs/$CI_JOB_ID/artifacts/raw/results
129 --device-type ${DEVICE_TYPE}
130 --kernel-image-name ${KERNEL_IMAGE_NAME}
131 --gpu-version ${GPU_VERSION}
132 > results/lava-deqp.yml
133 after_script:
134 - export CCACHE_DIR="$PWD/ccache"
135 - ccache --show-stats
136 artifacts:
137 when: always
138 paths:
139 - results/
140
141 lava-build:armhf:
142 extends: .lava-build
143 needs: ["lava-container:armhf"]
144 variables:
145 DEBIAN_ARCH: "armhf"
146 GCC_ARCH: "arm-linux-gnueabihf"
147 DEVICE_TYPE: "rk3288-veyron-jaq"
148 KERNEL_IMAGE_NAME: "zImage"
149 GPU_VERSION: "t760"
150
151 lava-build:arm64:
152 extends: .lava-build
153 needs: ["lava-container:arm64"]
154 variables:
155 DEBIAN_ARCH: "arm64"
156 GCC_ARCH: "aarch64-linux-gnu"
157 DEVICE_TYPE: "rk3399-gru-kevin"
158 KERNEL_IMAGE_NAME: "Image"
159 GPU_VERSION: "t860"
160
161 .lava-test:
162 stage: test
163 extends:
164 - .ci-run-policy
165 variables:
166 GIT_STRATEGY: none # no need to pull the whole tree for submitting the job
167 script:
168 - lava_job_id=`lavacli jobs submit $CI_PROJECT_DIR/results/lava-deqp.yml`
169 - echo $lava_job_id
170 - lavacli jobs logs $lava_job_id | grep -a -v "{'case':" | tee results/lava-deqp-$lava_job_id.log
171 - lavacli jobs show $lava_job_id
172 - result=`lavacli results $lava_job_id 0_deqp deqp | head -1`
173 - echo $result
174 - '[[ "$result" == "pass" ]]'
175 artifacts:
176 when: always
177 paths:
178 - results/
179
180 panfrost-t760-test:armhf:
181 image: $CI_REGISTRY_IMAGE/debian/$LAVA_DEBIAN_VERSION:armhf-$LAVA_IMAGE_TAG
182 extends: .lava-test
183 needs:
184 - lava-container:armhf
185 - lava-build:armhf
186 dependencies:
187 - lava-build:armhf
188 tags:
189 - lava-rk3288-veyron-jaq
190
191 panfrost-t860-test:arm64:
192 image: $CI_REGISTRY_IMAGE/debian/$LAVA_DEBIAN_VERSION:arm64-$LAVA_IMAGE_TAG
193 extends: .lava-test
194 needs:
195 - lava-container:arm64
196 - lava-build:arm64
197 dependencies:
198 - lava-build:arm64
199 tags:
200 - lava-rk3399-gru-kevin
201