Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 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 | |
Tom Rini | 2bb76f3 | 2016-10-20 11:03:19 -0400 | [diff] [blame] | 6 | sudo: required |
| 7 | dist: trusty |
Stephen Warren | e4c1b4d | 2016-02-03 10:41:34 -0700 | [diff] [blame] | 8 | |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 9 | language: c |
| 10 | |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 11 | addons: |
| 12 | apt: |
Tom Rini | 5ac5861 | 2016-10-20 11:26:40 -0400 | [diff] [blame] | 13 | sources: |
| 14 | - sourceline: 'ppa:gns3/qemu' |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 15 | packages: |
| 16 | - cppcheck |
| 17 | - sloccount |
| 18 | - sparse |
| 19 | - bc |
| 20 | - build-essential |
| 21 | - libsdl1.2-dev |
Stephen Warren | 07bf212 | 2016-02-08 18:23:35 -0700 | [diff] [blame] | 22 | - python |
| 23 | - python-virtualenv |
Tom Rini | 5ac5861 | 2016-10-20 11:26:40 -0400 | [diff] [blame] | 24 | - qemu-system-arm |
| 25 | - qemu-system-mips |
| 26 | - qemu-system-ppc |
| 27 | - qemu-system-x86 |
Tom Rini | cd402e0 | 2016-10-20 11:08:26 -0400 | [diff] [blame] | 28 | - gcc-powerpc-linux-gnu |
| 29 | - gcc-arm-linux-gnueabihf |
| 30 | - iasl |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 31 | |
| 32 | install: |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 33 | # install latest device tree compiler |
Tom Rini | 4084c7f | 2016-10-20 11:04:10 -0400 | [diff] [blame] | 34 | - git clone --depth=1 git://git.kernel.org/pub/scm/utils/dtc/dtc.git /tmp/dtc |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 35 | - make -j4 -C /tmp/dtc |
Tom Rini | 5ac5861 | 2016-10-20 11:26:40 -0400 | [diff] [blame] | 36 | # Clone uboot-test-hooks |
| 37 | - git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks |
| 38 | - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname` |
| 39 | - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname` |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 40 | # prepare buildman environment |
| 41 | - export BUILDMAN_ROOT="root:" |
Tom Rini | cd402e0 | 2016-10-20 11:08:26 -0400 | [diff] [blame] | 42 | - echo -e "[toolchain]\n${BUILDMAN_ROOT} /usr" > ~/.buildman |
| 43 | - echo -e "\n[toolchain-alias]\nblackfin = bfin\nsh = sh4\nopenrisc = or32" >> ~/.buildman |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 44 | - cat ~/.buildman |
Stephen Warren | 07bf212 | 2016-02-08 18:23:35 -0700 | [diff] [blame] | 45 | - virtualenv /tmp/venv |
| 46 | - . /tmp/venv/bin/activate |
| 47 | - pip install pytest |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 48 | |
| 49 | env: |
| 50 | global: |
Tom Rini | 5ac5861 | 2016-10-20 11:26:40 -0400 | [diff] [blame] | 51 | - PATH=/tmp/dtc:/tmp/uboot-test-hooks/bin:$PATH |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 52 | - BUILD_DIR=build |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 53 | - HOSTCC="cc" |
| 54 | - HOSTCXX="c++" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 55 | |
| 56 | before_script: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 57 | # install toolchains based on TOOLCHAIN} variable |
| 58 | - if [[ "${TOOLCHAIN}" == *aarch64* ]]; then ./tools/buildman/buildman --fetch-arch aarch64 ; fi |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 59 | - if [[ "${TOOLCHAIN}" == *avr32* ]]; then ./tools/buildman/buildman --fetch-arch avr32 ; fi |
Tom Rini | cd402e0 | 2016-10-20 11:08:26 -0400 | [diff] [blame] | 60 | - if [[ "${TOOLCHAIN}" == *bfin* ]]; then ./tools/buildman/buildman --fetch-arch bfin ; fi |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 61 | - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi |
Tom Rini | cd402e0 | 2016-10-20 11:08:26 -0400 | [diff] [blame] | 62 | - if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 63 | - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi |
Tom Rini | cd402e0 | 2016-10-20 11:08:26 -0400 | [diff] [blame] | 64 | - if [[ "${TOOLCHAIN}" == *or32* ]]; then ./tools/buildman/buildman --fetch-arch or32 ; fi |
| 65 | - if [[ "${TOOLCHAIN}" == *sh4* ]]; then ./tools/buildman/buildman --fetch-arch sh4 ; fi |
| 66 | - if [[ "${TOOLCHAIN}" == *x86_64* ]]; then ./tools/buildman/buildman --fetch-arch x86_64 ; fi |
| 67 | - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then ./tools/buildman/buildman --fetch-arch xtensa ; fi |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 68 | |
| 69 | script: |
Tom Rini | 4899210 | 2016-10-20 11:05:57 -0400 | [diff] [blame] | 70 | # Exit code 129 means warnings only. |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 71 | - if [[ "${BUILDMAN}" != "" ]]; then |
Tom Rini | 4899210 | 2016-10-20 11:05:57 -0400 | [diff] [blame] | 72 | set +e; |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 73 | tools/buildman/buildman ${BUILDMAN}; |
Tom Rini | 4899210 | 2016-10-20 11:05:57 -0400 | [diff] [blame] | 74 | if [[ "$?" == "0" || "$?" == "129" ]]; then |
| 75 | exit 0; |
| 76 | else |
| 77 | exit $?; |
| 78 | fi |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 79 | fi |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 80 | |
| 81 | matrix: |
| 82 | include: |
| 83 | # we need to build by vendor due to 50min time limit for builds |
| 84 | # each env setting here is a dedicated build |
| 85 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 86 | - BUILDMAN="arm1136" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 87 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 88 | - BUILDMAN="arm1176" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 89 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 90 | - BUILDMAN="arm720t" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 91 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 92 | - BUILDMAN="arm920t" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 93 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 94 | - BUILDMAN="atmel -x avr32" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 95 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 96 | - BUILDMAN="avr32" |
| 97 | TOOLCHAIN="avr32" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 98 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 99 | - BUILDMAN="davinci" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 100 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 101 | - BUILDMAN="denx" |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 102 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 103 | - BUILDMAN="freescale -x powerpc,m68k,aarch64" |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 104 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 105 | - BUILDMAN="sandbox x86" |
Tom Rini | cd402e0 | 2016-10-20 11:08:26 -0400 | [diff] [blame] | 106 | TOOLCHAIN="x86_64" |
| 107 | script: |
| 108 | - export BUILDMAN_X86="x86:"; |
| 109 | echo -e "\n[toolchain-prefix]\n${BUILDMAN_X86} ${HOME}/.buildman-toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-" >> ~/.buildman |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 110 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 111 | - BUILDMAN="kirkwood" |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 112 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 113 | - BUILDMAN="m68k" |
| 114 | TOOLCHAIN="m68k" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 115 | - env: |
Tom Rini | 76761e7 | 2016-10-20 11:23:15 -0400 | [diff] [blame] | 116 | - BUILDMAN="microblaze" |
| 117 | TOOLCHAIN="microblaze" |
| 118 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 119 | - BUILDMAN="mips" |
| 120 | TOOLCHAIN="mips" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 121 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 122 | - BUILDMAN="mpc512x" |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 123 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 124 | - BUILDMAN="mpc5xx" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 125 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 126 | - BUILDMAN="mpc5xxx" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 127 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 128 | - BUILDMAN="mpc8260" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 129 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 130 | - BUILDMAN="mpc83xx" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 131 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 132 | - BUILDMAN="mpc85xx -x freescale" |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 133 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 134 | - BUILDMAN="mpc85xx -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x sbc8548 -x bsc91*" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 135 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 136 | - BUILDMAN="t208xrdb t4qds t102*" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 137 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 138 | - BUILDMAN="p1_p2_rdb_pc p1010rdb" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 139 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 140 | - BUILDMAN="corenet_ds b4860qds sbc8548 bsc91*" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 141 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 142 | - BUILDMAN="mpc86xx" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 143 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 144 | - BUILDMAN="mpc8xx" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 145 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 146 | - BUILDMAN="siemens" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 147 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 148 | - BUILDMAN="ti" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 149 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 150 | - BUILDMAN="aarch64" |
| 151 | TOOLCHAIN="aarch64" |
Tom Rini | 76761e7 | 2016-10-20 11:23:15 -0400 | [diff] [blame] | 152 | - env: |
| 153 | - BUILDMAN="sh4" |
| 154 | TOOLCHAIN="sh4" |
| 155 | - env: |
| 156 | - BUILDMAN="xtensa" |
| 157 | TOOLCHAIN="xtensa" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 158 | |
| 159 | # QA jobs for code analytics |
| 160 | # static code analysis with cppcheck (we can add --enable=all later) |
Stephen Warren | d788221 | 2016-10-24 16:41:48 -0600 | [diff] [blame] | 161 | - env: |
| 162 | - JOB="cppcheck" |
| 163 | script: |
Tom Rini | c85b52e | 2016-10-20 11:24:52 -0400 | [diff] [blame] | 164 | - cppcheck --force --quiet --inline-suppr . |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 165 | # search for TODO within source tree |
Stephen Warren | d788221 | 2016-10-24 16:41:48 -0600 | [diff] [blame] | 166 | - env: |
| 167 | - JOB="grep TODO" |
| 168 | script: |
Tom Rini | c85b52e | 2016-10-20 11:24:52 -0400 | [diff] [blame] | 169 | - grep -r TODO . |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 170 | # search for FIXME within source tree |
Stephen Warren | d788221 | 2016-10-24 16:41:48 -0600 | [diff] [blame] | 171 | - env: |
| 172 | - JOB="grep FIXME HACK" |
| 173 | script: |
Tom Rini | c85b52e | 2016-10-20 11:24:52 -0400 | [diff] [blame] | 174 | - grep -r FIXME . |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 175 | # search for HACK within source tree and ignore HACKKIT board |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 176 | script: |
| 177 | - grep -r HACK . | grep -v HACKKIT |
| 178 | # some statistics about the code base |
Stephen Warren | d788221 | 2016-10-24 16:41:48 -0600 | [diff] [blame] | 179 | - env: |
| 180 | - JOB="sloccount" |
| 181 | script: |
Tom Rini | c85b52e | 2016-10-20 11:24:52 -0400 | [diff] [blame] | 182 | - sloccount . |
Stephen Warren | 07bf212 | 2016-02-08 18:23:35 -0700 | [diff] [blame] | 183 | # test/py |
Stephen Warren | d788221 | 2016-10-24 16:41:48 -0600 | [diff] [blame] | 184 | - env: |
| 185 | - JOB="test.py sandbox" |
| 186 | script: |
Tom Rini | c85b52e | 2016-10-20 11:24:52 -0400 | [diff] [blame] | 187 | - ./test/py/test.py --bd sandbox --build |
Tom Rini | 5ac5861 | 2016-10-20 11:26:40 -0400 | [diff] [blame] | 188 | - env: |
Stephen Warren | d788221 | 2016-10-24 16:41:48 -0600 | [diff] [blame] | 189 | - JOB="test.py ARM" |
Tom Rini | 5ac5861 | 2016-10-20 11:26:40 -0400 | [diff] [blame] | 190 | - CROSS_COMPILE="/usr/bin/arm-linux-gnueabihf-" |
| 191 | script: |
| 192 | - ./test/py/test.py --bd vexpress_ca15_tc2 --id qemu --build; |
| 193 | ./test/py/test.py --bd vexpress_ca9x4 --id qemu --build; |
| 194 | ./test/py/test.py --bd integratorcp_cm926ejs --id qemu --build; |
| 195 | - env: |
Stephen Warren | d788221 | 2016-10-24 16:41:48 -0600 | [diff] [blame] | 196 | - JOB="test.py MIPS" |
Tom Rini | 5ac5861 | 2016-10-20 11:26:40 -0400 | [diff] [blame] | 197 | - TOOLCHAIN="mips" |
| 198 | CROSS_COMPILE="${HOME}/.buildman-toolchains/gcc-4.9.0-nolibc/mips-linux/bin/mips-linux-" |
| 199 | script: |
| 200 | - ./test/py/test.py --bd qemu_mips --build -k 'not sleep'; |
| 201 | ./test/py/test.py --bd qemu_mipsel --build -k 'not sleep'; |
| 202 | ./test/py/test.py --bd qemu_mips64 --build -k 'not sleep'; |
| 203 | ./test/py/test.py --bd qemu_mips64el --build -k 'not sleep'; |
| 204 | - env: |
Stephen Warren | d788221 | 2016-10-24 16:41:48 -0600 | [diff] [blame] | 205 | - JOB="test.py PowerPC" |
Tom Rini | 5ac5861 | 2016-10-20 11:26:40 -0400 | [diff] [blame] | 206 | - CROSS_COMPILE="/usr/bin/powerpc-linux-gnu-" |
| 207 | script: |
| 208 | - ./test/py/test.py --bd qemu-ppce500 --build -k 'not sleep' |
| 209 | - env: |
Stephen Warren | d788221 | 2016-10-24 16:41:48 -0600 | [diff] [blame] | 210 | - JOB="test.py x86-64" |
Tom Rini | 5ac5861 | 2016-10-20 11:26:40 -0400 | [diff] [blame] | 211 | - TOOLCHAIN="x86_64" |
| 212 | BUILD_ROM=yes |
| 213 | CROSS_COMPILE="${HOME}/.buildman-toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-" |
| 214 | script: |
| 215 | - ./test/py/test.py --bd qemu-x86 --build -k 'not sleep' |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 216 | |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 217 | # TODO make it perfect ;-r |