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 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD}
43 tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E
44 --board ${TEST_PY_BD} ${OVERRIDE} || ret=$?;
45 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
46 tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -se
47 --board ${TEST_PY_BD};
50 - virtualenv -p /usr/bin/python3 /tmp/venv
51 - . /tmp/venv/bin/activate
52 - pip install -r test/py/requirements.txt
53 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
54 - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
55 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
56 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
57 ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
58 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
60 if [[ $ret -ne 0 ]]; then
64 build all 32bit ARM platforms:
69 ./tools/buildman/buildman -o /tmp -P -E arm -x aarch64 || ret=$?;
70 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
71 ./tools/buildman/buildman -o /tmp -seP;
75 build all 64bit ARM platforms:
79 - virtualenv -p /usr/bin/python3 /tmp/venv
80 - . /tmp/venv/bin/activate
81 - pip install pyelftools
83 ./tools/buildman/buildman -o /tmp -P -E aarch64 || ret=$?;
84 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
85 ./tools/buildman/buildman -o /tmp -seP;
89 build all PowerPC platforms:
94 ./tools/buildman/buildman -o /tmp -P -E powerpc || ret=$?;
95 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
96 ./tools/buildman/buildman -o /tmp -seP;
100 build all other platforms:
105 ./tools/buildman/buildman -o /tmp -P -E -x arm,powerpc || ret=$?;
106 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
107 ./tools/buildman/buildman -o /tmp -seP;
111 # QA jobs for code analytics
112 # static code analysis with cppcheck (we can add --enable=all later)
117 - cppcheck --force --quiet --inline-suppr .
119 # search for TODO within source tree
120 grep TODO/FIXME/HACK:
126 # search for HACK within source tree and ignore HACKKIT board
127 - grep -r HACK . | grep -v HACKKIT
129 # build HTML documentation
136 # some statistics about the code base
143 # ensure all configs have MAINTAINERS entries
144 Check for configs without MAINTAINERS entry:
148 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
150 # Ensure host tools build
155 - make tools-only_config tools-only -j$(nproc)
157 # Ensure env tools build
162 - make tools-only_config envtools -j$(nproc)
164 Run binman, buildman, dtoc, Kconfig and patman testsuites:
168 - git config --global user.name "GitLab CI Runner";
169 git config --global user.email trini@konsulko.com;
171 virtualenv -p /usr/bin/python3 /tmp/venv;
172 . /tmp/venv/bin/activate;
173 pip install pyelftools pytest;
174 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
175 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
176 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
177 ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl;
178 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
179 ./tools/buildman/buildman -t;
180 ./tools/dtoc/dtoc -t;
181 ./tools/patman/patman --test;
184 # Test sandbox with test.py
188 TEST_PY_BD: "sandbox"
189 <<: *buildman_and_testpy_dfn
191 sandbox with clang test.py:
194 TEST_PY_BD: "sandbox"
195 OVERRIDE: "-O clang-7"
196 <<: *buildman_and_testpy_dfn
201 TEST_PY_BD: "sandbox_spl"
202 TEST_PY_TEST_SPEC: "test_ofplatdata"
203 <<: *buildman_and_testpy_dfn
208 TEST_PY_BD: "evb-ast2500"
209 TEST_PY_ID: "--id qemu"
210 <<: *buildman_and_testpy_dfn
212 sandbox_flattree test.py:
215 TEST_PY_BD: "sandbox_flattree"
216 <<: *buildman_and_testpy_dfn
218 vexpress_ca15_tc2 test.py:
221 TEST_PY_BD: "vexpress_ca15_tc2"
222 TEST_PY_ID: "--id qemu"
223 <<: *buildman_and_testpy_dfn
225 vexpress_ca9x4 test.py:
228 TEST_PY_BD: "vexpress_ca9x4"
229 TEST_PY_ID: "--id qemu"
230 <<: *buildman_and_testpy_dfn
232 integratorcp_cm926ejs test.py:
235 TEST_PY_BD: "integratorcp_cm926ejs"
236 TEST_PY_TEST_SPEC: "not sleep"
237 TEST_PY_ID: "--id qemu"
238 <<: *buildman_and_testpy_dfn
243 TEST_PY_BD: "qemu_arm"
244 TEST_PY_TEST_SPEC: "not sleep"
245 <<: *buildman_and_testpy_dfn
250 TEST_PY_BD: "qemu_arm64"
251 TEST_PY_TEST_SPEC: "not sleep"
252 <<: *buildman_and_testpy_dfn
257 TEST_PY_BD: "qemu_mips"
258 TEST_PY_TEST_SPEC: "not sleep"
259 <<: *buildman_and_testpy_dfn
264 TEST_PY_BD: "qemu_mipsel"
265 TEST_PY_TEST_SPEC: "not sleep"
266 <<: *buildman_and_testpy_dfn
271 TEST_PY_BD: "qemu_mips64"
272 TEST_PY_TEST_SPEC: "not sleep"
273 <<: *buildman_and_testpy_dfn
275 qemu_mips64el test.py:
278 TEST_PY_BD: "qemu_mips64el"
279 TEST_PY_TEST_SPEC: "not sleep"
280 <<: *buildman_and_testpy_dfn
282 qemu-ppce500 test.py:
285 TEST_PY_BD: "qemu-ppce500"
286 TEST_PY_TEST_SPEC: "not sleep"
287 <<: *buildman_and_testpy_dfn
289 qemu-riscv32 test.py:
292 TEST_PY_BD: "qemu-riscv32"
293 TEST_PY_TEST_SPEC: "not sleep"
294 <<: *buildman_and_testpy_dfn
296 qemu-riscv64 test.py:
299 TEST_PY_BD: "qemu-riscv64"
300 TEST_PY_TEST_SPEC: "not sleep"
301 <<: *buildman_and_testpy_dfn
303 qemu-riscv32_spl test.py:
306 TEST_PY_BD: "qemu-riscv32_spl"
307 TEST_PY_TEST_SPEC: "not sleep"
308 <<: *buildman_and_testpy_dfn
310 qemu-riscv64_spl test.py:
313 TEST_PY_BD: "qemu-riscv64_spl"
314 TEST_PY_TEST_SPEC: "not sleep"
315 <<: *buildman_and_testpy_dfn
320 TEST_PY_BD: "qemu-x86"
321 TEST_PY_TEST_SPEC: "not sleep"
322 <<: *buildman_and_testpy_dfn
327 TEST_PY_BD: "qemu-x86_64"
328 TEST_PY_TEST_SPEC: "not sleep"
329 <<: *buildman_and_testpy_dfn
331 xilinx_zynq_virt test.py:
334 TEST_PY_BD: "xilinx_zynq_virt"
335 TEST_PY_TEST_SPEC: "not sleep"
336 TEST_PY_ID: "--id qemu"
337 <<: *buildman_and_testpy_dfn
339 xilinx_versal_virt test.py:
342 TEST_PY_BD: "xilinx_versal_virt"
343 TEST_PY_TEST_SPEC: "not sleep"
344 TEST_PY_ID: "--id qemu"
345 <<: *buildman_and_testpy_dfn
351 TEST_PY_TEST_SPEC: "not sleep"
352 TEST_PY_ID: "--id qemu"
353 <<: *buildman_and_testpy_dfn