]> git.ipfire.org Git - thirdparty/u-boot.git/blob - .gitlab-ci.yml
Merge tag 'u-boot-amlogic-20200727' of https://gitlab.denx.de/u-boot/custodians/u...
[thirdparty/u-boot.git] / .gitlab-ci.yml
1 # SPDX-License-Identifier: GPL-2.0+
2
3 # Grab our configured image. The source for this is found at:
4 # https://gitlab.denx.de/u-boot/gitlab-ci-runner
5 image: trini/u-boot-gitlab-ci-runner:bionic-20200526-18Jun2020
6
7 # We run some tests in different order, to catch some failures quicker.
8 stages:
9 - testsuites
10 - test.py
11 - world build
12
13 .buildman_and_testpy_template: &buildman_and_testpy_dfn
14 tags: [ 'all' ]
15 stage: test.py
16 before_script:
17 # Clone uboot-test-hooks
18 - git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
19 - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
20 - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
21 - grub-mkimage --prefix="" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
22 - grub-mkimage --prefix="" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
23 - if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
24 wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
25 export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
26 fi
27 - if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
28 wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
29 export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
30 fi
31
32 after_script:
33 - rm -rf /tmp/uboot-test-hooks /tmp/venv
34 script:
35 # If we've been asked to use clang only do one configuration.
36 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD}
37 - tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
38 --board ${TEST_PY_BD} ${OVERRIDE}
39 - cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/
40 - cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/
41 - cp /opt/grub/grubriscv64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv64.efi
42 - cp /opt/grub/grubriscv32.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv32.efi
43 - cp /opt/grub/grubaa64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi
44 - cp /opt/grub/grubarm.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi
45 - virtualenv -p /usr/bin/python3 /tmp/venv
46 - . /tmp/venv/bin/activate
47 - pip install -r test/py/requirements.txt
48 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
49 - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
50 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
51 ./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID}
52 ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
53 --build-dir "$UBOOT_TRAVIS_BUILD_DIR"
54
55 build all 32bit ARM platforms:
56 tags: [ 'all' ]
57 stage: world build
58 script:
59 - ret=0;
60 ./tools/buildman/buildman -o /tmp -P -E -W arm -x aarch64 || ret=$?;
61 if [[ $ret -ne 0 ]]; then
62 ./tools/buildman/buildman -o /tmp -seP;
63 exit $ret;
64 fi;
65
66 build all 64bit ARM platforms:
67 tags: [ 'all' ]
68 stage: world build
69 script:
70 - virtualenv -p /usr/bin/python3 /tmp/venv
71 - . /tmp/venv/bin/activate
72 - pip install pyelftools
73 - ret=0;
74 ./tools/buildman/buildman -o /tmp -P -E -W aarch64 || ret=$?;
75 if [[ $ret -ne 0 ]]; then
76 ./tools/buildman/buildman -o /tmp -seP;
77 exit $ret;
78 fi;
79
80 build all PowerPC platforms:
81 tags: [ 'all' ]
82 stage: world build
83 script:
84 - ret=0;
85 ./tools/buildman/buildman -o /tmp -P -E -W powerpc || ret=$?;
86 if [[ $ret -ne 0 ]]; then
87 ./tools/buildman/buildman -o /tmp -seP;
88 exit $ret;
89 fi;
90
91 build all other platforms:
92 tags: [ 'all' ]
93 stage: world build
94 script:
95 - ret=0;
96 ./tools/buildman/buildman -o /tmp -P -E -W -x arm,powerpc || ret=$?;
97 if [[ $ret -ne 0 ]]; then
98 ./tools/buildman/buildman -o /tmp -seP;
99 exit $ret;
100 fi;
101
102 # QA jobs for code analytics
103 # static code analysis with cppcheck (we can add --enable=all later)
104 cppcheck:
105 tags: [ 'all' ]
106 stage: testsuites
107 script:
108 - cppcheck -j$(nproc) --force --quiet --inline-suppr .
109
110 # search for TODO within source tree
111 grep TODO/FIXME/HACK:
112 tags: [ 'all' ]
113 stage: testsuites
114 script:
115 - grep -r TODO .
116 - grep -r FIXME .
117 # search for HACK within source tree and ignore HACKKIT board
118 - grep -r HACK . | grep -v HACKKIT
119
120 # build HTML documentation
121 htmldocs:
122 tags: [ 'all' ]
123 stage: testsuites
124 script:
125 - make htmldocs
126
127 # some statistics about the code base
128 sloccount:
129 tags: [ 'all' ]
130 stage: testsuites
131 script:
132 - sloccount .
133
134 # ensure all configs have MAINTAINERS entries
135 Check for configs without MAINTAINERS entry:
136 tags: [ 'all' ]
137 stage: testsuites
138 script:
139 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
140
141 # Ensure host tools build
142 Build tools-only:
143 tags: [ 'all' ]
144 stage: testsuites
145 script:
146 - make tools-only_config tools-only -j$(nproc)
147
148 # Ensure env tools build
149 Build envtools:
150 tags: [ 'all' ]
151 stage: testsuites
152 script:
153 - make tools-only_config envtools -j$(nproc)
154
155 Run binman, buildman, dtoc, Kconfig and patman testsuites:
156 tags: [ 'all' ]
157 stage: testsuites
158 script:
159 - git config --global user.name "GitLab CI Runner";
160 git config --global user.email trini@konsulko.com;
161 export USER=gitlab;
162 virtualenv -p /usr/bin/python3 /tmp/venv;
163 . /tmp/venv/bin/activate;
164 pip install pyelftools pytest;
165 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
166 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
167 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
168 ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl;
169 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
170 ./tools/buildman/buildman -t;
171 ./tools/dtoc/dtoc -t;
172 ./tools/patman/patman test;
173 make testconfig
174
175 Run tests for Nokia RX-51 (aka N900):
176 tags: [ 'all' ]
177 stage: testsuites
178 script:
179 - ./tools/buildman/buildman --fetch-arch arm;
180 export PATH=~/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/:$PATH;
181 test/nokia_rx51_test.sh
182
183 # Test sandbox with test.py
184 sandbox test.py:
185 tags: [ 'all' ]
186 variables:
187 TEST_PY_BD: "sandbox"
188 <<: *buildman_and_testpy_dfn
189
190 sandbox with clang test.py:
191 tags: [ 'all' ]
192 variables:
193 TEST_PY_BD: "sandbox"
194 OVERRIDE: "-O clang-10"
195 <<: *buildman_and_testpy_dfn
196
197 sandbox_spl test.py:
198 tags: [ 'all' ]
199 variables:
200 TEST_PY_BD: "sandbox_spl"
201 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff"
202 <<: *buildman_and_testpy_dfn
203
204 evb-ast2500 test.py:
205 tags: [ 'all' ]
206 variables:
207 TEST_PY_BD: "evb-ast2500"
208 TEST_PY_ID: "--id qemu"
209 <<: *buildman_and_testpy_dfn
210
211 sandbox_flattree test.py:
212 tags: [ 'all' ]
213 variables:
214 TEST_PY_BD: "sandbox_flattree"
215 <<: *buildman_and_testpy_dfn
216
217 vexpress_ca15_tc2 test.py:
218 tags: [ 'all' ]
219 variables:
220 TEST_PY_BD: "vexpress_ca15_tc2"
221 TEST_PY_ID: "--id qemu"
222 <<: *buildman_and_testpy_dfn
223
224 vexpress_ca9x4 test.py:
225 tags: [ 'all' ]
226 variables:
227 TEST_PY_BD: "vexpress_ca9x4"
228 TEST_PY_ID: "--id qemu"
229 <<: *buildman_and_testpy_dfn
230
231 integratorcp_cm926ejs test.py:
232 tags: [ 'all' ]
233 variables:
234 TEST_PY_BD: "integratorcp_cm926ejs"
235 TEST_PY_TEST_SPEC: "not sleep"
236 TEST_PY_ID: "--id qemu"
237 <<: *buildman_and_testpy_dfn
238
239 qemu_arm test.py:
240 tags: [ 'all' ]
241 variables:
242 TEST_PY_BD: "qemu_arm"
243 TEST_PY_TEST_SPEC: "not sleep"
244 <<: *buildman_and_testpy_dfn
245
246 qemu_arm64 test.py:
247 tags: [ 'all' ]
248 variables:
249 TEST_PY_BD: "qemu_arm64"
250 TEST_PY_TEST_SPEC: "not sleep"
251 <<: *buildman_and_testpy_dfn
252
253 qemu_mips test.py:
254 tags: [ 'all' ]
255 variables:
256 TEST_PY_BD: "qemu_mips"
257 TEST_PY_TEST_SPEC: "not sleep"
258 <<: *buildman_and_testpy_dfn
259
260 qemu_mipsel test.py:
261 tags: [ 'all' ]
262 variables:
263 TEST_PY_BD: "qemu_mipsel"
264 TEST_PY_TEST_SPEC: "not sleep"
265 <<: *buildman_and_testpy_dfn
266
267 qemu_mips64 test.py:
268 tags: [ 'all' ]
269 variables:
270 TEST_PY_BD: "qemu_mips64"
271 TEST_PY_TEST_SPEC: "not sleep"
272 <<: *buildman_and_testpy_dfn
273
274 qemu_mips64el test.py:
275 tags: [ 'all' ]
276 variables:
277 TEST_PY_BD: "qemu_mips64el"
278 TEST_PY_TEST_SPEC: "not sleep"
279 <<: *buildman_and_testpy_dfn
280
281 qemu_malta test.py:
282 tags: [ 'all' ]
283 variables:
284 TEST_PY_BD: "malta"
285 TEST_PY_TEST_SPEC: "not sleep and not efi"
286 TEST_PY_ID: "--id qemu"
287 <<: *buildman_and_testpy_dfn
288
289 qemu_maltael test.py:
290 tags: [ 'all' ]
291 variables:
292 TEST_PY_BD: "maltael"
293 TEST_PY_TEST_SPEC: "not sleep and not efi"
294 TEST_PY_ID: "--id qemu"
295 <<: *buildman_and_testpy_dfn
296
297 qemu_malta64 test.py:
298 tags: [ 'all' ]
299 variables:
300 TEST_PY_BD: "malta64"
301 TEST_PY_TEST_SPEC: "not sleep and not efi"
302 TEST_PY_ID: "--id qemu"
303 <<: *buildman_and_testpy_dfn
304
305 qemu_malta64el test.py:
306 tags: [ 'all' ]
307 variables:
308 TEST_PY_BD: "malta64el"
309 TEST_PY_TEST_SPEC: "not sleep and not efi"
310 TEST_PY_ID: "--id qemu"
311 <<: *buildman_and_testpy_dfn
312
313 qemu-ppce500 test.py:
314 tags: [ 'all' ]
315 variables:
316 TEST_PY_BD: "qemu-ppce500"
317 TEST_PY_TEST_SPEC: "not sleep"
318 <<: *buildman_and_testpy_dfn
319
320 qemu-riscv32 test.py:
321 tags: [ 'all' ]
322 variables:
323 TEST_PY_BD: "qemu-riscv32"
324 TEST_PY_TEST_SPEC: "not sleep"
325 <<: *buildman_and_testpy_dfn
326
327 qemu-riscv64 test.py:
328 tags: [ 'all' ]
329 variables:
330 TEST_PY_BD: "qemu-riscv64"
331 TEST_PY_TEST_SPEC: "not sleep"
332 <<: *buildman_and_testpy_dfn
333
334 qemu-riscv32_spl test.py:
335 tags: [ 'all' ]
336 variables:
337 TEST_PY_BD: "qemu-riscv32_spl"
338 TEST_PY_TEST_SPEC: "not sleep"
339 <<: *buildman_and_testpy_dfn
340
341 qemu-riscv64_spl test.py:
342 tags: [ 'all' ]
343 variables:
344 TEST_PY_BD: "qemu-riscv64_spl"
345 TEST_PY_TEST_SPEC: "not sleep"
346 <<: *buildman_and_testpy_dfn
347
348 qemu-x86 test.py:
349 tags: [ 'all' ]
350 variables:
351 TEST_PY_BD: "qemu-x86"
352 TEST_PY_TEST_SPEC: "not sleep"
353 <<: *buildman_and_testpy_dfn
354
355 qemu-x86_64 test.py:
356 tags: [ 'all' ]
357 variables:
358 TEST_PY_BD: "qemu-x86_64"
359 TEST_PY_TEST_SPEC: "not sleep"
360 <<: *buildman_and_testpy_dfn
361
362 xilinx_zynq_virt test.py:
363 tags: [ 'all' ]
364 variables:
365 TEST_PY_BD: "xilinx_zynq_virt"
366 TEST_PY_TEST_SPEC: "not sleep"
367 TEST_PY_ID: "--id qemu"
368 <<: *buildman_and_testpy_dfn
369
370 xilinx_versal_virt test.py:
371 tags: [ 'all' ]
372 variables:
373 TEST_PY_BD: "xilinx_versal_virt"
374 TEST_PY_TEST_SPEC: "not sleep"
375 TEST_PY_ID: "--id qemu"
376 <<: *buildman_and_testpy_dfn
377
378 xtfpga test.py:
379 tags: [ 'all' ]
380 variables:
381 TEST_PY_BD: "xtfpga"
382 TEST_PY_TEST_SPEC: "not sleep"
383 TEST_PY_ID: "--id qemu"
384 <<: *buildman_and_testpy_dfn