1# Copyright Roger Meier <r.meier@siemens.com> 2# SPDX-License-Identifier: GPL-2.0+ 3 4# build U-Boot on Travis CI - https://travis-ci.org/ 5 6sudo: required 7dist: trusty 8 9language: c 10 11addons: 12 apt: 13 sources: 14 - sourceline: 'ppa:gns3/qemu' 15 packages: 16 - cppcheck 17 - sloccount 18 - sparse 19 - bc 20 - build-essential 21 - libsdl1.2-dev 22 - python 23 - python-virtualenv 24 - qemu-system-arm 25 - qemu-system-mips 26 - qemu-system-ppc 27 - qemu-system-x86 28 - gcc-powerpc-linux-gnu 29 - gcc-arm-linux-gnueabihf 30 - gcc-aarch64-linux-gnu 31 - iasl 32 33install: 34 # install latest device tree compiler 35 - git clone --depth=1 git://git.kernel.org/pub/scm/utils/dtc/dtc.git /tmp/dtc 36 - make -j4 -C /tmp/dtc 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 "\n[toolchain-alias]\nblackfin = bfin\nsh = sh4\nopenrisc = or32" >> ~/.buildman 44 - cat ~/.buildman 45 - virtualenv /tmp/venv 46 - . /tmp/venv/bin/activate 47 - pip install pytest 48 49env: 50 global: 51 - PATH=/tmp/dtc:/tmp/uboot-test-hooks/bin:$PATH 52 - BUILD_DIR=build 53 - HOSTCC="cc" 54 - HOSTCXX="c++" 55 56before_script: 57 # install toolchains based on TOOLCHAIN} variable 58 - if [[ "${TOOLCHAIN}" == *avr32* ]]; then ./tools/buildman/buildman --fetch-arch avr32 ; fi 59 - if [[ "${TOOLCHAIN}" == *bfin* ]]; then ./tools/buildman/buildman --fetch-arch bfin ; fi 60 - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi 61 - if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi 62 - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi 63 - if [[ "${TOOLCHAIN}" == *or32* ]]; then ./tools/buildman/buildman --fetch-arch or32 ; fi 64 - if [[ "${TOOLCHAIN}" == *sh4* ]]; then ./tools/buildman/buildman --fetch-arch sh4 ; fi 65 - if [[ "${TOOLCHAIN}" == *x86_64* ]]; then 66 ./tools/buildman/buildman --fetch-arch x86_64; 67 echo -e "\n[toolchain-prefix]\nx86 = ${HOME}/.buildman-toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-" >> ~/.buildman; 68 fi 69 - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then ./tools/buildman/buildman --fetch-arch xtensa ; fi 70 71script: 72 # Comments must be outside the command strings below, or the Travis parser 73 # will get confused. 74 # 75 # Exit code 129 means warnings only. 76 - if [[ "${BUILDMAN}" != "" ]]; then 77 set +e; 78 tools/buildman/buildman -P ${BUILDMAN}; 79 ret=$?; 80 if [[ $ret -ne 0 && $ret -ne 129 ]]; then 81 tools/buildman/buildman -sdeP ${BUILDMAN}; 82 exit $ret; 83 fi; 84 fi 85 # "not a_test_which_does_not_exist" is a dummy -k parameter which will 86 # never prevent any test from running. That way, we can always pass 87 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom 88 # value. 89 - if [[ "${TEST_PY_BD}" != "" ]]; then 90 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID} 91 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}" 92 --build-dir `cd .. && pwd`/.bm-work/${TEST_PY_BD}; 93 fi 94 95matrix: 96 include: 97 # we need to build by vendor due to 50min time limit for builds 98 # each env setting here is a dedicated build 99 - env: 100 - BUILDMAN="arm11" 101 - env: 102 - BUILDMAN="arm7" 103 - env: 104 - BUILDMAN="arm920t" 105 - env: 106 - JOB="arm926ejs" 107 BUILDMAN="arm926ejs -x mx,siemens,atmel" 108 - env: 109 - BUILDMAN="arm946es" 110 - env: 111 - BUILDMAN="atmel -x avr32" 112 - env: 113 - BUILDMAN="avr32" 114 TOOLCHAIN="avr32" 115 - env: 116 - BUILDMAN="denx" 117 - env: 118 - JOB="Freescale ARM" 119 BUILDMAN="freescale -x powerpc,m68k" 120 - env: 121 - JOB="i.MX (non-Freescale)" 122 BUILDMAN="mx -x freescale" 123 - env: 124 - BUILDMAN="sun4i" 125 - env: 126 - BUILDMAN="sun5i" 127 - env: 128 - BUILDMAN="sun6i" 129 - env: 130 - BUILDMAN="sun7i" 131 - env: 132 - BUILDMAN="sun8i" 133 - env: 134 - BUILDMAN="sun9i" 135 - env: 136 - BUILDMAN="sun50i" 137 - env: 138 - JOB="Catch-all ARM" 139 BUILDMAN="arm -x arm11,arm7,arm9,aarch64,atmel,denx,freescale,kirkwood,siemens,tegra,uniphier,mx,sunxi,am33xx,omap3,omap4,omap5,pxa" 140 - env: 141 - BUILDMAN="sandbox x86" 142 TOOLCHAIN="x86_64" 143 - env: 144 - BUILDMAN="kirkwood" 145 - env: 146 - BUILDMAN="pxa" 147 - env: 148 - BUILDMAN="m68k" 149 TOOLCHAIN="m68k" 150 - env: 151 - BUILDMAN="microblaze" 152 TOOLCHAIN="microblaze" 153 - env: 154 - BUILDMAN="mips" 155 TOOLCHAIN="mips" 156 - env: 157 - BUILDMAN="mpc512x" 158 - env: 159 - BUILDMAN="mpc5xx" 160 - env: 161 - BUILDMAN="mpc5xxx" 162 - env: 163 - BUILDMAN="mpc8260" 164 - env: 165 - BUILDMAN="mpc83xx" 166 - env: 167 - BUILDMAN="mpc85xx -x freescale" 168 - env: 169 - BUILDMAN="mpc85xx -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x sbc8548 -x bsc91*" 170 - env: 171 - BUILDMAN="t208xrdb t4qds t102*" 172 - env: 173 - BUILDMAN="p1_p2_rdb_pc p1010rdb" 174 - env: 175 - BUILDMAN="corenet_ds b4860qds sbc8548 bsc91*" 176 - env: 177 - BUILDMAN="mpc86xx" 178 - env: 179 - BUILDMAN="mpc8xx" 180 - env: 181 - BUILDMAN="siemens" 182 - env: 183 - BUILDMAN="tegra" 184 - env: 185 - JOB="am33xx" 186 BUILDMAN="am33xx -x siemens" 187 - env: 188 - BUILDMAN="omap3" 189 - env: 190 - BUILDMAN="omap4" 191 - env: 192 - BUILDMAN="omap5" 193 - env: 194 - BUILDMAN="uniphier" 195 - env: 196 - BUILDMAN="aarch64 -x tegra,freescale,uniphier,sunxi" 197 TOOLCHAIN="aarch64" 198 - env: 199 - BUILDMAN="sh4" 200 TOOLCHAIN="sh4" 201 - env: 202 - BUILDMAN="xtensa" 203 TOOLCHAIN="xtensa" 204 205 # QA jobs for code analytics 206 # static code analysis with cppcheck (we can add --enable=all later) 207 - env: 208 - JOB="cppcheck" 209 script: 210 - cppcheck --force --quiet --inline-suppr . 211 # search for TODO within source tree 212 - env: 213 - JOB="grep TODO" 214 script: 215 - grep -r TODO . 216 # search for FIXME within source tree 217 - env: 218 - JOB="grep FIXME HACK" 219 script: 220 - grep -r FIXME . 221 # search for HACK within source tree and ignore HACKKIT board 222 script: 223 - grep -r HACK . | grep -v HACKKIT 224 # some statistics about the code base 225 - env: 226 - JOB="sloccount" 227 script: 228 - sloccount . 229 230 # test/py 231 - env: 232 - TEST_PY_BD="sandbox" 233 BUILDMAN="^sandbox$" 234 TOOLCHAIN="x86_64" 235 - env: 236 - TEST_PY_BD="vexpress_ca15_tc2" 237 TEST_PY_ID="--id qemu" 238 BUILDMAN="^vexpress_ca15_tc2$" 239 - env: 240 - TEST_PY_BD="vexpress_ca9x4" 241 TEST_PY_ID="--id qemu" 242 BUILDMAN="^vexpress_ca9x4$" 243 - env: 244 - TEST_PY_BD="integratorcp_cm926ejs" 245 TEST_PY_ID="--id qemu" 246 BUILDMAN="^integratorcp_cm926ejs$" 247 - env: 248 - TEST_PY_BD="qemu_mips" 249 TEST_PY_TEST_SPEC="not sleep" 250 BUILDMAN="^qemu_mips$" 251 TOOLCHAIN="mips" 252 - env: 253 - TEST_PY_BD="qemu_mipsel" 254 TEST_PY_TEST_SPEC="not sleep" 255 BUILDMAN="^qemu_mipsel$" 256 TOOLCHAIN="mips" 257 - env: 258 - TEST_PY_BD="qemu_mips64" 259 TEST_PY_TEST_SPEC="not sleep" 260 BUILDMAN="^qemu_mips64$" 261 TOOLCHAIN="mips" 262 - env: 263 - TEST_PY_BD="qemu_mips64el" 264 TEST_PY_TEST_SPEC="not sleep" 265 BUILDMAN="^qemu_mips64el$" 266 TOOLCHAIN="mips" 267 - env: 268 - TEST_PY_BD="qemu-ppce500" 269 TEST_PY_TEST_SPEC="not sleep" 270 BUILDMAN="^qemu-ppce500$" 271 - env: 272 - TEST_PY_BD="qemu-x86" 273 TEST_PY_TEST_SPEC="not sleep" 274 BUILDMAN="^qemu-x86$" 275 TOOLCHAIN="x86_64" 276 BUILD_ROM="yes" 277 278# TODO make it perfect ;-r 279