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: |
| 13 | packages: |
| 14 | - cppcheck |
| 15 | - sloccount |
| 16 | - sparse |
| 17 | - bc |
| 18 | - build-essential |
| 19 | - libsdl1.2-dev |
Stephen Warren | 07bf212 | 2016-02-08 18:23:35 -0700 | [diff] [blame] | 20 | - python |
| 21 | - python-virtualenv |
Tom Rini | cd402e0 | 2016-10-20 11:08:26 -0400 | [diff] [blame^] | 22 | - gcc-powerpc-linux-gnu |
| 23 | - gcc-arm-linux-gnueabihf |
| 24 | - iasl |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 25 | |
| 26 | install: |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 27 | # install latest device tree compiler |
Tom Rini | 4084c7f | 2016-10-20 11:04:10 -0400 | [diff] [blame] | 28 | - 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] | 29 | - make -j4 -C /tmp/dtc |
| 30 | # prepare buildman environment |
| 31 | - export BUILDMAN_ROOT="root:" |
Tom Rini | cd402e0 | 2016-10-20 11:08:26 -0400 | [diff] [blame^] | 32 | - echo -e "[toolchain]\n${BUILDMAN_ROOT} /usr" > ~/.buildman |
| 33 | - echo -e "\n[toolchain-alias]\nblackfin = bfin\nsh = sh4\nopenrisc = or32" >> ~/.buildman |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 34 | - cat ~/.buildman |
Stephen Warren | 07bf212 | 2016-02-08 18:23:35 -0700 | [diff] [blame] | 35 | - virtualenv /tmp/venv |
| 36 | - . /tmp/venv/bin/activate |
| 37 | - pip install pytest |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 38 | |
| 39 | env: |
| 40 | global: |
| 41 | - PATH=/tmp/dtc:$PATH |
| 42 | - BUILD_DIR=build |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 43 | - HOSTCC="cc" |
| 44 | - HOSTCXX="c++" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 45 | |
| 46 | before_script: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 47 | # install toolchains based on TOOLCHAIN} variable |
| 48 | - if [[ "${TOOLCHAIN}" == *aarch64* ]]; then ./tools/buildman/buildman --fetch-arch aarch64 ; fi |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 49 | - if [[ "${TOOLCHAIN}" == *avr32* ]]; then ./tools/buildman/buildman --fetch-arch avr32 ; fi |
Tom Rini | cd402e0 | 2016-10-20 11:08:26 -0400 | [diff] [blame^] | 50 | - if [[ "${TOOLCHAIN}" == *bfin* ]]; then ./tools/buildman/buildman --fetch-arch bfin ; fi |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 51 | - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi |
Tom Rini | cd402e0 | 2016-10-20 11:08:26 -0400 | [diff] [blame^] | 52 | - if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 53 | - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi |
Tom Rini | cd402e0 | 2016-10-20 11:08:26 -0400 | [diff] [blame^] | 54 | - if [[ "${TOOLCHAIN}" == *or32* ]]; then ./tools/buildman/buildman --fetch-arch or32 ; fi |
| 55 | - if [[ "${TOOLCHAIN}" == *sh4* ]]; then ./tools/buildman/buildman --fetch-arch sh4 ; fi |
| 56 | - if [[ "${TOOLCHAIN}" == *x86_64* ]]; then ./tools/buildman/buildman --fetch-arch x86_64 ; fi |
| 57 | - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then ./tools/buildman/buildman --fetch-arch xtensa ; fi |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 58 | |
| 59 | script: |
| 60 | # the execution sequence for each test |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 61 | - if [[ "${TEST_CMD}" != "" ]]; then |
| 62 | ${TEST_CMD}; |
| 63 | fi |
Tom Rini | 4899210 | 2016-10-20 11:05:57 -0400 | [diff] [blame] | 64 | # Exit code 129 means warnings only. |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 65 | - if [[ "${BUILDMAN}" != "" ]]; then |
Tom Rini | 4899210 | 2016-10-20 11:05:57 -0400 | [diff] [blame] | 66 | set +e; |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 67 | tools/buildman/buildman ${BUILDMAN}; |
Tom Rini | 4899210 | 2016-10-20 11:05:57 -0400 | [diff] [blame] | 68 | if [[ "$?" == "0" || "$?" == "129" ]]; then |
| 69 | exit 0; |
| 70 | else |
| 71 | exit $?; |
| 72 | fi |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 73 | fi |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 74 | |
| 75 | matrix: |
| 76 | include: |
| 77 | # we need to build by vendor due to 50min time limit for builds |
| 78 | # each env setting here is a dedicated build |
| 79 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 80 | - BUILDMAN="arm1136" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 81 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 82 | - BUILDMAN="arm1136" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 83 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 84 | - BUILDMAN="arm1176" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 85 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 86 | - BUILDMAN="arm720t" |
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="arm920t" |
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="atmel -x avr32" |
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="avr32" |
| 93 | TOOLCHAIN="avr32" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 94 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 95 | - BUILDMAN="davinci" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 96 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 97 | - BUILDMAN="denx" |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 98 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 99 | - BUILDMAN="freescale -x powerpc,m68k,aarch64" |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 100 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 101 | - BUILDMAN="sandbox x86" |
Tom Rini | cd402e0 | 2016-10-20 11:08:26 -0400 | [diff] [blame^] | 102 | TOOLCHAIN="x86_64" |
| 103 | script: |
| 104 | - export BUILDMAN_X86="x86:"; |
| 105 | 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] | 106 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 107 | - BUILDMAN="kirkwood" |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 108 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 109 | - BUILDMAN="m68k" |
| 110 | TOOLCHAIN="m68k" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 111 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 112 | - BUILDMAN="mips" |
| 113 | TOOLCHAIN="mips" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 114 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 115 | - BUILDMAN="mpc512x" |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 116 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 117 | - BUILDMAN="mpc5xx" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 118 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 119 | - BUILDMAN="mpc5xxx" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 120 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 121 | - BUILDMAN="mpc8260" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 122 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 123 | - BUILDMAN="mpc83xx" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 124 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 125 | - BUILDMAN="mpc85xx -x freescale" |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 126 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 127 | - 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] | 128 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 129 | - BUILDMAN="t208xrdb t4qds t102*" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 130 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 131 | - BUILDMAN="p1_p2_rdb_pc p1010rdb" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 132 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 133 | - BUILDMAN="corenet_ds b4860qds sbc8548 bsc91*" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 134 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 135 | - BUILDMAN="mpc86xx" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 136 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 137 | - BUILDMAN="mpc8xx" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 138 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 139 | - BUILDMAN="siemens" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 140 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 141 | - BUILDMAN="ti" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 142 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 143 | - BUILDMAN="aarch64" |
| 144 | TOOLCHAIN="aarch64" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 145 | |
| 146 | # QA jobs for code analytics |
| 147 | # static code analysis with cppcheck (we can add --enable=all later) |
| 148 | - env: |
| 149 | - TEST_CMD="cppcheck --force --quiet --inline-suppr ." |
| 150 | # search for TODO within source tree |
| 151 | - env: |
| 152 | - TEST_CMD="grep -r TODO ." |
| 153 | # search for FIXME within source tree |
| 154 | - env: |
| 155 | - TEST_CMD="grep -r FIXME ." |
| 156 | # search for HACK within source tree and ignore HACKKIT board |
| 157 | - env: |
| 158 | - TEST_CMD="grep -r HACK . | grep -v HACKKIT" |
| 159 | script: |
| 160 | - grep -r HACK . | grep -v HACKKIT |
| 161 | # some statistics about the code base |
| 162 | - env: |
| 163 | - TEST_CMD="sloccount ." |
Stephen Warren | 07bf212 | 2016-02-08 18:23:35 -0700 | [diff] [blame] | 164 | # test/py |
| 165 | - env: |
| 166 | - TEST_CMD="./test/py/test.py --bd sandbox --build" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 167 | |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 168 | # TODO make it perfect ;-r |