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}" == *xtensa* ]]; then
83 wget https://github.com/foss-xtensa/toolchain/releases/download/2018.02/x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
84 tar -C /tmp -xf x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
85 echo -e "\n[toolchain-prefix]\nxtensa = /tmp/2018.02/${TOOLCHAIN}/bin/${TOOLCHAIN}-" >> ~/.buildman;
87 # If TOOLCHAIN is unset, we're on some flavour of ARM.
88 - if [[ "${TOOLCHAIN}" == "" ]]; then
89 ./tools/buildman/buildman --fetch-arch arm &&
90 ./tools/buildman/buildman --fetch-arch aarch64;
92 - if [[ "${TOOLCHAIN}" == "powerpc" ]]; then ./tools/buildman/buildman --fetch-arch powerpc; fi
93 - if [[ "${TOOLCHAIN}" == "riscv" ]]; then
94 ./tools/buildman/buildman --fetch-arch riscv64;
95 echo -e "\n[toolchain-alias]\nriscv = riscv64" >> ~/.buildman;
97 - if [[ "${QEMU_TARGET}" != "" ]]; then
98 git clone git://git.qemu.org/qemu.git /tmp/qemu;
100 git submodule update --init dtc &&
101 git checkout ${QEMU_VERSION} &&
102 ./configure --prefix=/tmp/qemu-install --target-list=${QEMU_TARGET} &&
103 make -j4 all install;
108 # Comments must be outside the command strings below, or the Travis parser
111 # From buildman, exit code 129 means warnings only. If we've been asked to
112 # use clang only do one configuration.
113 - if [[ "${BUILDMAN}" != "" ]]; then
115 tools/buildman/buildman -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
116 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
117 tools/buildman/buildman -sdeP ${BUILDMAN};
121 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
122 # never prevent any test from running. That way, we can always pass
123 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
125 - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
126 cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/;
127 cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/;
128 cp ~/grub2-arm/usr/lib/grub2/arm-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi;
129 cp ~/grub2-arm64/usr/lib/grub2/arm64-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi;
130 if [[ "${TEST_PY_BD}" != "" ]]; then
131 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
132 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
133 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
135 if [[ $ret -ne 0 ]]; then
139 if [[ -n "${TEST_PY_TOOLS}" ]]; then
140 PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
141 PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
142 ./tools/binman/binman -t &&
143 ./tools/patman/patman --test &&
144 ./tools/buildman/buildman -t &&
145 PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
146 PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
147 ./tools/dtoc/dtoc -t;
152 # we need to build by vendor due to 50min time limit for builds
153 # each env setting here is a dedicated build
154 - name: "buildman arc"
158 - name: "buildman arm11 arm7 arm920t arm946es"
160 - BUILDMAN="arm11 arm7 arm920t arm946es"
161 - name: "buildman arm926ejs (non-NXP,siemens,atmel,kirkwood,spear)"
164 BUILDMAN="arm926ejs -x freescale,siemens,atmel,kirkwood,spear"
165 - name: "buildman atmel"
168 - name: "buildman boundary engicam toradex"
170 - BUILDMAN="boundary engicam toradex"
171 - name: "buildman NXP ARM32"
173 - BUILDMAN="freescale -x powerpc,m68k,aarch64"
174 - name: "buildman NXP AArch64 LS101x"
176 - BUILDMAN="freescale&aarch64&ls101"
177 - name: "buildman NXP AArch64 LS104x"
179 - BUILDMAN="freescale&aarch64&ls104"
180 - name: "buildman NXP AArch64 LS108x"
182 - BUILDMAN="freescale&aarch64&ls108"
183 - name: "buildman NXP AArch64 LS20xx"
185 - BUILDMAN="freescale&aarch64&&ls20"
186 - name: "buildman i.MX6 (non-NXP)"
188 - BUILDMAN="mx6 -x freescale,toradex,boundary,engicam"
189 - name: "buildman i.MX (non-NXP,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
335 # ensure all configs have MAINTAINERS entries
336 - name: "Check for configs without MAINTAINERS entry"
338 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
339 # Ensure host tools build
340 - name: "Build tools-only"
342 - make tools-only_config tools-only -j$(nproc)
345 - name: "test/py sandbox"
347 - TEST_PY_BD="sandbox"
350 - name: "test/py sandbox with clang"
352 - TEST_PY_BD="sandbox"
355 - name: "test/py sandbox_spl"
357 - TEST_PY_BD="sandbox_spl"
358 TEST_PY_TEST_SPEC="test_ofplatdata"
362 - name: "test/py sandbox_flattree"
364 - TEST_PY_BD="sandbox_flattree"
365 BUILDMAN="^sandbox_flattree$"
367 - name: "test/py vexpress_ca15_tc2"
369 - TEST_PY_BD="vexpress_ca15_tc2"
370 TEST_PY_ID="--id qemu"
371 QEMU_TARGET="arm-softmmu"
372 QEMU_VERSION="v3.0.0"
373 BUILDMAN="^vexpress_ca15_tc2$"
374 - name: "test/py vexpress_ca9x4"
376 - TEST_PY_BD="vexpress_ca9x4"
377 TEST_PY_ID="--id qemu"
378 QEMU_TARGET="arm-softmmu"
379 BUILDMAN="^vexpress_ca9x4$"
380 - name: "test/py integratorcp_cm926ejs"
382 - TEST_PY_BD="integratorcp_cm926ejs"
383 TEST_PY_TEST_SPEC="not sleep"
384 TEST_PY_ID="--id qemu"
385 QEMU_TARGET="arm-softmmu"
386 BUILDMAN="^integratorcp_cm926ejs$"
387 - name: "test/py qemu_arm"
389 - TEST_PY_BD="qemu_arm"
390 TEST_PY_TEST_SPEC="not sleep"
391 QEMU_TARGET="arm-softmmu"
392 BUILDMAN="^qemu_arm$"
393 - name: "test/py qemu_arm64"
395 - TEST_PY_BD="qemu_arm64"
396 TEST_PY_TEST_SPEC="not sleep"
397 QEMU_TARGET="aarch64-softmmu"
398 BUILDMAN="^qemu_arm64$"
399 - name: "test/py qemu_mips"
401 - TEST_PY_BD="qemu_mips"
402 TEST_PY_TEST_SPEC="not sleep"
403 QEMU_TARGET="mips-softmmu"
404 BUILDMAN="^qemu_mips$"
406 - name: "test/py qemu_mipsel"
408 - TEST_PY_BD="qemu_mipsel"
409 TEST_PY_TEST_SPEC="not sleep"
410 QEMU_TARGET="mipsel-softmmu"
411 BUILDMAN="^qemu_mipsel$"
413 - name: "test/py qemu_mips64"
415 - TEST_PY_BD="qemu_mips64"
416 TEST_PY_TEST_SPEC="not sleep"
417 QEMU_TARGET="mips64-softmmu"
418 BUILDMAN="^qemu_mips64$"
420 - name: "test/py qemu_mips64el"
422 - TEST_PY_BD="qemu_mips64el"
423 TEST_PY_TEST_SPEC="not sleep"
424 QEMU_TARGET="mips64el-softmmu"
425 BUILDMAN="^qemu_mips64el$"
427 - name: "test/py qemu-ppce500"
429 - TEST_PY_BD="qemu-ppce500"
430 TEST_PY_TEST_SPEC="not sleep"
431 QEMU_TARGET="ppc-softmmu"
432 BUILDMAN="^qemu-ppce500$"
434 - name: "test/py qemu-x86"
436 - TEST_PY_BD="qemu-x86"
437 TEST_PY_TEST_SPEC="not sleep"
438 QEMU_TARGET="i386-softmmu"
439 BUILDMAN="^qemu-x86$"
442 - name: "test/py qemu-x86_64"
444 - TEST_PY_BD="qemu-x86_64"
445 TEST_PY_TEST_SPEC="not sleep"
446 QEMU_TARGET="x86_64-softmmu"
447 BUILDMAN="^qemu-x86_64$"
450 - name: "test/py zynq_zc702"
452 - TEST_PY_BD="zynq_zc702"
453 TEST_PY_TEST_SPEC="not sleep"
454 QEMU_TARGET="arm-softmmu"
455 TEST_PY_ID="--id qemu"
456 BUILDMAN="^zynq_zc702$"
457 - name: "test/py xtfpga"
459 - TEST_PY_BD="xtfpga"
460 TEST_PY_TEST_SPEC="not sleep"
461 QEMU_TARGET="xtensa-softmmu"
462 TEST_PY_ID="--id qemu"
464 TOOLCHAIN="xtensa-dc233c-elf"
466 # TODO make it perfect ;-r