1 # SPDX-License-Identifier: GPL-2.0+
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-20200311-10Apr2020
7 # We run some tests in different order, to catch some failures quicker.
13 .buildman_and_testpy_template: &buildman_and_testpy_dfn
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 - cp /opt/grub/grubriscv64.efi ~/grub_riscv64.efi
24 - cp /opt/grub/grubriscv32.efi ~/grub_riscv32.efi
25 - cp /opt/grub/grubaa64.efi ~/grub_arm64.efi
26 - cp /opt/grub/grubarm.efi ~/grub_arm.efi
27 - if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
28 wget -O - https://github.com/riscv/opensbi/releases/download/v0.6/opensbi-0.6-rv32-bin.tar.xz | tar -C /tmp -xJ;
29 export OPENSBI=/tmp/opensbi-0.6-rv32-bin/platform/qemu/virt/firmware/fw_dynamic.bin;
31 - if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
32 wget -O - https://github.com/riscv/opensbi/releases/download/v0.6/opensbi-0.6-rv64-bin.tar.xz | tar -C /tmp -xJ;
33 export OPENSBI=/tmp/opensbi-0.6-rv64-bin/platform/qemu/virt/firmware/fw_dynamic.bin;
37 - rm -rf /tmp/uboot-test-hooks /tmp/venv
39 # From buildman, exit code 129 means warnings only. If we've been asked to
40 # use clang only do one configuration.
41 - if [[ "${BUILDMAN}" != "" ]]; then
43 tools/buildman/buildman -o /tmp -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
44 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
45 tools/buildman/buildman -o /tmp -sdeP ${BUILDMAN};
49 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
50 # never prevent any test from running. That way, we can always pass
51 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
53 - virtualenv -p /usr/bin/python3 /tmp/venv
54 - . /tmp/venv/bin/activate
55 - pip install -r test/py/requirements.txt
56 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/${TEST_PY_BD};
57 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
58 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
59 if [[ "${TEST_PY_BD}" != "" ]]; then
60 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
61 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
62 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
64 if [[ $ret -ne 0 ]]; then
69 build all 32bit ARM platforms:
74 ./tools/buildman/buildman -o /tmp -P -E arm -x aarch64 || ret=$?;
75 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
76 ./tools/buildman/buildman -o /tmp -sdeP;
80 build all 64bit ARM platforms:
84 - virtualenv -p /usr/bin/python3 /tmp/venv
85 - . /tmp/venv/bin/activate
86 - pip install pyelftools
88 ./tools/buildman/buildman -o /tmp -P -E aarch64 || ret=$?;
89 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
90 ./tools/buildman/buildman -o /tmp -sdeP;
94 build all PowerPC platforms:
99 ./tools/buildman/buildman -o /tmp -P -E powerpc || ret=$?;
100 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
101 ./tools/buildman/buildman -o /tmp -sdeP;
105 build all other platforms:
110 ./tools/buildman/buildman -o /tmp -P -E -x arm,powerpc || ret=$?;
111 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
112 ./tools/buildman/buildman -o /tmp -sdeP;
116 # QA jobs for code analytics
117 # static code analysis with cppcheck (we can add --enable=all later)
122 - cppcheck --force --quiet --inline-suppr .
124 # search for TODO within source tree
125 grep TODO/FIXME/HACK:
131 # search for HACK within source tree and ignore HACKKIT board
132 - grep -r HACK . | grep -v HACKKIT
134 # build HTML documentation
141 # some statistics about the code base
148 # ensure all configs have MAINTAINERS entries
149 Check for configs without MAINTAINERS entry:
153 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
155 # Ensure host tools build
160 - make tools-only_config tools-only -j$(nproc)
162 # Ensure env tools build
167 - make tools-only_config envtools -j$(nproc)
169 Run binman, buildman, dtoc, Kconfig and patman testsuites:
173 - git config --global user.name "GitLab CI Runner";
174 git config --global user.email trini@konsulko.com;
176 virtualenv -p /usr/bin/python3 /tmp/venv;
177 . /tmp/venv/bin/activate;
178 pip install pyelftools pytest;
179 export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/sandbox_spl;
180 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
181 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
182 ./tools/buildman/buildman -o /tmp -P sandbox_spl;
183 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
184 ./tools/buildman/buildman -t;
185 ./tools/dtoc/dtoc -t;
186 ./tools/patman/patman --test;
189 # Test sandbox with test.py
193 TEST_PY_BD: "sandbox"
194 BUILDMAN: "^sandbox$"
195 <<: *buildman_and_testpy_dfn
197 sandbox with clang test.py:
200 TEST_PY_BD: "sandbox"
201 BUILDMAN: "^sandbox$"
202 OVERRIDE: "-O clang-7"
203 <<: *buildman_and_testpy_dfn
208 TEST_PY_BD: "sandbox_spl"
209 BUILDMAN: "^sandbox_spl$"
210 TEST_PY_TEST_SPEC: "test_ofplatdata"
211 <<: *buildman_and_testpy_dfn
216 TEST_PY_BD: "evb-ast2500"
217 TEST_PY_ID: "--id qemu"
218 BUILDMAN: "^evb-ast2500$"
219 <<: *buildman_and_testpy_dfn
221 sandbox_flattree test.py:
224 TEST_PY_BD: "sandbox_flattree"
225 BUILDMAN: "^sandbox_flattree$"
226 <<: *buildman_and_testpy_dfn
228 vexpress_ca15_tc2 test.py:
231 TEST_PY_BD: "vexpress_ca15_tc2"
232 TEST_PY_ID: "--id qemu"
233 BUILDMAN: "^vexpress_ca15_tc2$"
234 <<: *buildman_and_testpy_dfn
236 vexpress_ca9x4 test.py:
239 TEST_PY_BD: "vexpress_ca9x4"
240 TEST_PY_ID: "--id qemu"
241 BUILDMAN: "^vexpress_ca9x4$"
242 <<: *buildman_and_testpy_dfn
244 integratorcp_cm926ejs test.py:
247 TEST_PY_BD: "integratorcp_cm926ejs"
248 TEST_PY_TEST_SPEC: "not sleep"
249 TEST_PY_ID: "--id qemu"
250 BUILDMAN: "^integratorcp_cm926ejs$"
251 <<: *buildman_and_testpy_dfn
256 TEST_PY_BD: "qemu_arm"
257 TEST_PY_TEST_SPEC: "not sleep"
258 BUILDMAN: "^qemu_arm$"
259 <<: *buildman_and_testpy_dfn
264 TEST_PY_BD: "qemu_arm64"
265 TEST_PY_TEST_SPEC: "not sleep"
266 BUILDMAN: "^qemu_arm64$"
267 <<: *buildman_and_testpy_dfn
272 TEST_PY_BD: "qemu_mips"
273 TEST_PY_TEST_SPEC: "not sleep"
274 BUILDMAN: "^qemu_mips$"
275 <<: *buildman_and_testpy_dfn
280 TEST_PY_BD: "qemu_mipsel"
281 TEST_PY_TEST_SPEC: "not sleep"
282 BUILDMAN: "^qemu_mipsel$"
283 <<: *buildman_and_testpy_dfn
288 TEST_PY_BD: "qemu_mips64"
289 TEST_PY_TEST_SPEC: "not sleep"
290 BUILDMAN: "^qemu_mips64$"
291 <<: *buildman_and_testpy_dfn
293 qemu_mips64el test.py:
296 TEST_PY_BD: "qemu_mips64el"
297 TEST_PY_TEST_SPEC: "not sleep"
298 BUILDMAN: "^qemu_mips64el$"
299 <<: *buildman_and_testpy_dfn
301 qemu-ppce500 test.py:
304 TEST_PY_BD: "qemu-ppce500"
305 TEST_PY_TEST_SPEC: "not sleep"
306 BUILDMAN: "^qemu-ppce500$"
307 <<: *buildman_and_testpy_dfn
309 qemu-riscv32 test.py:
312 TEST_PY_BD: "qemu-riscv32"
313 TEST_PY_TEST_SPEC: "not sleep"
314 BUILDMAN: "^qemu-riscv32$"
315 <<: *buildman_and_testpy_dfn
317 qemu-riscv64 test.py:
320 TEST_PY_BD: "qemu-riscv64"
321 TEST_PY_TEST_SPEC: "not sleep"
322 BUILDMAN: "^qemu-riscv64$"
323 <<: *buildman_and_testpy_dfn
325 qemu-riscv32_spl test.py:
328 TEST_PY_BD: "qemu-riscv32_spl"
329 TEST_PY_TEST_SPEC: "not sleep"
330 BUILDMAN: "^qemu-riscv32_spl$"
331 <<: *buildman_and_testpy_dfn
333 qemu-riscv64_spl test.py:
336 TEST_PY_BD: "qemu-riscv64_spl"
337 TEST_PY_TEST_SPEC: "not sleep"
338 BUILDMAN: "^qemu-riscv64_spl$"
339 <<: *buildman_and_testpy_dfn
344 TEST_PY_BD: "qemu-x86"
345 TEST_PY_TEST_SPEC: "not sleep"
346 BUILDMAN: "^qemu-x86$"
347 <<: *buildman_and_testpy_dfn
352 TEST_PY_BD: "qemu-x86_64"
353 TEST_PY_TEST_SPEC: "not sleep"
354 BUILDMAN: "^qemu-x86_64$"
355 <<: *buildman_and_testpy_dfn
357 xilinx_zynq_virt test.py:
360 TEST_PY_BD: "xilinx_zynq_virt"
361 TEST_PY_TEST_SPEC: "not sleep"
362 TEST_PY_ID: "--id qemu"
363 BUILDMAN: "^xilinx_zynq_virt$"
364 <<: *buildman_and_testpy_dfn
366 xilinx_versal_virt test.py:
369 TEST_PY_BD: "xilinx_versal_virt"
370 TEST_PY_TEST_SPEC: "not sleep"
371 TEST_PY_ID: "--id qemu"
372 BUILDMAN: "^xilinx_versal_virt$"
373 <<: *buildman_and_testpy_dfn
379 TEST_PY_TEST_SPEC: "not sleep"
380 TEST_PY_ID: "--id qemu"
382 <<: *buildman_and_testpy_dfn