1 # SPDX-License-Identifier: GPL-2.0+
2 # Copyright Roger Meier <r.meier@siemens.com>
4 # build U-Boot on Travis CI - https://travis-ci.org/
14 - ubuntu-toolchain-r-test
15 - llvm-toolchain-xenial-7
32 - device-tree-compiler
41 # Clone uboot-test-hooks
42 - git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
43 - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
44 - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
45 # prepare buildman environment
46 - echo -e "[toolchain]\nroot = /usr" > ~/.buildman
47 - echo -e "arc = /tmp/arc_gnu_2018.09_prebuilt_uclibc_le_archs_linux_install" >> ~/.buildman
48 - echo -e "\n[toolchain-alias]\nsh = sh2\n" >> ~/.buildman
50 - virtualenv /tmp/venv
51 - . /tmp/venv/bin/activate
52 - pip install pytest==2.8.7
53 - pip install python-subunit
54 - pip install pyelftools
55 - grub-mkimage -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
56 - grub-mkimage -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
58 - ( 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 )
60 - ( 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 )
64 - PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin:/usr/local/bin
65 - PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci
69 - QEMU_VERSION="v3.1.0"
72 # install toolchains based on TOOLCHAIN} variable
73 - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi
74 - if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi
75 - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi
76 - if [[ "${TOOLCHAIN}" == *sh* ]]; then ./tools/buildman/buildman --fetch-arch sh2 ; fi
77 - if [[ "${TOOLCHAIN}" == *i386* ]]; then
78 ./tools/buildman/buildman --fetch-arch i386;
79 echo -e "\n[toolchain-alias]\nx86 = i386" >> ~/.buildman;
81 - if [[ "${TOOLCHAIN}" == arc ]]; then
82 wget https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2018.09-release/arc_gnu_2018.09_prebuilt_uclibc_le_archs_linux_install.tar.gz &&
83 tar -C /tmp -xf arc_gnu_2018.09_prebuilt_uclibc_le_archs_linux_install.tar.gz;
85 - if [[ "${TOOLCHAIN}" == "nds32" ]]; then
86 wget https://github.com/vincentzwc/prebuilt-nds32-toolchain/releases/download/20180521/nds32le-linux-glibc-v3-upstream.tar.gz &&
87 tar -C /tmp -xf nds32le-linux-glibc-v3-upstream.tar.gz &&
88 echo -e "\n[toolchain-prefix]\nnds32 = /tmp/nds32le-linux-glibc-v3-upstream/bin/nds32le-linux-" >> ~/.buildman;
90 - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then
91 wget https://github.com/foss-xtensa/toolchain/releases/download/2018.02/x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
92 tar -C /tmp -xf x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
93 echo -e "\n[toolchain-prefix]\nxtensa = /tmp/2018.02/${TOOLCHAIN}/bin/${TOOLCHAIN}-" >> ~/.buildman;
95 # If TOOLCHAIN is unset, we're on some flavour of ARM.
96 - if [[ "${TOOLCHAIN}" == "" ]]; then
97 ./tools/buildman/buildman --fetch-arch arm &&
98 ./tools/buildman/buildman --fetch-arch aarch64;
100 - if [[ "${TOOLCHAIN}" == "powerpc" ]]; then ./tools/buildman/buildman --fetch-arch powerpc; fi
101 - if [[ "${TOOLCHAIN}" == "riscv" ]]; then
102 ./tools/buildman/buildman --fetch-arch riscv64;
103 echo -e "\n[toolchain-alias]\nriscv = riscv64" >> ~/.buildman;
105 - if [[ "${QEMU_TARGET}" != "" ]]; then
106 git clone git://git.qemu.org/qemu.git /tmp/qemu;
108 git submodule update --init dtc &&
109 git checkout ${QEMU_VERSION} &&
110 ./configure --prefix=/tmp/qemu-install --target-list=${QEMU_TARGET} &&
111 make -j4 all install;
116 # Comments must be outside the command strings below, or the Travis parser
119 # From buildman, exit code 129 means warnings only. If we've been asked to
120 # use clang only do one configuration.
121 - if [[ "${BUILDMAN}" != "" ]]; then
123 tools/buildman/buildman -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
124 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
125 tools/buildman/buildman -sdeP ${BUILDMAN};
129 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
130 # never prevent any test from running. That way, we can always pass
131 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
133 - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
134 cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/;
135 cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/;
136 cp ~/grub2-arm/usr/lib/grub2/arm-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi;
137 cp ~/grub2-arm64/usr/lib/grub2/arm64-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi;
138 if [[ "${TEST_PY_BD}" != "" ]]; then
139 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
140 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
141 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
143 if [[ $ret -ne 0 ]]; then
147 if [[ -n "${TEST_PY_TOOLS}" ]]; then
148 PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
149 PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
150 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test &&
151 ./tools/patman/patman --test &&
152 ./tools/buildman/buildman -t &&
153 PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
154 PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
155 ./tools/dtoc/dtoc -t;
160 # we need to build by vendor due to 50min time limit for builds
161 # each env setting here is a dedicated build
162 - name: "buildman arc"
166 - name: "buildman arm11 arm7 arm920t arm946es"
168 - BUILDMAN="arm11 arm7 arm920t arm946es"
169 - name: "buildman arm926ejs (non-NXP,siemens,at91,kirkwood,spear)"
172 BUILDMAN="arm926ejs -x freescale,siemens,at91,kirkwood,spear,omap"
173 - name: "buildman at91 (non arm v7)"
175 - BUILDMAN="at91 -x armv7"
176 - name: "buildman at91 (non arm926ejs)"
178 - BUILDMAN="at91 -x arm926ejs"
179 - name: "buildman boundary engicam toradex"
181 - BUILDMAN="boundary engicam toradex"
182 - name: "buildman NXP ARM32"
184 - BUILDMAN="freescale -x powerpc,m68k,aarch64"
185 - name: "buildman NXP AArch64 LS101x"
187 - BUILDMAN="freescale&aarch64&ls101"
188 - name: "buildman NXP AArch64 LS102x"
190 - BUILDMAN="freescale&aarch64&ls102"
191 - name: "buildman NXP AArch64 LS104x"
193 - BUILDMAN="freescale&aarch64&ls104"
194 - name: "buildman NXP AArch64 LS108x"
196 - BUILDMAN="freescale&aarch64&ls108"
197 - name: "buildman NXP AArch64 LS20xx"
199 - BUILDMAN="freescale&aarch64&&ls20"
200 - name: "buildman NXP AArch64 LX216x"
202 - BUILDMAN="freescale&aarch64&lx216"
203 - name: "buildman i.MX6 (non-NXP)"
205 - BUILDMAN="mx6 -x freescale,toradex,boundary,engicam"
206 - name: "buildman i.MX (non-NXP,i.MX6,toradex)"
208 - BUILDMAN="mx -x freescale,mx6,toradex"
209 - name: "buildman k2"
212 - name: "buildman samsung socfpga"
214 - BUILDMAN="samsung socfpga"
215 - name: "buildman spear"
218 - name: "buildman sun4i"
221 - name: "buildman sun5i"
224 - name: "buildman sun6i"
227 - name: "buildman sun7i"
230 - name: "buildman sun8i"
233 - name: "buildman sun9i"
236 - name: "buildman sun50i"
239 - name: "buildman catch-all ARM"
241 - BUILDMAN="arm -x arm11,arm7,arm9,aarch64,at91,freescale,kirkwood,mvebu,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap,pxa,rockchip,toradex,socfpga,k2,xilinx"
242 - name: "buildman sandbox x86"
244 - BUILDMAN="sandbox x86"
246 - name: "buildman kirkwood"
248 - BUILDMAN="kirkwood"
249 - name: "buildman mvebu"
252 - name: "buildman PXA (non-toradex)"
254 - BUILDMAN="pxa -x toradex"
255 - name: "buildman m68k"
259 - name: "buildman microblaze"
261 - BUILDMAN="microblaze"
262 TOOLCHAIN="microblaze"
263 - name: "buildman mips"
267 - name: "buildman non-Freescale PowerPC"
269 - BUILDMAN="powerpc -x freescale"
271 - name: "buildman mpc85xx&freescale (excluding many)"
273 - BUILDMAN="mpc85xx&freescale -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x bsc91*"
275 - name: "buildman t208xrdb corenet_ds"
277 - BUILDMAN="t208xrdb corenet_ds"
279 - name: "buildman Freescale PowerPC"
281 - BUILDMAN="t4qds b4860qds mpc83xx&freescale mpc86xx&freescale"
283 - name: "buildman t102*"
287 - name: "buildman p1_p2_rdb_pc"
289 - BUILDMAN="p1_p2_rdb_pc"
291 - name: "buildman p1010rdb bsc91"
293 - BUILDMAN="p1010rdb bsc91"
295 - name: "buildman siemens"
298 - name: "buildman tegra"
300 - BUILDMAN="tegra -x toradex"
301 - name: "buildman am33xx (no siemens)"
303 - BUILDMAN="am33xx -x siemens"
304 - name: "buildman omap"
307 - name: "buildman uniphier"
309 - BUILDMAN="uniphier"
310 - name: "buildman catch-all AArch64"
312 - BUILDMAN="aarch64 -x tegra,ls1,ls2,mvebu,uniphier,sunxi,samsung,rockchip,xilinx"
313 - name: "buildman rockchip"
315 - BUILDMAN="rockchip"
316 - name: "buildman sh"
318 - BUILDMAN="sh -x arm"
320 - name: "buildman Xilinx (ARM)"
322 - BUILDMAN="xilinx -x microblaze"
323 - name: "buildman xtensa"
326 TOOLCHAIN="xtensa-dc233c-elf"
327 - name: "buildman riscv"
331 - name: "buildman nds32"
336 # QA jobs for code analytics
337 # static code analysis with cppcheck (we can add --enable=all later)
340 - cppcheck --force --quiet --inline-suppr .
341 # search for TODO within source tree
345 # search for FIXME within source tree
346 - name: "grep FIXME HACK"
349 # search for HACK within source tree and ignore HACKKIT board
351 - grep -r HACK . | grep -v HACKKIT
352 # some statistics about the code base
356 # ensure all configs have MAINTAINERS entries
357 - name: "Check for configs without MAINTAINERS entry"
359 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
360 # Ensure host tools build
361 - name: "Build tools-only"
363 - make tools-only_config tools-only -j$(nproc)
366 - name: "test/py sandbox"
368 - TEST_PY_BD="sandbox"
371 - name: "test/py sandbox with clang"
373 - TEST_PY_BD="sandbox"
376 - name: "test/py sandbox_spl"
378 - TEST_PY_BD="sandbox_spl"
379 TEST_PY_TEST_SPEC="test_ofplatdata"
383 - name: "test/py sandbox_flattree"
385 - TEST_PY_BD="sandbox_flattree"
386 BUILDMAN="^sandbox_flattree$"
388 - name: "test/py evb-ast2500"
390 - TEST_PY_BD="evb-ast2500"
391 TEST_PY_ID="--id qemu"
392 QEMU_TARGET="arm-softmmu"
393 QEMU_VERSION="506179e42112be77bfd071f050b15762d3b2cd43"
394 BUILDMAN="^evb-ast2500$"
395 - name: "test/py vexpress_ca15_tc2"
397 - TEST_PY_BD="vexpress_ca15_tc2"
398 TEST_PY_ID="--id qemu"
399 QEMU_TARGET="arm-softmmu"
400 QEMU_VERSION="v3.0.0"
401 BUILDMAN="^vexpress_ca15_tc2$"
402 - name: "test/py vexpress_ca9x4"
404 - TEST_PY_BD="vexpress_ca9x4"
405 TEST_PY_ID="--id qemu"
406 QEMU_TARGET="arm-softmmu"
407 BUILDMAN="^vexpress_ca9x4$"
408 - name: "test/py integratorcp_cm926ejs"
410 - TEST_PY_BD="integratorcp_cm926ejs"
411 TEST_PY_TEST_SPEC="not sleep"
412 TEST_PY_ID="--id qemu"
413 QEMU_TARGET="arm-softmmu"
414 BUILDMAN="^integratorcp_cm926ejs$"
415 - name: "test/py qemu_arm"
417 - TEST_PY_BD="qemu_arm"
418 TEST_PY_TEST_SPEC="not sleep"
419 QEMU_TARGET="arm-softmmu"
420 BUILDMAN="^qemu_arm$"
421 - name: "test/py qemu_arm64"
423 - TEST_PY_BD="qemu_arm64"
424 TEST_PY_TEST_SPEC="not sleep"
425 QEMU_TARGET="aarch64-softmmu"
426 BUILDMAN="^qemu_arm64$"
427 - name: "test/py qemu_mips"
429 - TEST_PY_BD="qemu_mips"
430 TEST_PY_TEST_SPEC="not sleep"
431 QEMU_TARGET="mips-softmmu"
432 BUILDMAN="^qemu_mips$"
434 - name: "test/py qemu_mipsel"
436 - TEST_PY_BD="qemu_mipsel"
437 TEST_PY_TEST_SPEC="not sleep"
438 QEMU_TARGET="mipsel-softmmu"
439 BUILDMAN="^qemu_mipsel$"
441 - name: "test/py qemu_mips64"
443 - TEST_PY_BD="qemu_mips64"
444 TEST_PY_TEST_SPEC="not sleep"
445 QEMU_TARGET="mips64-softmmu"
446 BUILDMAN="^qemu_mips64$"
448 - name: "test/py qemu_mips64el"
450 - TEST_PY_BD="qemu_mips64el"
451 TEST_PY_TEST_SPEC="not sleep"
452 QEMU_TARGET="mips64el-softmmu"
453 BUILDMAN="^qemu_mips64el$"
455 - name: "test/py qemu-ppce500"
457 - TEST_PY_BD="qemu-ppce500"
458 TEST_PY_TEST_SPEC="not sleep"
459 QEMU_TARGET="ppc-softmmu"
460 BUILDMAN="^qemu-ppce500$"
462 - name: "test/py qemu-riscv64"
464 - TEST_PY_BD="qemu-riscv64"
465 TEST_PY_TEST_SPEC="not sleep"
466 QEMU_TARGET="riscv64-softmmu"
467 BUILDMAN="^qemu-riscv64$"
469 - name: "test/py qemu-x86"
471 - TEST_PY_BD="qemu-x86"
472 TEST_PY_TEST_SPEC="not sleep"
473 QEMU_TARGET="i386-softmmu"
474 BUILDMAN="^qemu-x86$"
477 - name: "test/py qemu-x86_64"
479 - TEST_PY_BD="qemu-x86_64"
480 TEST_PY_TEST_SPEC="not sleep"
481 QEMU_TARGET="x86_64-softmmu"
482 BUILDMAN="^qemu-x86_64$"
485 - name: "test/py zynq_zc702"
487 - TEST_PY_BD="zynq_zc702"
488 TEST_PY_TEST_SPEC="not sleep"
489 QEMU_TARGET="arm-softmmu"
490 TEST_PY_ID="--id qemu"
491 BUILDMAN="^zynq_zc702$"
492 - name: "test/py xilinx_versal_virt"
494 - TEST_PY_BD="xilinx_versal_virt"
495 TEST_PY_TEST_SPEC="not sleep"
496 QEMU_TARGET="aarch64-softmmu"
497 TEST_PY_ID="--id qemu"
498 BUILDMAN="^xilinx_versal_virt$"
499 - name: "test/py xtfpga"
501 - TEST_PY_BD="xtfpga"
502 TEST_PY_TEST_SPEC="not sleep"
503 QEMU_TARGET="xtensa-softmmu"
504 TEST_PY_ID="--id qemu"
506 TOOLCHAIN="xtensa-dc233c-elf"
508 # TODO make it perfect ;-r