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