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:xenial-20190720-24Jul2019
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 - virtualenv /tmp/venv
22 - . /tmp/venv/bin/activate
23 - pip install pytest==2.8.7
24 - pip install python-subunit
25 - grub-mkimage -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
26 - grub-mkimage -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
28 - ( cd ~/grub2-arm; wget -O - http://download.opensuse.org/ports/armv7hl/distribution/leap/42.2/repo/oss/suse/armv7hl/grub2-arm-efi-2.02~beta2-87.1.armv7hl.rpm | rpm2cpio | cpio -di )
30 - ( cd ~/grub2-arm64; wget -O - http://download.opensuse.org/ports/aarch64/distribution/leap/42.2/repo/oss/suse/aarch64/grub2-arm64-efi-2.02~beta2-87.1.aarch64.rpm | rpm2cpio | cpio -di )
31 - if [[ "${QEMU_TARGET}" != "" ]]; then
32 git clone git://git.qemu.org/qemu.git /tmp/qemu;
34 git submodule update --init dtc &&
35 git checkout ${QEMU_VERSION} &&
36 ./configure --prefix=/tmp/qemu-install --target-list=${QEMU_TARGET} &&
37 make -j$(nproc) all install;
41 - rm -rf ~/grub2* /tmp/uboot-test-hooks /tmp/qemu /tmp/venv
43 # From buildman, exit code 129 means warnings only. If we've been asked to
44 # use clang only do one configuration.
45 - if [[ "${BUILDMAN}" != "" ]]; then
47 tools/buildman/buildman -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
48 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
49 tools/buildman/buildman -sdeP ${BUILDMAN};
53 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
54 # never prevent any test from running. That way, we can always pass
55 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
57 - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
58 export PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin;
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 plaforms:
75 ./tools/buildman/buildman -P -E arm -x aarch64 || ret=$?;
76 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
77 ./tools/buildman/buildman -sdeP;
81 build all 64bit ARM plaforms:
85 - virtualenv /tmp/venv
86 - . /tmp/venv/bin/activate
87 - pip install pyelftools
89 ./tools/buildman/buildman -P -E aarch64 || ret=$?;
90 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
91 ./tools/buildman/buildman -sdeP;
95 build all PowerPC plaforms:
100 ./tools/buildman/buildman -P -E powerpc || ret=$?;
101 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
102 ./tools/buildman/buildman -sdeP;
106 build all other plaforms:
111 ./tools/buildman/buildman -P -E -x arm,powerpc || ret=$?;
112 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
113 ./tools/buildman/buildman -sdeP;
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 # some statistics about the code base
142 # ensure all configs have MAINTAINERS entries
143 Check for configs without MAINTAINERS entry:
147 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
149 # Ensure host tools build
154 - make tools-only_config tools-only -j$(nproc)
156 # Run various tool tests
157 Run patman testsuite:
161 - git config --global user.name "GitLab CI Runner"
162 - git config --global user.email trini@konsulko.com
163 - ./tools/patman/patman --test
165 Run buildman testsuite:
169 - ./tools/buildman/buildman -t
171 Run binman and dtoc testsuite:
175 - virtualenv /tmp/venv
176 - . /tmp/venv/bin/activate
177 - pip install pyelftools
178 - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/sandbox_spl;
179 ./tools/buildman/buildman -P sandbox_spl &&
180 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
181 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
182 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test &&
185 # Test sandbox with test.py
189 TEST_PY_BD: "sandbox"
190 BUILDMAN: "^sandbox$"
191 <<: *buildman_and_testpy_dfn
196 TEST_PY_BD: "sandbox_spl"
197 BUILDMAN: "^sandbox_spl$"
198 TEST_PY_TEST_SPEC: "test_ofplatdata"
199 <<: *buildman_and_testpy_dfn
204 TEST_PY_BD: "evb-ast2500"
205 TEST_PY_ID: "--id qemu"
206 QEMU_TARGET: "arm-softmmu"
207 QEMU_VERSION: "506179e42112be77bfd071f050b15762d3b2cd43"
208 BUILDMAN: "^evb-ast2500$"
209 <<: *buildman_and_testpy_dfn
211 sandbox_flattree test.py:
214 TEST_PY_BD: "sandbox_flattree"
215 BUILDMAN: "^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 QEMU_TARGET: "arm-softmmu"
224 QEMU_VERSION: "v3.0.0"
225 BUILDMAN: "^vexpress_ca15_tc2$"
226 <<: *buildman_and_testpy_dfn
228 vexpress_ca9x4 test.py:
231 TEST_PY_BD: "vexpress_ca9x4"
232 TEST_PY_ID: "--id qemu"
233 QEMU_TARGET: "arm-softmmu"
234 BUILDMAN: "^vexpress_ca9x4$"
235 <<: *buildman_and_testpy_dfn
237 integratorcp_cm926ejs test.py:
240 TEST_PY_BD: "integratorcp_cm926ejs"
241 TEST_PY_TEST_SPEC: "not sleep"
242 TEST_PY_ID: "--id qemu"
243 QEMU_TARGET: "arm-softmmu"
244 BUILDMAN: "^integratorcp_cm926ejs$"
245 <<: *buildman_and_testpy_dfn
250 TEST_PY_BD: "qemu_arm"
251 TEST_PY_TEST_SPEC: "not sleep"
252 QEMU_TARGET: "arm-softmmu"
253 BUILDMAN: "^qemu_arm$"
254 <<: *buildman_and_testpy_dfn
259 TEST_PY_BD: "qemu_arm64"
260 TEST_PY_TEST_SPEC: "not sleep"
261 QEMU_TARGET: "aarch64-softmmu"
262 BUILDMAN: "^qemu_arm64$"
263 <<: *buildman_and_testpy_dfn
268 TEST_PY_BD: "qemu_mips"
269 TEST_PY_TEST_SPEC: "not sleep"
270 QEMU_TARGET: "mips-softmmu"
271 BUILDMAN: "^qemu_mips$"
273 <<: *buildman_and_testpy_dfn
278 TEST_PY_BD: "qemu_mipsel"
279 TEST_PY_TEST_SPEC: "not sleep"
280 QEMU_TARGET: "mipsel-softmmu"
281 BUILDMAN: "^qemu_mipsel$"
283 <<: *buildman_and_testpy_dfn
288 TEST_PY_BD: "qemu_mips64"
289 TEST_PY_TEST_SPEC: "not sleep"
290 QEMU_TARGET: "mips64-softmmu"
291 BUILDMAN: "^qemu_mips64$"
293 <<: *buildman_and_testpy_dfn
295 qemu_mips64el test.py:
298 TEST_PY_BD: "qemu_mips64el"
299 TEST_PY_TEST_SPEC: "not sleep"
300 QEMU_TARGET: "mips64el-softmmu"
301 BUILDMAN: "^qemu_mips64el$"
303 <<: *buildman_and_testpy_dfn
305 qemu-ppce500 test.py:
308 TEST_PY_BD: "qemu-ppce500"
309 TEST_PY_TEST_SPEC: "not sleep"
310 QEMU_TARGET: "ppc-softmmu"
311 BUILDMAN: "^qemu-ppce500$"
313 <<: *buildman_and_testpy_dfn
318 TEST_PY_BD: "qemu-x86"
319 TEST_PY_TEST_SPEC: "not sleep"
320 QEMU_TARGET: "i386-softmmu"
321 BUILDMAN: "^qemu-x86$"
323 <<: *buildman_and_testpy_dfn
328 TEST_PY_BD: "qemu-x86_64"
329 TEST_PY_TEST_SPEC: "not sleep"
330 QEMU_TARGET: "x86_64-softmmu"
331 BUILDMAN: "^qemu-x86_64$"
333 <<: *buildman_and_testpy_dfn
338 TEST_PY_BD: "zynq_zc702"
339 TEST_PY_TEST_SPEC: "not sleep"
340 QEMU_TARGET: "arm-softmmu"
341 TEST_PY_ID: "--id qemu"
342 BUILDMAN: "^zynq_zc702$"
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 QEMU_TARGET: "aarch64-softmmu"
351 TEST_PY_ID: "--id qemu"
352 BUILDMAN: "^xilinx_versal_virt$"
353 <<: *buildman_and_testpy_dfn
359 TEST_PY_TEST_SPEC: "not sleep"
360 QEMU_TARGET: "xtensa-softmmu"
361 TEST_PY_ID: "--id qemu"
363 TOOLCHAIN: "xtensa-dc233c-elf"
364 <<: *buildman_and_testpy_dfn