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/
24 - gcc-powerpc-linux-gnu
29 - device-tree-compiler
33 # Clone uboot-test-hooks
34 - git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
35 - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
36 - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
37 # prepare buildman environment
38 - echo -e "[toolchain]\nroot = /usr" > ~/.buildman
39 - echo -e "aarch64 = /tmp/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu" >> ~/.buildman
40 - echo -e "arm = /tmp/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf" >> ~/.buildman
41 - echo -e "arc = /tmp/arc_gnu_2017.09_prebuilt_uclibc_le_archs_linux_install" >> ~/.buildman
42 - echo -e "\n[toolchain-alias]\nsh = sh4\nopenrisc = or32" >> ~/.buildman
44 - virtualenv /tmp/venv
45 - . /tmp/venv/bin/activate
47 - grub-mkimage -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
49 - ( 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 )
51 - ( 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 )
55 - PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin
56 - PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci
62 # install toolchains based on TOOLCHAIN} variable
63 - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi
64 - if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi
65 - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi
66 - if [[ "${TOOLCHAIN}" == *or32* ]]; then ./tools/buildman/buildman --fetch-arch or32 ; fi
67 - if [[ "${TOOLCHAIN}" == *sh4* ]]; then ./tools/buildman/buildman --fetch-arch sh4 ; fi
68 - if [[ "${TOOLCHAIN}" == *x86_64* ]]; then
69 ./tools/buildman/buildman --fetch-arch x86_64;
70 echo -e "\n[toolchain-prefix]\nx86 = ${HOME}/.buildman-toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-" >> ~/.buildman;
72 - if [[ "${TOOLCHAIN}" == arc ]]; then
73 wget https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2017.09-release/arc_gnu_2017.09_prebuilt_uclibc_le_archs_linux_install.tar.gz &&
74 tar -C /tmp -xf arc_gnu_2017.09_prebuilt_uclibc_le_archs_linux_install.tar.gz;
76 - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then
77 wget https://github.com/foss-xtensa/toolchain/releases/download/2018.02/x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
78 tar -C /tmp -xf x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
79 echo -e "\n[toolchain-prefix]\nxtensa = /tmp/2018.02/${TOOLCHAIN}/bin/${TOOLCHAIN}-" >> ~/.buildman;
81 # If TOOLCHAIN is unset, we're on some flavour of ARM.
82 - if [[ "${TOOLCHAIN}" == "" ]]; then
83 wget http://releases.linaro.org/components/toolchain/binaries/6.3-2017.02/aarch64-linux-gnu/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz &&
84 wget http://releases.linaro.org/components/toolchain/binaries/6.3-2017.02/arm-linux-gnueabihf/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf.tar.xz &&
85 tar -C /tmp -xf gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz &&
86 tar -C /tmp -xf gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf.tar.xz;
88 - if [[ "${TOOLCHAIN}" == "riscv" ]]; then
89 wget https://github.com/PkmX/riscv-prebuilt-toolchains/releases/download/20180111/riscv32-unknown-elf-toolchain.tar.gz &&
90 tar -C /tmp -xf riscv32-unknown-elf-toolchain.tar.gz &&
91 echo -e "\n[toolchain-prefix]\nriscv = /tmp/riscv32-unknown-elf/bin/riscv32-unknown-elf-" >> ~/.buildman;
93 - if [[ "${QEMU_TARGET}" != "" ]]; then
94 git clone git://git.qemu.org/qemu.git /tmp/qemu;
96 git submodule update --init dtc &&
97 git checkout v2.8.0-rc3 &&
98 ./configure --prefix=/tmp/qemu-install --target-list=${QEMU_TARGET} &&
104 # Comments must be outside the command strings below, or the Travis parser
107 # Exit code 129 means warnings only.
108 - if [[ "${BUILDMAN}" != "" ]]; then
110 tools/buildman/buildman -P -E ${BUILDMAN} || ret=$?;
111 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
112 tools/buildman/buildman -sdeP ${BUILDMAN};
116 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
117 # never prevent any test from running. That way, we can always pass
118 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
120 - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
121 cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/;
122 cp ~/grub2-arm/usr/lib/grub2/arm-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi;
123 cp ~/grub2-arm64/usr/lib/grub2/arm64-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi;
124 if [[ "${TEST_PY_BD}" != "" ]]; then
125 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
126 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
127 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
129 if [[ $ret -ne 0 ]]; then
133 if [[ -n "${TEST_PY_TOOLS}" ]]; then
134 PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
135 PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
136 ./tools/binman/binman -t &&
137 ./tools/patman/patman --test &&
138 ./tools/buildman/buildman -t &&
139 PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
140 PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
141 ./tools/dtoc/dtoc -t;
146 # we need to build by vendor due to 50min time limit for builds
147 # each env setting here is a dedicated build
159 BUILDMAN="arm926ejs -x mx,siemens,atmel"
161 - BUILDMAN="arm946es"
167 - JOB="Boundary Devices"
173 - JOB="Freescale ARM32"
174 BUILDMAN="freescale -x powerpc,m68k,aarch64"
176 - JOB="Freescale AArch64"
177 BUILDMAN="freescale&aarch64"
179 - JOB="i.MX6 (non-Freescale)"
180 BUILDMAN="mx6 -x freescale,toradex,boundary,engicam"
182 - JOB="i.MX (non-Freescale, non-i.MX6)"
183 BUILDMAN="mx -x freescale,mx6,toradex"
205 - JOB="Catch-all ARM"
206 BUILDMAN="arm -x arm11,arm7,arm9,aarch64,atmel,aries,freescale,kirkwood,mvebu,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap3,omap4,omap5,pxa,rockchip,toradex,socfpga,k2,xilinx"
208 - BUILDMAN="sandbox x86"
213 - BUILDMAN="kirkwood"
218 - BUILDMAN="pxa -x toradex"
223 - BUILDMAN="microblaze"
224 TOOLCHAIN="microblaze"
231 - BUILDMAN="mpc85xx -x freescale"
233 - BUILDMAN="mpc85xx -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x sbc8548 -x bsc91*"
235 - BUILDMAN="t208xrdb"
241 - BUILDMAN="p1_p2_rdb_pc"
243 - BUILDMAN="p1010rdb"
245 - BUILDMAN="corenet_ds b4860qds sbc8548 bsc91*"
254 BUILDMAN="tegra -x toradex"
257 BUILDMAN="am33xx -x siemens"
265 - BUILDMAN="uniphier"
268 BUILDMAN="aarch64 -x tegra,freescale,mvebu,uniphier,sunxi,samsung,rockchip"
270 - BUILDMAN="rockchip"
276 BUILDMAN="xilinx -x microblaze"
279 TOOLCHAIN="xtensa-dc233c-elf"
284 # QA jobs for code analytics
285 # static code analysis with cppcheck (we can add --enable=all later)
289 - cppcheck --force --quiet --inline-suppr .
290 # search for TODO within source tree
295 # search for FIXME within source tree
297 - JOB="grep FIXME HACK"
300 # search for HACK within source tree and ignore HACKKIT board
302 - grep -r HACK . | grep -v HACKKIT
303 # some statistics about the code base
311 - TEST_PY_BD="sandbox"
315 - TEST_PY_BD="sandbox_spl"
316 TEST_PY_TEST_SPEC="test_ofplatdata"
321 - TEST_PY_BD="sandbox_flattree"
322 BUILDMAN="^sandbox_flattree$"
325 - TEST_PY_BD="vexpress_ca15_tc2"
326 TEST_PY_ID="--id qemu"
327 QEMU_TARGET="arm-softmmu"
328 BUILDMAN="^vexpress_ca15_tc2$"
330 - TEST_PY_BD="vexpress_ca9x4"
331 TEST_PY_ID="--id qemu"
332 QEMU_TARGET="arm-softmmu"
333 BUILDMAN="^vexpress_ca9x4$"
335 - TEST_PY_BD="integratorcp_cm926ejs"
336 TEST_PY_TEST_SPEC="not sleep"
337 TEST_PY_ID="--id qemu"
338 QEMU_TARGET="arm-softmmu"
339 BUILDMAN="^integratorcp_cm926ejs$"
341 - TEST_PY_BD="qemu_arm"
342 TEST_PY_TEST_SPEC="not sleep"
343 QEMU_TARGET="arm-softmmu"
344 BUILDMAN="^qemu_arm$"
346 - TEST_PY_BD="qemu_arm64"
347 TEST_PY_TEST_SPEC="not sleep"
348 QEMU_TARGET="aarch64-softmmu"
349 BUILDMAN="^qemu_arm64$"
351 - TEST_PY_BD="qemu_mips"
352 TEST_PY_TEST_SPEC="not sleep"
353 QEMU_TARGET="mips-softmmu"
354 BUILDMAN="^qemu_mips$"
357 - TEST_PY_BD="qemu_mipsel"
358 TEST_PY_TEST_SPEC="not sleep"
359 QEMU_TARGET="mipsel-softmmu"
360 BUILDMAN="^qemu_mipsel$"
363 - TEST_PY_BD="qemu_mips64"
364 TEST_PY_TEST_SPEC="not sleep"
365 QEMU_TARGET="mips64-softmmu"
366 BUILDMAN="^qemu_mips64$"
369 - TEST_PY_BD="qemu_mips64el"
370 TEST_PY_TEST_SPEC="not sleep"
371 QEMU_TARGET="mips64el-softmmu"
372 BUILDMAN="^qemu_mips64el$"
375 - TEST_PY_BD="qemu-ppce500"
376 TEST_PY_TEST_SPEC="not sleep"
377 QEMU_TARGET="ppc-softmmu"
378 BUILDMAN="^qemu-ppce500$"
380 - TEST_PY_BD="qemu-x86"
381 TEST_PY_TEST_SPEC="not sleep"
382 QEMU_TARGET="i386-softmmu"
383 BUILDMAN="^qemu-x86$"
387 - TEST_PY_BD="zynq_zc702"
388 TEST_PY_TEST_SPEC="not sleep"
389 QEMU_TARGET="arm-softmmu"
390 TEST_PY_ID="--id qemu"
391 BUILDMAN="^zynq_zc702$"
393 - TEST_PY_BD="xtfpga"
394 TEST_PY_TEST_SPEC="not sleep"
395 QEMU_TARGET="xtensa-softmmu"
396 TEST_PY_ID="--id qemu"
398 TOOLCHAIN="xtensa-dc233c-elf"
400 # TODO make it perfect ;-r