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-trusty-7
32 - device-tree-compiler
39 # Clone uboot-test-hooks
40 - git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
41 - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
42 - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
43 # prepare buildman environment
44 - echo -e "[toolchain]\nroot = /usr" > ~/.buildman
45 - echo -e "arc = /tmp/arc_gnu_2018.09_prebuilt_uclibc_le_archs_linux_install" >> ~/.buildman
46 - echo -e "\n[toolchain-alias]\nsh = sh2\n" >> ~/.buildman
48 - virtualenv /tmp/venv
49 - . /tmp/venv/bin/activate
50 - pip install pytest==2.8.7
51 - pip install python-subunit
52 - grub-mkimage -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
53 - grub-mkimage -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
55 - ( 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 )
57 - ( 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 )
61 - PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin
62 - PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci
66 - QEMU_VERSION="v3.1.0"
69 # install toolchains based on TOOLCHAIN} variable
70 - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi
71 - if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi
72 - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi
73 - if [[ "${TOOLCHAIN}" == *sh* ]]; then ./tools/buildman/buildman --fetch-arch sh2 ; fi
74 - if [[ "${TOOLCHAIN}" == *i386* ]]; then
75 ./tools/buildman/buildman --fetch-arch i386;
76 echo -e "\n[toolchain-alias]\nx86 = i386" >> ~/.buildman;
78 - if [[ "${TOOLCHAIN}" == arc ]]; then
79 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 &&
80 tar -C /tmp -xf arc_gnu_2018.09_prebuilt_uclibc_le_archs_linux_install.tar.gz;
82 - if [[ "${TOOLCHAIN}" == "nds32" ]]; then
83 wget https://github.com/vincentzwc/prebuilt-nds32-toolchain/releases/download/20180521/nds32le-linux-glibc-v3-upstream.tar.gz &&
84 tar -C /tmp -xf nds32le-linux-glibc-v3-upstream.tar.gz &&
85 echo -e "\n[toolchain-prefix]\nnds32 = /tmp/nds32le-linux-glibc-v3-upstream/bin/nds32le-linux-" >> ~/.buildman;
87 - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then
88 wget https://github.com/foss-xtensa/toolchain/releases/download/2018.02/x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
89 tar -C /tmp -xf x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
90 echo -e "\n[toolchain-prefix]\nxtensa = /tmp/2018.02/${TOOLCHAIN}/bin/${TOOLCHAIN}-" >> ~/.buildman;
92 # If TOOLCHAIN is unset, we're on some flavour of ARM.
93 - if [[ "${TOOLCHAIN}" == "" ]]; then
94 ./tools/buildman/buildman --fetch-arch arm &&
95 ./tools/buildman/buildman --fetch-arch aarch64;
97 - if [[ "${TOOLCHAIN}" == "powerpc" ]]; then ./tools/buildman/buildman --fetch-arch powerpc; fi
98 - if [[ "${TOOLCHAIN}" == "riscv" ]]; then
99 ./tools/buildman/buildman --fetch-arch riscv64;
100 echo -e "\n[toolchain-alias]\nriscv = riscv64" >> ~/.buildman;
102 - if [[ "${QEMU_TARGET}" != "" ]]; then
103 git clone git://git.qemu.org/qemu.git /tmp/qemu;
105 git submodule update --init dtc &&
106 git checkout ${QEMU_VERSION} &&
107 ./configure --prefix=/tmp/qemu-install --target-list=${QEMU_TARGET} &&
108 make -j4 all install;
113 # Comments must be outside the command strings below, or the Travis parser
116 # From buildman, exit code 129 means warnings only. If we've been asked to
117 # use clang only do one configuration.
118 - if [[ "${BUILDMAN}" != "" ]]; then
120 tools/buildman/buildman -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
121 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
122 tools/buildman/buildman -sdeP ${BUILDMAN};
126 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
127 # never prevent any test from running. That way, we can always pass
128 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
130 - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
131 cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/;
132 cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/;
133 cp ~/grub2-arm/usr/lib/grub2/arm-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi;
134 cp ~/grub2-arm64/usr/lib/grub2/arm64-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi;
135 if [[ "${TEST_PY_BD}" != "" ]]; then
136 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
137 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
138 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
140 if [[ $ret -ne 0 ]]; then
144 if [[ -n "${TEST_PY_TOOLS}" ]]; then
145 PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
146 PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
147 ./tools/binman/binman -t &&
148 ./tools/patman/patman --test &&
149 ./tools/buildman/buildman -t &&
150 PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
151 PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
152 ./tools/dtoc/dtoc -t;
157 # we need to build by vendor due to 50min time limit for builds
158 # each env setting here is a dedicated build
159 - name: "buildman arc"
163 - name: "buildman arm11 arm7 arm920t arm946es"
165 - BUILDMAN="arm11 arm7 arm920t arm946es"
166 - name: "buildman arm926ejs (non-NXP,siemens,atmel,kirkwood,spear)"
169 BUILDMAN="arm926ejs -x freescale,siemens,atmel,kirkwood,spear"
170 - name: "buildman atmel"
173 - name: "buildman boundary engicam toradex"
175 - BUILDMAN="boundary engicam toradex"
176 - name: "buildman NXP ARM32"
178 - BUILDMAN="freescale -x powerpc,m68k,aarch64"
179 - name: "buildman NXP AArch64 LS101x"
181 - BUILDMAN="freescale&aarch64&ls101"
182 - name: "buildman NXP AArch64 LS104x"
184 - BUILDMAN="freescale&aarch64&ls104"
185 - name: "buildman NXP AArch64 LS108x"
187 - BUILDMAN="freescale&aarch64&ls108"
188 - name: "buildman NXP AArch64 LS20xx"
190 - BUILDMAN="freescale&aarch64&&ls20"
191 - name: "buildman i.MX6 (non-NXP)"
193 - BUILDMAN="mx6 -x freescale,toradex,boundary,engicam"
194 - name: "buildman i.MX (non-NXP,i.MX6,toradex)"
196 - BUILDMAN="mx -x freescale,mx6,toradex"
197 - name: "buildman k2"
200 - name: "buildman samsung socfpga"
202 - BUILDMAN="samsung socfpga"
203 - name: "buildman spear"
206 - name: "buildman sun4i"
209 - name: "buildman sun5i"
212 - name: "buildman sun6i"
215 - name: "buildman sun7i"
218 - name: "buildman sun8i"
221 - name: "buildman sun9i"
224 - name: "buildman sun50i"
227 - name: "buildman catch-all ARM"
229 - BUILDMAN="arm -x arm11,arm7,arm9,aarch64,atmel,freescale,kirkwood,mvebu,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap,pxa,rockchip,toradex,socfpga,k2,xilinx"
230 - name: "buildman sandbox x86"
232 - BUILDMAN="sandbox x86"
234 - name: "buildman kirkwood (excluding openrd)"
236 - BUILDMAN="kirkwood -x openrd"
237 - name: "buildman mvebu"
240 - name: "buildman PXA (non-toradex)"
242 - BUILDMAN="pxa -x toradex"
243 - name: "buildman m68k"
247 - name: "buildman microblaze"
249 - BUILDMAN="microblaze"
250 TOOLCHAIN="microblaze"
251 - name: "buildman mips"
255 - name: "buildman non-Freescale PowerPC"
257 - BUILDMAN="powerpc -x freescale"
259 - name: "buildman mpc85xx&freescale (excluding many)"
261 - BUILDMAN="mpc85xx&freescale -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x bsc91*"
263 - name: "buildman t208xrdb corenet_ds"
265 - BUILDMAN="t208xrdb corenet_ds"
267 - name: "buildman Freescale PowerPC"
269 - BUILDMAN="t4qds b4860qds mpc83xx&freescale mpc86xx&freescale"
271 - name: "buildman t102*"
275 - name: "buildman p1_p2_rdb_pc"
277 - BUILDMAN="p1_p2_rdb_pc"
279 - name: "buildman p1010rdb bsc91"
281 - BUILDMAN="p1010rdb bsc91"
283 - name: "buildman siemens"
286 - name: "buildman tegra"
288 - BUILDMAN="tegra -x toradex"
289 - name: "buildman am33xx (no siemens)"
291 - BUILDMAN="am33xx -x siemens"
292 - name: "buildman omap"
295 - name: "buildman uniphier"
297 - BUILDMAN="uniphier"
298 - name: "buildman catch-all AArch64"
300 - BUILDMAN="aarch64 -x tegra,ls1,ls2,mvebu,uniphier,sunxi,samsung,rockchip,xilinx"
301 - name: "buildman rockchip"
303 - BUILDMAN="rockchip"
304 - name: "buildman sh"
306 - BUILDMAN="sh -x arm"
308 - name: "buildman Xilinx (ARM)"
310 - BUILDMAN="xilinx -x microblaze"
311 - name: "buildman xtensa"
314 TOOLCHAIN="xtensa-dc233c-elf"
315 - name: "buildman riscv"
319 - name: "buildman nds32"
324 # QA jobs for code analytics
325 # static code analysis with cppcheck (we can add --enable=all later)
328 - cppcheck --force --quiet --inline-suppr .
329 # search for TODO within source tree
333 # search for FIXME within source tree
334 - name: "grep FIXME HACK"
337 # search for HACK within source tree and ignore HACKKIT board
339 - grep -r HACK . | grep -v HACKKIT
340 # some statistics about the code base
344 # ensure all configs have MAINTAINERS entries
345 - name: "Check for configs without MAINTAINERS entry"
347 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
348 # Ensure host tools build
349 - name: "Build tools-only"
351 - make tools-only_config tools-only -j$(nproc)
354 - name: "test/py sandbox"
356 - TEST_PY_BD="sandbox"
359 - name: "test/py sandbox with clang"
361 - TEST_PY_BD="sandbox"
364 - name: "test/py sandbox_spl"
366 - TEST_PY_BD="sandbox_spl"
367 TEST_PY_TEST_SPEC="test_ofplatdata"
371 - name: "test/py sandbox_flattree"
373 - TEST_PY_BD="sandbox_flattree"
374 BUILDMAN="^sandbox_flattree$"
376 - name: "test/py vexpress_ca15_tc2"
378 - TEST_PY_BD="vexpress_ca15_tc2"
379 TEST_PY_ID="--id qemu"
380 QEMU_TARGET="arm-softmmu"
381 QEMU_VERSION="v3.0.0"
382 BUILDMAN="^vexpress_ca15_tc2$"
383 - name: "test/py vexpress_ca9x4"
385 - TEST_PY_BD="vexpress_ca9x4"
386 TEST_PY_ID="--id qemu"
387 QEMU_TARGET="arm-softmmu"
388 BUILDMAN="^vexpress_ca9x4$"
389 - name: "test/py integratorcp_cm926ejs"
391 - TEST_PY_BD="integratorcp_cm926ejs"
392 TEST_PY_TEST_SPEC="not sleep"
393 TEST_PY_ID="--id qemu"
394 QEMU_TARGET="arm-softmmu"
395 BUILDMAN="^integratorcp_cm926ejs$"
396 - name: "test/py qemu_arm"
398 - TEST_PY_BD="qemu_arm"
399 TEST_PY_TEST_SPEC="not sleep"
400 QEMU_TARGET="arm-softmmu"
401 BUILDMAN="^qemu_arm$"
402 - name: "test/py qemu_arm64"
404 - TEST_PY_BD="qemu_arm64"
405 TEST_PY_TEST_SPEC="not sleep"
406 QEMU_TARGET="aarch64-softmmu"
407 BUILDMAN="^qemu_arm64$"
408 - name: "test/py qemu_mips"
410 - TEST_PY_BD="qemu_mips"
411 TEST_PY_TEST_SPEC="not sleep"
412 QEMU_TARGET="mips-softmmu"
413 BUILDMAN="^qemu_mips$"
415 - name: "test/py qemu_mipsel"
417 - TEST_PY_BD="qemu_mipsel"
418 TEST_PY_TEST_SPEC="not sleep"
419 QEMU_TARGET="mipsel-softmmu"
420 BUILDMAN="^qemu_mipsel$"
422 - name: "test/py qemu_mips64"
424 - TEST_PY_BD="qemu_mips64"
425 TEST_PY_TEST_SPEC="not sleep"
426 QEMU_TARGET="mips64-softmmu"
427 BUILDMAN="^qemu_mips64$"
429 - name: "test/py qemu_mips64el"
431 - TEST_PY_BD="qemu_mips64el"
432 TEST_PY_TEST_SPEC="not sleep"
433 QEMU_TARGET="mips64el-softmmu"
434 BUILDMAN="^qemu_mips64el$"
436 - name: "test/py qemu-ppce500"
438 - TEST_PY_BD="qemu-ppce500"
439 TEST_PY_TEST_SPEC="not sleep"
440 QEMU_TARGET="ppc-softmmu"
441 BUILDMAN="^qemu-ppce500$"
443 - name: "test/py qemu-x86"
445 - TEST_PY_BD="qemu-x86"
446 TEST_PY_TEST_SPEC="not sleep"
447 QEMU_TARGET="i386-softmmu"
448 BUILDMAN="^qemu-x86$"
451 - name: "test/py qemu-x86_64"
453 - TEST_PY_BD="qemu-x86_64"
454 TEST_PY_TEST_SPEC="not sleep"
455 QEMU_TARGET="x86_64-softmmu"
456 BUILDMAN="^qemu-x86_64$"
459 - name: "test/py zynq_zc702"
461 - TEST_PY_BD="zynq_zc702"
462 TEST_PY_TEST_SPEC="not sleep"
463 QEMU_TARGET="arm-softmmu"
464 TEST_PY_ID="--id qemu"
465 BUILDMAN="^zynq_zc702$"
466 - name: "test/py xilinx_versal_virt"
468 - TEST_PY_BD="xilinx_versal_virt"
469 TEST_PY_TEST_SPEC="not sleep"
470 QEMU_TARGET="aarch64-softmmu"
471 TEST_PY_ID="--id qemu"
472 BUILDMAN="^xilinx_versal_virt$"
473 - name: "test/py xtfpga"
475 - TEST_PY_BD="xtfpga"
476 TEST_PY_TEST_SPEC="not sleep"
477 QEMU_TARGET="xtensa-softmmu"
478 TEST_PY_ID="--id qemu"
480 TOOLCHAIN="xtensa-dc233c-elf"
482 # TODO make it perfect ;-r