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_2017.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
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-2017.09-release/arc_gnu_2017.09_prebuilt_uclibc_le_archs_linux_install.tar.gz &&
79 tar -C /tmp -xf arc_gnu_2017.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 [[ "${TOOLCHAIN}" == "clang" ]]; then
114 make O=../.bm-work/${TEST_PY_BD} HOSTCC=clang-7 CC=clang-7 -j$(nproc)
115 KCFLAGS=-Werror sandbox_config all || ret=$?;
116 if [[ $ret -ne 0 ]]; then
119 elif [[ "${BUILDMAN}" != "" ]]; then
121 tools/buildman/buildman -P -E ${BUILDMAN} || ret=$?;
122 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
123 tools/buildman/buildman -sdeP ${BUILDMAN};
127 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
128 # never prevent any test from running. That way, we can always pass
129 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
131 - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
132 cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/;
133 cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/;
134 cp ~/grub2-arm/usr/lib/grub2/arm-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi;
135 cp ~/grub2-arm64/usr/lib/grub2/arm64-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi;
136 if [[ "${TEST_PY_BD}" != "" ]]; then
137 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
138 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
139 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
141 if [[ $ret -ne 0 ]]; then
145 if [[ -n "${TEST_PY_TOOLS}" ]]; then
146 PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
147 PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
148 ./tools/binman/binman -t &&
149 ./tools/patman/patman --test &&
150 ./tools/buildman/buildman -t &&
151 PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
152 PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
153 ./tools/dtoc/dtoc -t;
158 # we need to build by vendor due to 50min time limit for builds
159 # each env setting here is a dedicated build
160 - name: "buildman arc"
164 - name: "buildman arm11 arm7 arm920t arm946es"
166 - BUILDMAN="arm11 arm7 arm920t arm946es"
167 - name: "buildman arm926ejs (non-freescale,siemens,atmel,kirkwood,spear)"
170 BUILDMAN="arm926ejs -x freescale,siemens,atmel,kirkwood,spear"
171 - name: "buildman atmel"
174 - name: "buildman boundary engicam toradex"
176 - BUILDMAN="boundary engicam toradex"
177 - name: "buildman Freescale ARM32"
179 - BUILDMAN="freescale -x powerpc,m68k,aarch64"
180 - name: "buildman Freescale AArch64 LS10xx"
182 - BUILDMAN="freescale&aarch64&&ls1"
183 - name: "buildman Freescale AArch64 LS20xx"
185 - BUILDMAN="freescale&aarch64&&ls2"
186 - name: "buildman i.MX6 (non-Freescale)"
188 - BUILDMAN="mx6 -x freescale,toradex,boundary,engicam"
189 - name: "buildman i.MX (non-Freescale,i.MX6,toradex)"
191 - BUILDMAN="mx -x freescale,mx6,toradex"
192 - name: "buildman k2"
195 - name: "buildman samsung socfpga"
197 - BUILDMAN="samsung socfpga"
198 - name: "buildman spear"
201 - name: "buildman sun4i"
204 - name: "buildman sun5i"
207 - name: "buildman sun6i"
210 - name: "buildman sun7i"
213 - name: "buildman sun8i"
216 - name: "buildman sun9i"
219 - name: "buildman sun50i"
222 - name: "buildman catch-all ARM"
224 - 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"
225 - name: "buildman sandbox x86"
227 - BUILDMAN="sandbox x86"
229 - name: "buildman kirkwood (excluding openrd)"
231 - BUILDMAN="kirkwood -x openrd"
232 - name: "buildman mvebu"
235 - name: "buildman PXA (non-toradex)"
237 - BUILDMAN="pxa -x toradex"
238 - name: "buildman m68k"
242 - name: "buildman microblaze"
244 - BUILDMAN="microblaze"
245 TOOLCHAIN="microblaze"
246 - name: "buildman mips"
250 - name: "buildman non-Freescale PowerPC"
252 - BUILDMAN="powerpc -x freescale"
254 - name: "buildman mpc85xx&freescale (excluding many)"
256 - BUILDMAN="mpc85xx&freescale -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x bsc91*"
258 - name: "buildman t208xrdb corenet_ds"
260 - BUILDMAN="t208xrdb corenet_ds"
262 - name: "buildman Freescale PowerPC"
264 - BUILDMAN="t4qds b4860qds mpc83xx&freescale mpc86xx&freescale"
266 - name: "buildman t102*"
270 - name: "buildman p1_p2_rdb_pc"
272 - BUILDMAN="p1_p2_rdb_pc"
274 - name: "buildman p1010rdb bsc91"
276 - BUILDMAN="p1010rdb bsc91"
278 - name: "buildman siemens"
281 - name: "buildman tegra"
283 - BUILDMAN="tegra -x toradex"
284 - name: "buildman am33xx (no siemens)"
286 - BUILDMAN="am33xx -x siemens"
287 - name: "buildman omap"
290 - name: "buildman uniphier"
292 - BUILDMAN="uniphier"
293 - name: "buildman catch-all AArch64"
295 - BUILDMAN="aarch64 -x tegra,ls1,ls2,mvebu,uniphier,sunxi,samsung,rockchip,xilinx"
296 - name: "buildman rockchip"
298 - BUILDMAN="rockchip"
299 - name: "buildman sh"
301 - BUILDMAN="sh -x arm"
303 - name: "buildman Xilinx (ARM)"
305 - BUILDMAN="xilinx -x microblaze"
306 - name: "buildman xtensa"
309 TOOLCHAIN="xtensa-dc233c-elf"
310 - name: "buildman riscv"
315 # QA jobs for code analytics
316 # static code analysis with cppcheck (we can add --enable=all later)
319 - cppcheck --force --quiet --inline-suppr .
320 # search for TODO within source tree
324 # search for FIXME within source tree
325 - name: "grep FIXME HACK"
328 # search for HACK within source tree and ignore HACKKIT board
330 - grep -r HACK . | grep -v HACKKIT
331 # some statistics about the code base
337 - name: "test/py sandbox"
339 - TEST_PY_BD="sandbox"
342 - name: "test/py sandbox with clang"
344 - TEST_PY_BD="sandbox"
347 - name: "test/py sandbox_spl"
349 - TEST_PY_BD="sandbox_spl"
350 TEST_PY_TEST_SPEC="test_ofplatdata"
354 - name: "test/py sandbox_flattree"
356 - TEST_PY_BD="sandbox_flattree"
357 BUILDMAN="^sandbox_flattree$"
359 - name: "test/py vexpress_ca15_tc2"
361 - TEST_PY_BD="vexpress_ca15_tc2"
362 TEST_PY_ID="--id qemu"
363 QEMU_TARGET="arm-softmmu"
364 BUILDMAN="^vexpress_ca15_tc2$"
365 - name: "test/py vexpress_ca9x4"
367 - TEST_PY_BD="vexpress_ca9x4"
368 TEST_PY_ID="--id qemu"
369 QEMU_TARGET="arm-softmmu"
370 BUILDMAN="^vexpress_ca9x4$"
371 - name: "test/py integratorcp_cm926ejs"
373 - TEST_PY_BD="integratorcp_cm926ejs"
374 TEST_PY_TEST_SPEC="not sleep"
375 TEST_PY_ID="--id qemu"
376 QEMU_TARGET="arm-softmmu"
377 BUILDMAN="^integratorcp_cm926ejs$"
378 - name: "test/py qemu_arm"
380 - TEST_PY_BD="qemu_arm"
381 TEST_PY_TEST_SPEC="not sleep"
382 QEMU_TARGET="arm-softmmu"
383 BUILDMAN="^qemu_arm$"
384 - name: "test/py qemu_arm64"
386 - TEST_PY_BD="qemu_arm64"
387 TEST_PY_TEST_SPEC="not sleep"
388 QEMU_TARGET="aarch64-softmmu"
389 BUILDMAN="^qemu_arm64$"
390 - name: "test/py qemu_mips"
392 - TEST_PY_BD="qemu_mips"
393 TEST_PY_TEST_SPEC="not sleep"
394 QEMU_TARGET="mips-softmmu"
395 BUILDMAN="^qemu_mips$"
397 - name: "test/py qemu_mipsel"
399 - TEST_PY_BD="qemu_mipsel"
400 TEST_PY_TEST_SPEC="not sleep"
401 QEMU_TARGET="mipsel-softmmu"
402 BUILDMAN="^qemu_mipsel$"
404 - name: "test/py qemu_mips64"
406 - TEST_PY_BD="qemu_mips64"
407 TEST_PY_TEST_SPEC="not sleep"
408 QEMU_TARGET="mips64-softmmu"
409 BUILDMAN="^qemu_mips64$"
411 - name: "test/py qemu_mips64el"
413 - TEST_PY_BD="qemu_mips64el"
414 TEST_PY_TEST_SPEC="not sleep"
415 QEMU_TARGET="mips64el-softmmu"
416 BUILDMAN="^qemu_mips64el$"
418 - name: "test/py qemu-ppce500"
420 - TEST_PY_BD="qemu-ppce500"
421 TEST_PY_TEST_SPEC="not sleep"
422 QEMU_TARGET="ppc-softmmu"
423 BUILDMAN="^qemu-ppce500$"
425 - name: "test/py qemu-x86"
427 - TEST_PY_BD="qemu-x86"
428 TEST_PY_TEST_SPEC="not sleep"
429 QEMU_TARGET="i386-softmmu"
430 BUILDMAN="^qemu-x86$"
433 - name: "test/py qemu-x86_64"
435 - TEST_PY_BD="qemu-x86_64"
436 TEST_PY_TEST_SPEC="not sleep"
437 QEMU_TARGET="x86_64-softmmu"
438 BUILDMAN="^qemu-x86_64$"
441 - name: "test/py zynq_zc702"
443 - TEST_PY_BD="zynq_zc702"
444 TEST_PY_TEST_SPEC="not sleep"
445 QEMU_TARGET="arm-softmmu"
446 TEST_PY_ID="--id qemu"
447 BUILDMAN="^zynq_zc702$"
448 - name: "test/py xtfpga"
450 - TEST_PY_BD="xtfpga"
451 TEST_PY_TEST_SPEC="not sleep"
452 QEMU_TARGET="xtensa-softmmu"
453 TEST_PY_ID="--id qemu"
455 TOOLCHAIN="xtensa-dc233c-elf"
457 # TODO make it perfect ;-r