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
32 - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
33 - sudo apt-get update -q
34 - sudo apt-get install libisl15 -y
37 # Clone uboot-test-hooks
38 - git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
39 - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
40 - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
41 # prepare buildman environment
42 - echo -e "[toolchain]\nroot = /usr" > ~/.buildman
43 - echo -e "arc = /tmp/arc_gnu_2017.09_prebuilt_uclibc_le_archs_linux_install" >> ~/.buildman
44 - echo -e "\n[toolchain-alias]\nsh = sh2\n" >> ~/.buildman
46 - virtualenv /tmp/venv
47 - . /tmp/venv/bin/activate
49 - grub-mkimage -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
51 - ( 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 )
53 - ( 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 )
57 - PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin
58 - PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci
64 # install toolchains based on TOOLCHAIN} variable
65 - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi
66 - if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi
67 - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi
68 - if [[ "${TOOLCHAIN}" == *or32* ]]; then ./tools/buildman/buildman --fetch-arch or32 ; fi
69 - if [[ "${TOOLCHAIN}" == *sh* ]]; then ./tools/buildman/buildman --fetch-arch sh2 ; fi
70 - if [[ "${TOOLCHAIN}" == *x86_64* ]]; then
71 ./tools/buildman/buildman --fetch-arch x86_64;
72 echo -e "\n[toolchain-prefix]\nx86 = ${HOME}/.buildman-toolchains/gcc-7.3.0-nolibc/x86_64-linux/bin/x86_64-linux-" >> ~/.buildman;
74 - if [[ "${TOOLCHAIN}" == arc ]]; then
75 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 &&
76 tar -C /tmp -xf arc_gnu_2017.09_prebuilt_uclibc_le_archs_linux_install.tar.gz;
78 - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then
79 wget https://github.com/foss-xtensa/toolchain/releases/download/2018.02/x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
80 tar -C /tmp -xf x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
81 echo -e "\n[toolchain-prefix]\nxtensa = /tmp/2018.02/${TOOLCHAIN}/bin/${TOOLCHAIN}-" >> ~/.buildman;
83 # If TOOLCHAIN is unset, we're on some flavour of ARM.
84 - if [[ "${TOOLCHAIN}" == "" ]]; then
85 ./tools/buildman/buildman --fetch-arch arm &&
86 ./tools/buildman/buildman --fetch-arch aarch64;
88 - if [[ "${TOOLCHAIN}" == "powerpc" ]]; then ./tools/buildman/buildman --fetch-arch powerpc; fi
89 - if [[ "${TOOLCHAIN}" == "riscv" ]]; then
90 ./tools/buildman/buildman --fetch-arch riscv64;
91 echo -e "\n[toolchain-alias]\nriscv = riscv64" >> ~/.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
148 - name: "buildman arc"
152 - name: "buildman arm11 arm7 arm920t arm946es"
154 - BUILDMAN="arm11 arm7 arm920t arm946es"
155 - name: "buildman arm926ejs (non-mx,siemens,atmel,kirkwood)"
158 BUILDMAN="arm926ejs -x mx,siemens,atmel,kirkwood"
159 - name: "buildman atmel"
162 - name: "buildman boundary engicam toradex"
164 - BUILDMAN="boundary engicam toradex"
165 - name: "buildman Freescale ARM32"
167 - BUILDMAN="freescale -x powerpc,m68k,aarch64"
168 - name: "buildman Freescale AArch64"
170 - BUILDMAN="freescale&aarch64"
171 - name: "buildman i.MX6 (non-Freescale)"
173 - BUILDMAN="mx6 -x freescale,toradex,boundary,engicam"
174 - name: "buildman i.MX (non-Freescale,i.MX6,toradex)"
176 - BUILDMAN="mx -x freescale,mx6,toradex"
177 - name: "buildman k2"
180 - name: "buildman samsung socfpga"
182 - BUILDMAN="samsung socfpga"
183 - name: "buildman sun4i"
186 - name: "buildman sun5i"
189 - name: "buildman sun6i"
192 - name: "buildman sun7i"
195 - name: "buildman sun8i"
198 - name: "buildman sun9i"
201 - name: "buildman sun50i"
204 - name: "buildman catch-all ARM"
206 - 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"
207 - name: "buildman sandbox x86"
209 - BUILDMAN="sandbox x86"
211 - name: "buildman kirkwood (excluding openrd)"
213 - BUILDMAN="kirkwood -x openrd"
214 - name: "buildman mvebu"
217 - name: "buildman PXA (non-toradex)"
219 - BUILDMAN="pxa -x toradex"
220 - name: "buildman m68k"
224 - name: "buildman microblaze"
226 - BUILDMAN="microblaze"
227 TOOLCHAIN="microblaze"
228 - name: "buildman mips"
232 - name: "buildman non-Freescale PowerPC"
234 - BUILDMAN="powerpc -x freescale"
236 - name: "buildman mpc85xx&freescale (excluding many)"
238 - BUILDMAN="mpc85xx&freescale -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x bsc91*"
240 - name: "buildman t208xrdb corenet_ds"
242 - BUILDMAN="t208xrdb corenet_ds"
244 - name: "buildman Freescale PowerPC"
246 - BUILDMAN="t4qds b4860qds mpc83xx&freescale mpc86xx&freescale"
248 - name: "buildman t102*"
252 - name: "buildman p1_p2_rdb_pc"
254 - BUILDMAN="p1_p2_rdb_pc"
256 - name: "buildman p1010rdb bsc91"
258 - BUILDMAN="p1010rdb bsc91"
260 - name: "buildman siemens"
263 - name: "buildman tegra"
265 - BUILDMAN="tegra -x toradex"
266 - name: "buildman am33xx (no siemens)"
268 - BUILDMAN="am33xx -x siemens"
269 - name: "buildman omap"
272 - name: "buildman uniphier"
274 - BUILDMAN="uniphier"
275 - name: "buildman catch-all AArch64"
277 - BUILDMAN="aarch64 -x tegra,freescale,mvebu,uniphier,sunxi,samsung,rockchip,xilinx"
278 - name: "buildman rockchip"
280 - BUILDMAN="rockchip"
281 - name: "buildman sh"
283 - BUILDMAN="sh -x arm"
285 - name: "buildman Xilinx (ARM)"
287 - BUILDMAN="xilinx -x microblaze"
288 - name: "buildman xtensa"
291 TOOLCHAIN="xtensa-dc233c-elf"
292 - name: "buildman riscv"
297 # QA jobs for code analytics
298 # static code analysis with cppcheck (we can add --enable=all later)
301 - cppcheck --force --quiet --inline-suppr .
302 # search for TODO within source tree
306 # search for FIXME within source tree
307 - name: "grep FIXME HACK"
310 # search for HACK within source tree and ignore HACKKIT board
312 - grep -r HACK . | grep -v HACKKIT
313 # some statistics about the code base
319 - name: "test/py sandbox"
321 - TEST_PY_BD="sandbox"
324 - name: "test/py sandbox_spl"
326 - TEST_PY_BD="sandbox_spl"
327 TEST_PY_TEST_SPEC="test_ofplatdata"
331 - name: "test/py sandbox_flattree"
333 - TEST_PY_BD="sandbox_flattree"
334 BUILDMAN="^sandbox_flattree$"
336 - name: "test/py vexpress_ca15_tc2"
338 - TEST_PY_BD="vexpress_ca15_tc2"
339 TEST_PY_ID="--id qemu"
340 QEMU_TARGET="arm-softmmu"
341 BUILDMAN="^vexpress_ca15_tc2$"
342 - name: "test/py vexpress_ca9x4"
344 - TEST_PY_BD="vexpress_ca9x4"
345 TEST_PY_ID="--id qemu"
346 QEMU_TARGET="arm-softmmu"
347 BUILDMAN="^vexpress_ca9x4$"
348 - name: "test/py integratorcp_cm926ejs"
350 - TEST_PY_BD="integratorcp_cm926ejs"
351 TEST_PY_TEST_SPEC="not sleep"
352 TEST_PY_ID="--id qemu"
353 QEMU_TARGET="arm-softmmu"
354 BUILDMAN="^integratorcp_cm926ejs$"
355 - name: "test/py qemu_arm"
357 - TEST_PY_BD="qemu_arm"
358 TEST_PY_TEST_SPEC="not sleep"
359 QEMU_TARGET="arm-softmmu"
360 BUILDMAN="^qemu_arm$"
361 - name: "test/py qemu_arm64"
363 - TEST_PY_BD="qemu_arm64"
364 TEST_PY_TEST_SPEC="not sleep"
365 QEMU_TARGET="aarch64-softmmu"
366 BUILDMAN="^qemu_arm64$"
367 - name: "test/py qemu_mips"
369 - TEST_PY_BD="qemu_mips"
370 TEST_PY_TEST_SPEC="not sleep"
371 QEMU_TARGET="mips-softmmu"
372 BUILDMAN="^qemu_mips$"
374 - name: "test/py qemu_mipsel"
376 - TEST_PY_BD="qemu_mipsel"
377 TEST_PY_TEST_SPEC="not sleep"
378 QEMU_TARGET="mipsel-softmmu"
379 BUILDMAN="^qemu_mipsel$"
381 - name: "test/py qemu_mips64"
383 - TEST_PY_BD="qemu_mips64"
384 TEST_PY_TEST_SPEC="not sleep"
385 QEMU_TARGET="mips64-softmmu"
386 BUILDMAN="^qemu_mips64$"
388 - name: "test/py qemu_mips64el"
390 - TEST_PY_BD="qemu_mips64el"
391 TEST_PY_TEST_SPEC="not sleep"
392 QEMU_TARGET="mips64el-softmmu"
393 BUILDMAN="^qemu_mips64el$"
395 - name: "test/py qemu-ppce500"
397 - TEST_PY_BD="qemu-ppce500"
398 TEST_PY_TEST_SPEC="not sleep"
399 QEMU_TARGET="ppc-softmmu"
400 BUILDMAN="^qemu-ppce500$"
402 - name: "test/py qemu-x86"
404 - TEST_PY_BD="qemu-x86"
405 TEST_PY_TEST_SPEC="not sleep"
406 QEMU_TARGET="i386-softmmu"
407 BUILDMAN="^qemu-x86$"
410 - name: "test/py zynq_zc702"
412 - TEST_PY_BD="zynq_zc702"
413 TEST_PY_TEST_SPEC="not sleep"
414 QEMU_TARGET="arm-softmmu"
415 TEST_PY_ID="--id qemu"
416 BUILDMAN="^zynq_zc702$"
417 - name: "test/py xtfpga"
419 - TEST_PY_BD="xtfpga"
420 TEST_PY_TEST_SPEC="not sleep"
421 QEMU_TARGET="xtensa-softmmu"
422 TEST_PY_ID="--id qemu"
424 TOOLCHAIN="xtensa-dc233c-elf"
426 # TODO make it perfect ;-r