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 | |
| 6 | language: c |
| 7 | |
| 8 | cache: |
| 9 | - apt |
| 10 | |
| 11 | install: |
| 12 | # install U-Boot build dependencies |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 13 | - sudo apt-get install -qq cppcheck sloccount sparse bc libsdl-dev build-essential |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 14 | # install latest device tree compiler |
| 15 | - git clone --depth=1 https://git.kernel.org/pub/scm/utils/dtc/dtc.git /tmp/dtc |
| 16 | - make -j4 -C /tmp/dtc |
| 17 | # prepare buildman environment |
| 18 | - export BUILDMAN_ROOT="root:" |
| 19 | - export BUILDMAN_MIPS="mips:" |
| 20 | - export BUILDMAN_PPC="ppc:" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 21 | - export BUILDMAN_ARM="arm:" |
| 22 | - export BUILDMAN_SANDBOX="sandbox:" |
| 23 | - echo -e "[toolchain]\n${BUILDMAN_ROOT} /\n" > ~/.buildman |
| 24 | - echo -e "${BUILDMAN_MIPS} /opt/eldk-5.4/mips/sysroots/i686-eldk-linux/usr/bin/mips32-linux/\n" >> ~/.buildman |
| 25 | - echo -e "${BUILDMAN_PPC} /opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux/\n" >> ~/.buildman |
| 26 | - echo -e "${BUILDMAN_ARM} /opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi/\n" >> ~/.buildman |
| 27 | - echo -e "${BUILDMAN_SANDBOX} /usr/bin/gcc\n" >> ~/.buildman |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 28 | - export BUILDMAN_ALIAS="x86:" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 29 | - export BUILDMAN_ALIAS_ARM="arm:" |
| 30 | - echo -e "\n\n[toolchain-alias]\n${BUILDMAN_ALIAS} i386\n" >> ~/.buildman |
| 31 | - echo -e "${BUILDMAN_ALIAS_ARM} armv5te\n" >> ~/.buildman |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 32 | - cat ~/.buildman |
| 33 | |
| 34 | env: |
| 35 | global: |
| 36 | - PATH=/tmp/dtc:$PATH |
| 37 | - BUILD_DIR=build |
| 38 | - CROSS_COMPILE="" |
| 39 | - HOSTCC="cc" |
| 40 | - HOSTCXX="c++" |
| 41 | - TEST_CONFIG_CMD="" |
| 42 | |
| 43 | before_script: |
| 44 | # install toolchains based on INSTALL_TOOLCHAIN} variable |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 45 | - if [[ "${INSTALL_TOOLCHAIN}" == *arm* ]]; then wget ftp://ftp.denx.de/pub/eldk/5.4/targets/armv5te/eldk-eglibc-i686-arm-toolchain-gmae-5.4.sh ; fi |
| 46 | - if [[ "${INSTALL_TOOLCHAIN}" == *arm* ]]; then sh eldk-eglibc-i686-arm-toolchain-gmae-5.4.sh -y ; fi |
| 47 | - if [[ "${INSTALL_TOOLCHAIN}" == *arm* ]]; then ls -al /opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi ; fi |
Heiko Schocher | 8fbc893 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 48 | - if [[ "${INSTALL_TOOLCHAIN}" == *avr32* ]]; then ./tools/buildman/buildman --fetch-arch avr32 ; fi |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 49 | - if [[ "${INSTALL_TOOLCHAIN}" == *i386* ]]; then ./tools/buildman/buildman sandbox --fetch-arch i386 ; fi |
Heiko Schocher | 8fbc893 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 50 | - if [[ "${INSTALL_TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi |
| 51 | - if [[ "${INSTALL_TOOLCHAIN}" == *mips* ]]; then wget ftp://ftp.denx.de/pub/eldk/5.4/targets/mips/eldk-eglibc-i686-mips-toolchain-gmae-5.4.sh ; fi |
| 52 | - if [[ "${INSTALL_TOOLCHAIN}" == *mips* ]]; then sh eldk-eglibc-i686-mips-toolchain-gmae-5.4.sh -y ; fi |
| 53 | - if [[ "${INSTALL_TOOLCHAIN}" == *ppc* ]]; then wget ftp://ftp.denx.de/pub/eldk/5.4/targets/powerpc/eldk-eglibc-i686-powerpc-toolchain-gmae-5.4.sh ; fi |
| 54 | - if [[ "${INSTALL_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] | 55 | |
| 56 | script: |
| 57 | # the execution sequence for each test |
| 58 | - echo ${TEST_CONFIG_CMD} |
| 59 | - ${TEST_CONFIG_CMD} |
| 60 | - echo ${TEST_CMD} |
| 61 | - ${TEST_CMD} |
| 62 | |
| 63 | matrix: |
| 64 | include: |
| 65 | # we need to build by vendor due to 50min time limit for builds |
| 66 | # each env setting here is a dedicated build |
| 67 | - env: |
| 68 | - TEST_CMD="./MAKEALL -a arm -v atmel" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 69 | INSTALL_TOOLCHAIN="arm" |
| 70 | CROSS_COMPILE="/opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi/arm-linux-gnueabi-" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 71 | - env: |
| 72 | - TEST_CMD="./MAKEALL -a arm -v denx" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 73 | INSTALL_TOOLCHAIN="arm" |
| 74 | CROSS_COMPILE="/opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi/arm-linux-gnueabi-" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 75 | - env: |
| 76 | - TEST_CMD="./MAKEALL -a arm -v freescale" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 77 | INSTALL_TOOLCHAIN="arm" |
| 78 | CROSS_COMPILE="/opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi/arm-linux-gnueabi-" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 79 | - env: |
| 80 | - TEST_CMD="./MAKEALL -a arm -v siemens" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 81 | INSTALL_TOOLCHAIN="arm" |
| 82 | CROSS_COMPILE="/opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi/arm-linux-gnueabi-" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 83 | - env: |
| 84 | - TEST_CMD="./MAKEALL -a arm -v ti" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 85 | INSTALL_TOOLCHAIN="arm" |
| 86 | CROSS_COMPILE="/opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi/arm-linux-gnueabi-" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 87 | - env: |
| 88 | - TEST_CONFIG_CMD="make sandbox_defconfig" |
| 89 | TEST_CMD="make -j4" |
| 90 | HOSTCC = "gcc" |
| 91 | HOSTCXX = "g++" |
| 92 | - env: |
| 93 | - TEST_CONFIG_CMD="make sandbox_defconfig" |
| 94 | TEST_CMD="make -j4" |
| 95 | HOSTCC = "clang" |
| 96 | HOSTCXX = "clang++" |
| 97 | - env: |
| 98 | - TEST_CMD="./MAKEALL -a mips" |
| 99 | INSTALL_TOOLCHAIN="mips" |
| 100 | CROSS_COMPILE="/opt/eldk-5.4/mips/sysroots/i686-eldk-linux/usr/bin/mips32-linux/mips-linux-" |
| 101 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 102 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
Heiko Schocher | 8fbc893 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 103 | TEST_CMD="tools/buildman/buildman --list-error-boards arm1136" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 104 | INSTALL_TOOLCHAIN="arm" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 105 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 106 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
Heiko Schocher | 8fbc893 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 107 | TEST_CMD="tools/buildman/buildman --list-error-boards arm1176" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 108 | INSTALL_TOOLCHAIN="arm" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 109 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 110 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
Heiko Schocher | 8fbc893 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 111 | TEST_CMD="tools/buildman/buildman --list-error-boards arm720t" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 112 | INSTALL_TOOLCHAIN="arm" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 113 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 114 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
Heiko Schocher | 8fbc893 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 115 | TEST_CMD="tools/buildman/buildman --list-error-boards arm920t" |
| 116 | INSTALL_TOOLCHAIN="arm" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 117 | - env: |
| 118 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
Heiko Schocher | 8fbc893 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 119 | TEST_CMD="tools/buildman/buildman --list-error-boards atmel -x avr32" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 120 | INSTALL_TOOLCHAIN="arm" |
| 121 | - env: |
| 122 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
Heiko Schocher | 8fbc893 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 123 | TEST_CMD="tools/buildman/buildman --list-error-boards avr32" |
| 124 | INSTALL_TOOLCHAIN="avr32" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 125 | - env: |
| 126 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
Heiko Schocher | 8fbc893 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 127 | TEST_CMD="tools/buildman/buildman --list-error-boards davinci" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 128 | INSTALL_TOOLCHAIN="arm" |
| 129 | - env: |
| 130 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
Heiko Schocher | 8fbc893 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 131 | TEST_CMD="tools/buildman/buildman --list-error-boards denx" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 132 | INSTALL_TOOLCHAIN="arm" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 133 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 134 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
Heiko Schocher | 8fbc893 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 135 | TEST_CMD="tools/buildman/buildman --list-error-boards freescale -x powerpc,m68k,aarch64" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 136 | INSTALL_TOOLCHAIN="arm" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 137 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 138 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
Heiko Schocher | 8fbc893 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 139 | TEST_CMD="tools/buildman/buildman --list-error-boards freescale -x arm,m68k,aarch64" |
| 140 | INSTALL_TOOLCHAIN="ppc" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 141 | - env: |
| 142 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
Heiko Schocher | 8fbc893 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 143 | TEST_CMD="tools/buildman/buildman --list-error-boards sandbox x86" |
| 144 | INSTALL_TOOLCHAIN="i386" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 145 | - env: |
| 146 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 147 | TEST_CMD="tools/buildman/buildman --list-error-boards kirkwood" |
| 148 | INSTALL_TOOLCHAIN="arm" |
| 149 | - env: |
| 150 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
Heiko Schocher | 8fbc893 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 151 | TEST_CMD="tools/buildman/buildman --list-error-boards m68k" |
| 152 | INSTALL_TOOLCHAIN="m68k" |
| 153 | - env: |
| 154 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 155 | TEST_CMD="tools/buildman/buildman mips" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 156 | INSTALL_TOOLCHAIN="mips" |
| 157 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 158 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
Heiko Schocher | 8fbc893 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 159 | TEST_CMD="tools/buildman/buildman mpc512x" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 160 | INSTALL_TOOLCHAIN="ppc" |
| 161 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 162 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
Heiko Schocher | 8fbc893 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 163 | TEST_CMD="tools/buildman/buildman mpc5xx" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 164 | INSTALL_TOOLCHAIN="ppc" |
| 165 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 166 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 167 | TEST_CMD="tools/buildman/buildman mpc5xxx" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 168 | INSTALL_TOOLCHAIN="ppc" |
| 169 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 170 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 171 | TEST_CMD="tools/buildman/buildman mpc8260" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 172 | INSTALL_TOOLCHAIN="ppc" |
| 173 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 174 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 175 | TEST_CMD="tools/buildman/buildman mpc83xx" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 176 | INSTALL_TOOLCHAIN="ppc" |
| 177 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 178 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 179 | TEST_CMD="tools/buildman/buildman mpc85xx" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 180 | INSTALL_TOOLCHAIN="ppc" |
| 181 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 182 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 183 | TEST_CMD="tools/buildman/buildman mpc86xx" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 184 | INSTALL_TOOLCHAIN="ppc" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 185 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 186 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
Heiko Schocher | 8fbc893 | 2015-03-17 08:21:41 +0100 | [diff] [blame] | 187 | TEST_CMD="tools/buildman/buildman mpc8xx" |
| 188 | INSTALL_TOOLCHAIN="ppc" |
| 189 | - env: |
| 190 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 191 | TEST_CMD="tools/buildman/buildman --list-error-boards siemens" |
| 192 | INSTALL_TOOLCHAIN="arm" |
| 193 | - env: |
| 194 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 195 | TEST_CMD="tools/buildman/buildman --list-error-boards ti" |
| 196 | INSTALL_TOOLCHAIN="arm" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 197 | |
| 198 | # QA jobs for code analytics |
| 199 | # static code analysis with cppcheck (we can add --enable=all later) |
| 200 | - env: |
| 201 | - TEST_CMD="cppcheck --force --quiet --inline-suppr ." |
| 202 | # search for TODO within source tree |
| 203 | - env: |
| 204 | - TEST_CMD="grep -r TODO ." |
| 205 | # search for FIXME within source tree |
| 206 | - env: |
| 207 | - TEST_CMD="grep -r FIXME ." |
| 208 | # search for HACK within source tree and ignore HACKKIT board |
| 209 | - env: |
| 210 | - TEST_CMD="grep -r HACK . | grep -v HACKKIT" |
| 211 | script: |
| 212 | - grep -r HACK . | grep -v HACKKIT |
| 213 | # some statistics about the code base |
| 214 | - env: |
| 215 | - TEST_CMD="sloccount ." |
| 216 | |
| 217 | notifications: |
| 218 | email: false |
| 219 | |
| 220 | # TODO make it perfect ;-r |