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 [[ "${TEST_PY_BD}" != "" ]]; then
43 tools/buildman/buildman -o /tmp -P -E --board ${TEST_PY_BD} ${OVERRIDE}
45 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
46 tools/buildman/buildman -o /tmp -seP --board ${TEST_PY_BD};
50 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
51 # never prevent any test from running. That way, we can always pass
52 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
54 - virtualenv -p /usr/bin/python3 /tmp/venv
55 - . /tmp/venv/bin/activate
56 - pip install -r test/py/requirements.txt
57 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/${TEST_PY_BD};
58 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
59 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
60 if [[ "${TEST_PY_BD}" != "" ]]; then
61 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
62 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
63 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
65 if [[ $ret -ne 0 ]]; then
70 build all 32bit ARM platforms:
75 ./tools/buildman/buildman -o /tmp -P -E arm -x aarch64 || ret=$?;
76 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
77 ./tools/buildman/buildman -o /tmp -seP;
81 build all 64bit ARM platforms:
85 - virtualenv -p /usr/bin/python3 /tmp/venv
86 - . /tmp/venv/bin/activate
87 - pip install pyelftools
89 ./tools/buildman/buildman -o /tmp -P -E aarch64 || ret=$?;
90 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
91 ./tools/buildman/buildman -o /tmp -seP;
95 build all PowerPC platforms:
100 ./tools/buildman/buildman -o /tmp -P -E powerpc || ret=$?;
101 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
102 ./tools/buildman/buildman -o /tmp -seP;
106 build all other platforms:
111 ./tools/buildman/buildman -o /tmp -P -E -x arm,powerpc || ret=$?;
112 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
113 ./tools/buildman/buildman -o /tmp -seP;
117 # QA jobs for code analytics
118 # static code analysis with cppcheck (we can add --enable=all later)
123 - cppcheck --force --quiet --inline-suppr .
125 # search for TODO within source tree
126 grep TODO/FIXME/HACK:
132 # search for HACK within source tree and ignore HACKKIT board
133 - grep -r HACK . | grep -v HACKKIT
135 # build HTML documentation
142 # some statistics about the code base
149 # ensure all configs have MAINTAINERS entries
150 Check for configs without MAINTAINERS entry:
154 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
156 # Ensure host tools build
161 - make tools-only_config tools-only -j$(nproc)
163 # Ensure env tools build
168 - make tools-only_config envtools -j$(nproc)
170 Run binman, buildman, dtoc, Kconfig and patman testsuites:
174 - git config --global user.name "GitLab CI Runner";
175 git config --global user.email trini@konsulko.com;
177 virtualenv -p /usr/bin/python3 /tmp/venv;
178 . /tmp/venv/bin/activate;
179 pip install pyelftools pytest;
180 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
181 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
182 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
183 ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl;
184 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
185 ./tools/buildman/buildman -t;
186 ./tools/dtoc/dtoc -t;
187 ./tools/patman/patman --test;
190 # Test sandbox with test.py
194 TEST_PY_BD: "sandbox"
195 <<: *buildman_and_testpy_dfn
197 sandbox with clang test.py:
200 TEST_PY_BD: "sandbox"
201 OVERRIDE: "-O clang-7"
202 <<: *buildman_and_testpy_dfn
207 TEST_PY_BD: "sandbox_spl"
208 TEST_PY_TEST_SPEC: "test_ofplatdata"
209 <<: *buildman_and_testpy_dfn
214 TEST_PY_BD: "evb-ast2500"
215 TEST_PY_ID: "--id qemu"
216 <<: *buildman_and_testpy_dfn
218 sandbox_flattree test.py:
221 TEST_PY_BD: "sandbox_flattree"
222 <<: *buildman_and_testpy_dfn
224 vexpress_ca15_tc2 test.py:
227 TEST_PY_BD: "vexpress_ca15_tc2"
228 TEST_PY_ID: "--id qemu"
229 <<: *buildman_and_testpy_dfn
231 vexpress_ca9x4 test.py:
234 TEST_PY_BD: "vexpress_ca9x4"
235 TEST_PY_ID: "--id qemu"
236 <<: *buildman_and_testpy_dfn
238 integratorcp_cm926ejs test.py:
241 TEST_PY_BD: "integratorcp_cm926ejs"
242 TEST_PY_TEST_SPEC: "not sleep"
243 TEST_PY_ID: "--id qemu"
244 <<: *buildman_and_testpy_dfn
249 TEST_PY_BD: "qemu_arm"
250 TEST_PY_TEST_SPEC: "not sleep"
251 <<: *buildman_and_testpy_dfn
256 TEST_PY_BD: "qemu_arm64"
257 TEST_PY_TEST_SPEC: "not sleep"
258 <<: *buildman_and_testpy_dfn
263 TEST_PY_BD: "qemu_mips"
264 TEST_PY_TEST_SPEC: "not sleep"
265 <<: *buildman_and_testpy_dfn
270 TEST_PY_BD: "qemu_mipsel"
271 TEST_PY_TEST_SPEC: "not sleep"
272 <<: *buildman_and_testpy_dfn
277 TEST_PY_BD: "qemu_mips64"
278 TEST_PY_TEST_SPEC: "not sleep"
279 <<: *buildman_and_testpy_dfn
281 qemu_mips64el test.py:
284 TEST_PY_BD: "qemu_mips64el"
285 TEST_PY_TEST_SPEC: "not sleep"
286 <<: *buildman_and_testpy_dfn
288 qemu-ppce500 test.py:
291 TEST_PY_BD: "qemu-ppce500"
292 TEST_PY_TEST_SPEC: "not sleep"
293 <<: *buildman_and_testpy_dfn
295 qemu-riscv32 test.py:
298 TEST_PY_BD: "qemu-riscv32"
299 TEST_PY_TEST_SPEC: "not sleep"
300 <<: *buildman_and_testpy_dfn
302 qemu-riscv64 test.py:
305 TEST_PY_BD: "qemu-riscv64"
306 TEST_PY_TEST_SPEC: "not sleep"
307 <<: *buildman_and_testpy_dfn
309 qemu-riscv32_spl test.py:
312 TEST_PY_BD: "qemu-riscv32_spl"
313 TEST_PY_TEST_SPEC: "not sleep"
314 <<: *buildman_and_testpy_dfn
316 qemu-riscv64_spl test.py:
319 TEST_PY_BD: "qemu-riscv64_spl"
320 TEST_PY_TEST_SPEC: "not sleep"
321 <<: *buildman_and_testpy_dfn
326 TEST_PY_BD: "qemu-x86"
327 TEST_PY_TEST_SPEC: "not sleep"
328 <<: *buildman_and_testpy_dfn
333 TEST_PY_BD: "qemu-x86_64"
334 TEST_PY_TEST_SPEC: "not sleep"
335 <<: *buildman_and_testpy_dfn
337 xilinx_zynq_virt test.py:
340 TEST_PY_BD: "xilinx_zynq_virt"
341 TEST_PY_TEST_SPEC: "not sleep"
342 TEST_PY_ID: "--id qemu"
343 <<: *buildman_and_testpy_dfn
345 xilinx_versal_virt test.py:
348 TEST_PY_BD: "xilinx_versal_virt"
349 TEST_PY_TEST_SPEC: "not sleep"
350 TEST_PY_ID: "--id qemu"
351 <<: *buildman_and_testpy_dfn
357 TEST_PY_TEST_SPEC: "not sleep"
358 TEST_PY_ID: "--id qemu"
359 <<: *buildman_and_testpy_dfn