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
68 # install toolchains based on TOOLCHAIN} variable
69 - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi
70 - if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi
71 - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi
72 - if [[ "${TOOLCHAIN}" == *sh* ]]; then ./tools/buildman/buildman --fetch-arch sh2 ; fi
73 - if [[ "${TOOLCHAIN}" == *i386* ]]; then
74 ./tools/buildman/buildman --fetch-arch i386;
75 echo -e "\n[toolchain-alias]\nx86 = i386" >> ~/.buildman;
77 - if [[ "${TOOLCHAIN}" == arc ]]; then
78 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 &&
79 tar -C /tmp -xf arc_gnu_2018.09_prebuilt_uclibc_le_archs_linux_install.tar.gz;
81 - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then
82 wget https://github.com/foss-xtensa/toolchain/releases/download/2018.02/x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
83 tar -C /tmp -xf x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
84 echo -e "\n[toolchain-prefix]\nxtensa = /tmp/2018.02/${TOOLCHAIN}/bin/${TOOLCHAIN}-" >> ~/.buildman;
86 # If TOOLCHAIN is unset, we're on some flavour of ARM.
87 - if [[ "${TOOLCHAIN}" == "" ]]; then
88 ./tools/buildman/buildman --fetch-arch arm &&
89 ./tools/buildman/buildman --fetch-arch aarch64;
91 - if [[ "${TOOLCHAIN}" == "powerpc" ]]; then ./tools/buildman/buildman --fetch-arch powerpc; fi
92 - if [[ "${TOOLCHAIN}" == "riscv" ]]; then
93 ./tools/buildman/buildman --fetch-arch riscv64;
94 echo -e "\n[toolchain-alias]\nriscv = riscv64" >> ~/.buildman;
96 - if [[ "${QEMU_TARGET}" != "" ]]; then
97 git clone git://git.qemu.org/qemu.git /tmp/qemu;
99 git submodule update --init dtc &&
100 git checkout v3.0.0 &&
101 ./configure --prefix=/tmp/qemu-install --target-list=${QEMU_TARGET} &&
102 make -j4 all install;
107 # Comments must be outside the command strings below, or the Travis parser
110 # From buildman, exit code 129 means warnings only. If we've been asked to
111 # use clang only do one configuration.
112 - if [[ "${BUILDMAN}" != "" ]]; then
114 tools/buildman/buildman -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
115 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
116 tools/buildman/buildman -sdeP ${BUILDMAN};
120 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
121 # never prevent any test from running. That way, we can always pass
122 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
124 - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
125 cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/;
126 cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/;
127 cp ~/grub2-arm/usr/lib/grub2/arm-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi;
128 cp ~/grub2-arm64/usr/lib/grub2/arm64-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi;
129 if [[ "${TEST_PY_BD}" != "" ]]; then
130 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
131 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
132 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
134 if [[ $ret -ne 0 ]]; then
138 if [[ -n "${TEST_PY_TOOLS}" ]]; then
139 PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
140 PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
141 ./tools/binman/binman -t &&
142 ./tools/patman/patman --test &&
143 ./tools/buildman/buildman -t &&
144 PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
145 PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
146 ./tools/dtoc/dtoc -t;
151 # we need to build by vendor due to 50min time limit for builds
152 # each env setting here is a dedicated build
153 - name: "buildman arc"
157 - name: "buildman arm11 arm7 arm920t arm946es"
159 - BUILDMAN="arm11 arm7 arm920t arm946es"
160 - name: "buildman arm926ejs (non-freescale,siemens,atmel,kirkwood,spear)"
163 BUILDMAN="arm926ejs -x freescale,siemens,atmel,kirkwood,spear"
164 - name: "buildman atmel"
167 - name: "buildman boundary engicam toradex"
169 - BUILDMAN="boundary engicam toradex"
170 - name: "buildman Freescale ARM32"
172 - BUILDMAN="freescale -x powerpc,m68k,aarch64"
173 - name: "buildman Freescale AArch64 LS10xx"
175 - BUILDMAN="freescale&aarch64&&ls1"
176 - name: "buildman Freescale AArch64 LS20xx"
178 - BUILDMAN="freescale&aarch64&&ls2"
179 - name: "buildman i.MX6 (non-Freescale)"
181 - BUILDMAN="mx6 -x freescale,toradex,boundary,engicam"
182 - name: "buildman i.MX (non-Freescale,i.MX6,toradex)"
184 - BUILDMAN="mx -x freescale,mx6,toradex"
185 - name: "buildman k2"
188 - name: "buildman samsung socfpga"
190 - BUILDMAN="samsung socfpga"
191 - name: "buildman spear"
194 - name: "buildman sun4i"
197 - name: "buildman sun5i"
200 - name: "buildman sun6i"
203 - name: "buildman sun7i"
206 - name: "buildman sun8i"
209 - name: "buildman sun9i"
212 - name: "buildman sun50i"
215 - name: "buildman catch-all ARM"
217 - 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"
218 - name: "buildman sandbox x86"
220 - BUILDMAN="sandbox x86"
222 - name: "buildman kirkwood (excluding openrd)"
224 - BUILDMAN="kirkwood -x openrd"
225 - name: "buildman mvebu"
228 - name: "buildman PXA (non-toradex)"
230 - BUILDMAN="pxa -x toradex"
231 - name: "buildman m68k"
235 - name: "buildman microblaze"
237 - BUILDMAN="microblaze"
238 TOOLCHAIN="microblaze"
239 - name: "buildman mips"
243 - name: "buildman non-Freescale PowerPC"
245 - BUILDMAN="powerpc -x freescale"
247 - name: "buildman mpc85xx&freescale (excluding many)"
249 - BUILDMAN="mpc85xx&freescale -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x bsc91*"
251 - name: "buildman t208xrdb corenet_ds"
253 - BUILDMAN="t208xrdb corenet_ds"
255 - name: "buildman Freescale PowerPC"
257 - BUILDMAN="t4qds b4860qds mpc83xx&freescale mpc86xx&freescale"
259 - name: "buildman t102*"
263 - name: "buildman p1_p2_rdb_pc"
265 - BUILDMAN="p1_p2_rdb_pc"
267 - name: "buildman p1010rdb bsc91"
269 - BUILDMAN="p1010rdb bsc91"
271 - name: "buildman siemens"
274 - name: "buildman tegra"
276 - BUILDMAN="tegra -x toradex"
277 - name: "buildman am33xx (no siemens)"
279 - BUILDMAN="am33xx -x siemens"
280 - name: "buildman omap"
283 - name: "buildman uniphier"
285 - BUILDMAN="uniphier"
286 - name: "buildman catch-all AArch64"
288 - BUILDMAN="aarch64 -x tegra,ls1,ls2,mvebu,uniphier,sunxi,samsung,rockchip,xilinx"
289 - name: "buildman rockchip"
291 - BUILDMAN="rockchip"
292 - name: "buildman sh"
294 - BUILDMAN="sh -x arm"
296 - name: "buildman Xilinx (ARM)"
298 - BUILDMAN="xilinx -x microblaze"
299 - name: "buildman xtensa"
302 TOOLCHAIN="xtensa-dc233c-elf"
303 - name: "buildman riscv"
308 # QA jobs for code analytics
309 # static code analysis with cppcheck (we can add --enable=all later)
312 - cppcheck --force --quiet --inline-suppr .
313 # search for TODO within source tree
317 # search for FIXME within source tree
318 - name: "grep FIXME HACK"
321 # search for HACK within source tree and ignore HACKKIT board
323 - grep -r HACK . | grep -v HACKKIT
324 # some statistics about the code base
328 # ensure all configs have MAINTAINERS entries
329 - name: "Check for configs without MAINTAINERS entry"
331 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
332 # Ensure host tools build
333 - name: "Build tools-only"
335 - make tools-only_config tools-only -j$(nproc)
338 - name: "test/py sandbox"
340 - TEST_PY_BD="sandbox"
343 - name: "test/py sandbox with clang"
345 - TEST_PY_BD="sandbox"
348 - name: "test/py sandbox_spl"
350 - TEST_PY_BD="sandbox_spl"
351 TEST_PY_TEST_SPEC="test_ofplatdata"
355 - name: "test/py sandbox_flattree"
357 - TEST_PY_BD="sandbox_flattree"
358 BUILDMAN="^sandbox_flattree$"
360 - name: "test/py vexpress_ca15_tc2"
362 - TEST_PY_BD="vexpress_ca15_tc2"
363 TEST_PY_ID="--id qemu"
364 QEMU_TARGET="arm-softmmu"
365 BUILDMAN="^vexpress_ca15_tc2$"
366 - name: "test/py vexpress_ca9x4"
368 - TEST_PY_BD="vexpress_ca9x4"
369 TEST_PY_ID="--id qemu"
370 QEMU_TARGET="arm-softmmu"
371 BUILDMAN="^vexpress_ca9x4$"
372 - name: "test/py integratorcp_cm926ejs"
374 - TEST_PY_BD="integratorcp_cm926ejs"
375 TEST_PY_TEST_SPEC="not sleep"
376 TEST_PY_ID="--id qemu"
377 QEMU_TARGET="arm-softmmu"
378 BUILDMAN="^integratorcp_cm926ejs$"
379 - name: "test/py qemu_arm"
381 - TEST_PY_BD="qemu_arm"
382 TEST_PY_TEST_SPEC="not sleep"
383 QEMU_TARGET="arm-softmmu"
384 BUILDMAN="^qemu_arm$"
385 - name: "test/py qemu_arm64"
387 - TEST_PY_BD="qemu_arm64"
388 TEST_PY_TEST_SPEC="not sleep"
389 QEMU_TARGET="aarch64-softmmu"
390 BUILDMAN="^qemu_arm64$"
391 - name: "test/py qemu_mips"
393 - TEST_PY_BD="qemu_mips"
394 TEST_PY_TEST_SPEC="not sleep"
395 QEMU_TARGET="mips-softmmu"
396 BUILDMAN="^qemu_mips$"
398 - name: "test/py qemu_mipsel"
400 - TEST_PY_BD="qemu_mipsel"
401 TEST_PY_TEST_SPEC="not sleep"
402 QEMU_TARGET="mipsel-softmmu"
403 BUILDMAN="^qemu_mipsel$"
405 - name: "test/py qemu_mips64"
407 - TEST_PY_BD="qemu_mips64"
408 TEST_PY_TEST_SPEC="not sleep"
409 QEMU_TARGET="mips64-softmmu"
410 BUILDMAN="^qemu_mips64$"
412 - name: "test/py qemu_mips64el"
414 - TEST_PY_BD="qemu_mips64el"
415 TEST_PY_TEST_SPEC="not sleep"
416 QEMU_TARGET="mips64el-softmmu"
417 BUILDMAN="^qemu_mips64el$"
419 - name: "test/py qemu-ppce500"
421 - TEST_PY_BD="qemu-ppce500"
422 TEST_PY_TEST_SPEC="not sleep"
423 QEMU_TARGET="ppc-softmmu"
424 BUILDMAN="^qemu-ppce500$"
426 - name: "test/py qemu-x86"
428 - TEST_PY_BD="qemu-x86"
429 TEST_PY_TEST_SPEC="not sleep"
430 QEMU_TARGET="i386-softmmu"
431 BUILDMAN="^qemu-x86$"
434 - name: "test/py qemu-x86_64"
436 - TEST_PY_BD="qemu-x86_64"
437 TEST_PY_TEST_SPEC="not sleep"
438 QEMU_TARGET="x86_64-softmmu"
439 BUILDMAN="^qemu-x86_64$"
442 - name: "test/py zynq_zc702"
444 - TEST_PY_BD="zynq_zc702"
445 TEST_PY_TEST_SPEC="not sleep"
446 QEMU_TARGET="arm-softmmu"
447 TEST_PY_ID="--id qemu"
448 BUILDMAN="^zynq_zc702$"
449 - name: "test/py xtfpga"
451 - TEST_PY_BD="xtfpga"
452 TEST_PY_TEST_SPEC="not sleep"
453 QEMU_TARGET="xtensa-softmmu"
454 TEST_PY_ID="--id qemu"
456 TOOLCHAIN="xtensa-dc233c-elf"
458 # TODO make it perfect ;-r