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/
28 - device-tree-compiler
33 - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
34 - sudo apt-get update -q
35 - sudo apt-get install libisl15 -y
38 # Clone uboot-test-hooks
39 - git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
40 - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
41 - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
42 # prepare buildman environment
43 - echo -e "[toolchain]\nroot = /usr" > ~/.buildman
44 - echo -e "arc = /tmp/arc_gnu_2017.09_prebuilt_uclibc_le_archs_linux_install" >> ~/.buildman
45 - echo -e "\n[toolchain-alias]\nsh = sh2\n" >> ~/.buildman
47 - virtualenv /tmp/venv
48 - . /tmp/venv/bin/activate
50 - pip install python-subunit
51 - grub-mkimage -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
53 - ( 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 )
55 - ( 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 )
59 - PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin
60 - PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci
66 # install toolchains based on TOOLCHAIN} variable
67 - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi
68 - if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi
69 - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi
70 - if [[ "${TOOLCHAIN}" == *sh* ]]; then ./tools/buildman/buildman --fetch-arch sh2 ; fi
71 - if [[ "${TOOLCHAIN}" == *i386* ]]; then
72 ./tools/buildman/buildman --fetch-arch i386;
73 echo -e "\n[toolchain-alias]\nx86 = i386" >> ~/.buildman;
75 - if [[ "${TOOLCHAIN}" == arc ]]; then
76 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 &&
77 tar -C /tmp -xf arc_gnu_2017.09_prebuilt_uclibc_le_archs_linux_install.tar.gz;
79 - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then
80 wget https://github.com/foss-xtensa/toolchain/releases/download/2018.02/x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
81 tar -C /tmp -xf x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
82 echo -e "\n[toolchain-prefix]\nxtensa = /tmp/2018.02/${TOOLCHAIN}/bin/${TOOLCHAIN}-" >> ~/.buildman;
84 # If TOOLCHAIN is unset, we're on some flavour of ARM.
85 - if [[ "${TOOLCHAIN}" == "" ]]; then
86 ./tools/buildman/buildman --fetch-arch arm &&
87 ./tools/buildman/buildman --fetch-arch aarch64;
89 - if [[ "${TOOLCHAIN}" == "powerpc" ]]; then ./tools/buildman/buildman --fetch-arch powerpc; fi
90 - if [[ "${TOOLCHAIN}" == "riscv" ]]; then
91 ./tools/buildman/buildman --fetch-arch riscv64;
92 echo -e "\n[toolchain-alias]\nriscv = riscv64" >> ~/.buildman;
94 - if [[ "${QEMU_TARGET}" != "" ]]; then
95 git clone git://git.qemu.org/qemu.git /tmp/qemu;
97 git submodule update --init dtc &&
98 git checkout v2.8.0-rc3 &&
99 ./configure --prefix=/tmp/qemu-install --target-list=${QEMU_TARGET} &&
100 make -j4 all install;
105 # Comments must be outside the command strings below, or the Travis parser
108 # Exit code 129 means warnings only.
109 - if [[ "${BUILDMAN}" != "" ]]; then
111 tools/buildman/buildman -P -E ${BUILDMAN} || ret=$?;
112 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
113 tools/buildman/buildman -sdeP ${BUILDMAN};
117 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
118 # never prevent any test from running. That way, we can always pass
119 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
121 - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
122 cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/;
123 cp ~/grub2-arm/usr/lib/grub2/arm-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi;
124 cp ~/grub2-arm64/usr/lib/grub2/arm64-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi;
125 if [[ "${TEST_PY_BD}" != "" ]]; then
126 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
127 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
128 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
130 if [[ $ret -ne 0 ]]; then
134 if [[ -n "${TEST_PY_TOOLS}" ]]; then
135 PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
136 PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
137 ./tools/binman/binman -t &&
138 ./tools/patman/patman --test &&
139 ./tools/buildman/buildman -t &&
140 PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
141 PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
142 ./tools/dtoc/dtoc -t;
147 # we need to build by vendor due to 50min time limit for builds
148 # each env setting here is a dedicated build
149 - name: "buildman arc"
153 - name: "buildman arm11 arm7 arm920t arm946es"
155 - BUILDMAN="arm11 arm7 arm920t arm946es"
156 - name: "buildman arm926ejs (non-mx,siemens,atmel,kirkwood)"
159 BUILDMAN="arm926ejs -x mx,siemens,atmel,kirkwood"
160 - name: "buildman atmel"
163 - name: "buildman boundary engicam toradex"
165 - BUILDMAN="boundary engicam toradex"
166 - name: "buildman Freescale ARM32"
168 - BUILDMAN="freescale -x powerpc,m68k,aarch64"
169 - name: "buildman Freescale AArch64"
171 - BUILDMAN="freescale&aarch64"
172 - name: "buildman i.MX6 (non-Freescale)"
174 - BUILDMAN="mx6 -x freescale,toradex,boundary,engicam"
175 - name: "buildman i.MX (non-Freescale,i.MX6,toradex)"
177 - BUILDMAN="mx -x freescale,mx6,toradex"
178 - name: "buildman k2"
181 - name: "buildman samsung socfpga"
183 - BUILDMAN="samsung socfpga"
184 - name: "buildman sun4i"
187 - name: "buildman sun5i"
190 - name: "buildman sun6i"
193 - name: "buildman sun7i"
196 - name: "buildman sun8i"
199 - name: "buildman sun9i"
202 - name: "buildman sun50i"
205 - name: "buildman catch-all ARM"
207 - 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"
208 - name: "buildman sandbox x86"
210 - BUILDMAN="sandbox x86"
212 - name: "buildman kirkwood (excluding openrd)"
214 - BUILDMAN="kirkwood -x openrd"
215 - name: "buildman mvebu"
218 - name: "buildman PXA (non-toradex)"
220 - BUILDMAN="pxa -x toradex"
221 - name: "buildman m68k"
225 - name: "buildman microblaze"
227 - BUILDMAN="microblaze"
228 TOOLCHAIN="microblaze"
229 - name: "buildman mips"
233 - name: "buildman non-Freescale PowerPC"
235 - BUILDMAN="powerpc -x freescale"
237 - name: "buildman mpc85xx&freescale (excluding many)"
239 - BUILDMAN="mpc85xx&freescale -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x bsc91*"
241 - name: "buildman t208xrdb corenet_ds"
243 - BUILDMAN="t208xrdb corenet_ds"
245 - name: "buildman Freescale PowerPC"
247 - BUILDMAN="t4qds b4860qds mpc83xx&freescale mpc86xx&freescale"
249 - name: "buildman t102*"
253 - name: "buildman p1_p2_rdb_pc"
255 - BUILDMAN="p1_p2_rdb_pc"
257 - name: "buildman p1010rdb bsc91"
259 - BUILDMAN="p1010rdb bsc91"
261 - name: "buildman siemens"
264 - name: "buildman tegra"
266 - BUILDMAN="tegra -x toradex"
267 - name: "buildman am33xx (no siemens)"
269 - BUILDMAN="am33xx -x siemens"
270 - name: "buildman omap"
273 - name: "buildman uniphier"
275 - BUILDMAN="uniphier"
276 - name: "buildman catch-all AArch64"
278 - BUILDMAN="aarch64 -x tegra,freescale,mvebu,uniphier,sunxi,samsung,rockchip,xilinx"
279 - name: "buildman rockchip"
281 - BUILDMAN="rockchip"
282 - name: "buildman sh"
284 - BUILDMAN="sh -x arm"
286 - name: "buildman Xilinx (ARM)"
288 - BUILDMAN="xilinx -x microblaze"
289 - name: "buildman xtensa"
292 TOOLCHAIN="xtensa-dc233c-elf"
293 - name: "buildman riscv"
298 # QA jobs for code analytics
299 # static code analysis with cppcheck (we can add --enable=all later)
302 - cppcheck --force --quiet --inline-suppr .
303 # search for TODO within source tree
307 # search for FIXME within source tree
308 - name: "grep FIXME HACK"
311 # search for HACK within source tree and ignore HACKKIT board
313 - grep -r HACK . | grep -v HACKKIT
314 # some statistics about the code base
320 - name: "test/py sandbox"
322 - TEST_PY_BD="sandbox"
325 - name: "test/py sandbox_spl"
327 - TEST_PY_BD="sandbox_spl"
328 TEST_PY_TEST_SPEC="test_ofplatdata"
332 - name: "test/py sandbox_flattree"
334 - TEST_PY_BD="sandbox_flattree"
335 BUILDMAN="^sandbox_flattree$"
337 - name: "test/py vexpress_ca15_tc2"
339 - TEST_PY_BD="vexpress_ca15_tc2"
340 TEST_PY_ID="--id qemu"
341 QEMU_TARGET="arm-softmmu"
342 BUILDMAN="^vexpress_ca15_tc2$"
343 - name: "test/py vexpress_ca9x4"
345 - TEST_PY_BD="vexpress_ca9x4"
346 TEST_PY_ID="--id qemu"
347 QEMU_TARGET="arm-softmmu"
348 BUILDMAN="^vexpress_ca9x4$"
349 - name: "test/py integratorcp_cm926ejs"
351 - TEST_PY_BD="integratorcp_cm926ejs"
352 TEST_PY_TEST_SPEC="not sleep"
353 TEST_PY_ID="--id qemu"
354 QEMU_TARGET="arm-softmmu"
355 BUILDMAN="^integratorcp_cm926ejs$"
356 - name: "test/py qemu_arm"
358 - TEST_PY_BD="qemu_arm"
359 TEST_PY_TEST_SPEC="not sleep"
360 QEMU_TARGET="arm-softmmu"
361 BUILDMAN="^qemu_arm$"
362 - name: "test/py qemu_arm64"
364 - TEST_PY_BD="qemu_arm64"
365 TEST_PY_TEST_SPEC="not sleep"
366 QEMU_TARGET="aarch64-softmmu"
367 BUILDMAN="^qemu_arm64$"
368 - name: "test/py qemu_mips"
370 - TEST_PY_BD="qemu_mips"
371 TEST_PY_TEST_SPEC="not sleep"
372 QEMU_TARGET="mips-softmmu"
373 BUILDMAN="^qemu_mips$"
375 - name: "test/py qemu_mipsel"
377 - TEST_PY_BD="qemu_mipsel"
378 TEST_PY_TEST_SPEC="not sleep"
379 QEMU_TARGET="mipsel-softmmu"
380 BUILDMAN="^qemu_mipsel$"
382 - name: "test/py qemu_mips64"
384 - TEST_PY_BD="qemu_mips64"
385 TEST_PY_TEST_SPEC="not sleep"
386 QEMU_TARGET="mips64-softmmu"
387 BUILDMAN="^qemu_mips64$"
389 - name: "test/py qemu_mips64el"
391 - TEST_PY_BD="qemu_mips64el"
392 TEST_PY_TEST_SPEC="not sleep"
393 QEMU_TARGET="mips64el-softmmu"
394 BUILDMAN="^qemu_mips64el$"
396 - name: "test/py qemu-ppce500"
398 - TEST_PY_BD="qemu-ppce500"
399 TEST_PY_TEST_SPEC="not sleep"
400 QEMU_TARGET="ppc-softmmu"
401 BUILDMAN="^qemu-ppce500$"
403 - name: "test/py qemu-x86"
405 - TEST_PY_BD="qemu-x86"
406 TEST_PY_TEST_SPEC="not sleep"
407 QEMU_TARGET="i386-softmmu"
408 BUILDMAN="^qemu-x86$"
411 - name: "test/py zynq_zc702"
413 - TEST_PY_BD="zynq_zc702"
414 TEST_PY_TEST_SPEC="not sleep"
415 QEMU_TARGET="arm-softmmu"
416 TEST_PY_ID="--id qemu"
417 BUILDMAN="^zynq_zc702$"
418 - name: "test/py xtfpga"
420 - TEST_PY_BD="xtfpga"
421 TEST_PY_TEST_SPEC="not sleep"
422 QEMU_TARGET="xtensa-softmmu"
423 TEST_PY_ID="--id qemu"
425 TOOLCHAIN="xtensa-dc233c-elf"
427 # TODO make it perfect ;-r