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 |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 22 | |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 23 | cache: |
| 24 | - apt |
| 25 | |
| 26 | install: |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 27 | # install latest device tree compiler |
| 28 | - git clone --depth=1 https://git.kernel.org/pub/scm/utils/dtc/dtc.git /tmp/dtc |
| 29 | - make -j4 -C /tmp/dtc |
| 30 | # prepare buildman environment |
| 31 | - export BUILDMAN_ROOT="root:" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 32 | - export BUILDMAN_PPC="ppc:" |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 33 | - export BUILDMAN_ARM="arm:" |
| 34 | - export BUILDMAN_SANDBOX="sandbox:" |
| 35 | - echo -e "[toolchain]\n${BUILDMAN_ROOT} /\n" > ~/.buildman |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 36 | - echo -e "${BUILDMAN_PPC} /opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux/\n" >> ~/.buildman |
| 37 | - echo -e "${BUILDMAN_ARM} /opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi/\n" >> ~/.buildman |
| 38 | - echo -e "${BUILDMAN_SANDBOX} /usr/bin/gcc\n" >> ~/.buildman |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 39 | - export BUILDMAN_ALIAS="x86:" |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 40 | - export BUILDMAN_ALIAS_ARM="arm:" |
| 41 | - echo -e "\n\n[toolchain-alias]\n${BUILDMAN_ALIAS} i386\n" >> ~/.buildman |
| 42 | - echo -e "${BUILDMAN_ALIAS_ARM} armv5te\n" >> ~/.buildman |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 43 | - cat ~/.buildman |
Stephen Warren | 07bf212 | 2016-02-08 18:23:35 -0700 | [diff] [blame] | 44 | - virtualenv /tmp/venv |
| 45 | - . /tmp/venv/bin/activate |
| 46 | - pip install pytest |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 47 | |
| 48 | env: |
| 49 | global: |
| 50 | - PATH=/tmp/dtc:$PATH |
| 51 | - BUILD_DIR=build |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 52 | - HOSTCC="cc" |
| 53 | - HOSTCXX="c++" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 54 | |
| 55 | before_script: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 56 | # install toolchains based on TOOLCHAIN} variable |
| 57 | - if [[ "${TOOLCHAIN}" == *aarch64* ]]; then ./tools/buildman/buildman --fetch-arch aarch64 ; fi |
| 58 | - if [[ "${TOOLCHAIN}" == *arm* ]]; then wget ftp://ftp.denx.de/pub/eldk/5.4/targets/armv5te/eldk-eglibc-i686-arm-toolchain-gmae-5.4.sh ; fi |
| 59 | - if [[ "${TOOLCHAIN}" == *arm* ]]; then sh eldk-eglibc-i686-arm-toolchain-gmae-5.4.sh -y ; fi |
| 60 | - if [[ "${TOOLCHAIN}" == *avr32* ]]; then ./tools/buildman/buildman --fetch-arch avr32 ; fi |
| 61 | - if [[ "${TOOLCHAIN}" == *i386* ]]; then ./tools/buildman/buildman sandbox --fetch-arch i386 ; fi |
| 62 | - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi |
| 63 | - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi |
| 64 | - if [[ "${TOOLCHAIN}" == *ppc* ]]; then wget ftp://ftp.denx.de/pub/eldk/5.4/targets/powerpc/eldk-eglibc-i686-powerpc-toolchain-gmae-5.4.sh ; fi |
| 65 | - if [[ "${TOOLCHAIN}" == *ppc* ]]; then sh eldk-eglibc-i686-powerpc-toolchain-gmae-5.4.sh -y ; fi |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 66 | |
| 67 | script: |
| 68 | # the execution sequence for each test |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 69 | - if [[ "${TEST_CMD}" != "" ]]; then |
| 70 | ${TEST_CMD}; |
| 71 | fi |
| 72 | - if [[ "${BUILDMAN}" != "" ]]; then |
| 73 | tools/buildman/buildman ${BUILDMAN}; |
| 74 | fi |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 75 | |
| 76 | matrix: |
| 77 | include: |
| 78 | # we need to build by vendor due to 50min time limit for builds |
| 79 | # each env setting here is a dedicated build |
| 80 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 81 | - BUILDMAN="arm1136" |
| 82 | TOOLCHAIN="arm" |
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="arm1136" |
| 85 | TOOLCHAIN="arm" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 86 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 87 | - BUILDMAN="arm1176" |
| 88 | TOOLCHAIN="arm" |
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" |
| 91 | TOOLCHAIN="arm" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 92 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 93 | - BUILDMAN="arm920t" |
| 94 | TOOLCHAIN="arm" |
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="atmel -x avr32" |
| 97 | TOOLCHAIN="arm" |
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="avr32" |
| 100 | TOOLCHAIN="avr32" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 101 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 102 | - BUILDMAN="davinci" |
| 103 | TOOLCHAIN="arm" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 104 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 105 | - BUILDMAN="denx" |
| 106 | TOOLCHAIN="arm" |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 107 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 108 | - BUILDMAN="freescale -x powerpc,m68k,aarch64" |
| 109 | TOOLCHAIN="arm" |
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="sandbox x86" |
| 112 | TOOLCHAIN="i386" |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 113 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 114 | - BUILDMAN="kirkwood" |
| 115 | TOOLCHAIN="arm" |
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="m68k" |
| 118 | TOOLCHAIN="m68k" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 119 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 120 | - BUILDMAN="mips" |
| 121 | TOOLCHAIN="mips" |
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="mpc512x" |
| 124 | TOOLCHAIN="ppc" |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 125 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 126 | - BUILDMAN="mpc5xx" |
| 127 | TOOLCHAIN="ppc" |
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="mpc5xxx" |
| 130 | TOOLCHAIN="ppc" |
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="mpc8260" |
| 133 | TOOLCHAIN="ppc" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 134 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 135 | - BUILDMAN="mpc83xx" |
| 136 | TOOLCHAIN="ppc" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 137 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 138 | - BUILDMAN="mpc85xx -x freescale" |
| 139 | TOOLCHAIN="ppc" |
Heiko Schocher | d9aa019 | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 140 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 141 | - BUILDMAN="mpc85xx -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x sbc8548 -x bsc91*" |
| 142 | TOOLCHAIN="ppc" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 143 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 144 | - BUILDMAN="t208xrdb t4qds t102*" |
| 145 | TOOLCHAIN="ppc" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 146 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 147 | - BUILDMAN="p1_p2_rdb_pc p1010rdb" |
| 148 | TOOLCHAIN="ppc" |
Heiko Schocher | 8cb2101 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 149 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 150 | - BUILDMAN="corenet_ds b4860qds sbc8548 bsc91*" |
| 151 | TOOLCHAIN="ppc" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 152 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 153 | - BUILDMAN="mpc86xx" |
| 154 | TOOLCHAIN="ppc" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 155 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 156 | - BUILDMAN="mpc8xx" |
| 157 | TOOLCHAIN="ppc" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 158 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 159 | - BUILDMAN="siemens" |
| 160 | TOOLCHAIN="arm" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 161 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 162 | - BUILDMAN="ti" |
| 163 | TOOLCHAIN="arm" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 164 | - env: |
Roger Meier | 050c756 | 2016-01-25 20:22:41 +0100 | [diff] [blame] | 165 | - BUILDMAN="aarch64" |
| 166 | TOOLCHAIN="aarch64" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 167 | |
| 168 | # QA jobs for code analytics |
| 169 | # static code analysis with cppcheck (we can add --enable=all later) |
| 170 | - env: |
| 171 | - TEST_CMD="cppcheck --force --quiet --inline-suppr ." |
| 172 | # search for TODO within source tree |
| 173 | - env: |
| 174 | - TEST_CMD="grep -r TODO ." |
| 175 | # search for FIXME within source tree |
| 176 | - env: |
| 177 | - TEST_CMD="grep -r FIXME ." |
| 178 | # search for HACK within source tree and ignore HACKKIT board |
| 179 | - env: |
| 180 | - TEST_CMD="grep -r HACK . | grep -v HACKKIT" |
| 181 | script: |
| 182 | - grep -r HACK . | grep -v HACKKIT |
| 183 | # some statistics about the code base |
| 184 | - env: |
| 185 | - TEST_CMD="sloccount ." |
Stephen Warren | 07bf212 | 2016-02-08 18:23:35 -0700 | [diff] [blame] | 186 | # test/py |
| 187 | - env: |
| 188 | - TEST_CMD="./test/py/test.py --bd sandbox --build" |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 189 | |
Meier, Roger | c7cb334 | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 190 | # TODO make it perfect ;-r |