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 |
| 45 | - 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 |
| 46 | - if [[ "${INSTALL_TOOLCHAIN}" == *ppc* ]]; then sh eldk-eglibc-i686-powerpc-toolchain-gmae-5.4.sh -y ; fi |
| 47 | - 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 |
| 48 | - if [[ "${INSTALL_TOOLCHAIN}" == *mips* ]]; then sh eldk-eglibc-i686-mips-toolchain-gmae-5.4.sh -y ; fi |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 49 | - 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 |
| 50 | - if [[ "${INSTALL_TOOLCHAIN}" == *arm* ]]; then sh eldk-eglibc-i686-arm-toolchain-gmae-5.4.sh -y ; fi |
| 51 | - if [[ "${INSTALL_TOOLCHAIN}" == *arm* ]]; then ls -al /opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi ; fi |
| 52 | - if [[ "${INSTALL_TOOLCHAIN}" == *i386* ]]; then ./tools/buildman/buildman sandbox --fetch-arch i386 ; fi |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 53 | |
| 54 | script: |
| 55 | # the execution sequence for each test |
| 56 | - echo ${TEST_CONFIG_CMD} |
| 57 | - ${TEST_CONFIG_CMD} |
| 58 | - echo ${TEST_CMD} |
| 59 | - ${TEST_CMD} |
| 60 | |
| 61 | matrix: |
| 62 | include: |
| 63 | # we need to build by vendor due to 50min time limit for builds |
| 64 | # each env setting here is a dedicated build |
| 65 | - env: |
| 66 | - TEST_CMD="./MAKEALL -a arm -v atmel" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 67 | INSTALL_TOOLCHAIN="arm" |
| 68 | 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] | 69 | - env: |
| 70 | - TEST_CMD="./MAKEALL -a arm -v denx" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 71 | INSTALL_TOOLCHAIN="arm" |
| 72 | 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] | 73 | - env: |
| 74 | - TEST_CMD="./MAKEALL -a arm -v freescale" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 75 | INSTALL_TOOLCHAIN="arm" |
| 76 | 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] | 77 | - env: |
| 78 | - TEST_CMD="./MAKEALL -a arm -v siemens" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 79 | INSTALL_TOOLCHAIN="arm" |
| 80 | 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] | 81 | - env: |
| 82 | - TEST_CMD="./MAKEALL -a arm -v ti" |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 83 | INSTALL_TOOLCHAIN="arm" |
| 84 | 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] | 85 | - env: |
| 86 | - TEST_CONFIG_CMD="make sandbox_defconfig" |
| 87 | TEST_CMD="make -j4" |
| 88 | HOSTCC = "gcc" |
| 89 | HOSTCXX = "g++" |
| 90 | - env: |
| 91 | - TEST_CONFIG_CMD="make sandbox_defconfig" |
| 92 | TEST_CMD="make -j4" |
| 93 | HOSTCC = "clang" |
| 94 | HOSTCXX = "clang++" |
| 95 | - env: |
| 96 | - TEST_CMD="./MAKEALL -a mips" |
| 97 | INSTALL_TOOLCHAIN="mips" |
| 98 | CROSS_COMPILE="/opt/eldk-5.4/mips/sysroots/i686-eldk-linux/usr/bin/mips32-linux/mips-linux-" |
| 99 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 100 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 101 | TEST_CMD="tools/buildman/buildman --list-error-boards atmel -x avr32" |
| 102 | INSTALL_TOOLCHAIN="arm" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 103 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 104 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 105 | TEST_CMD="tools/buildman/buildman --list-error-boards denx" |
| 106 | INSTALL_TOOLCHAIN="arm" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 107 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 108 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 109 | TEST_CMD="tools/buildman/buildman --list-error-boards freescale -x powerpc,m68k,aarch64" |
| 110 | INSTALL_TOOLCHAIN="arm" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 111 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 112 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 113 | TEST_CMD="tools/buildman/buildman --list-error-boards freescale -x arm,m68k,aarch64" |
| 114 | INSTALL_TOOLCHAIN="ppc" |
| 115 | - env: |
| 116 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 117 | TEST_CMD="tools/buildman/buildman --list-error-boards siemens" |
| 118 | INSTALL_TOOLCHAIN="arm" |
| 119 | - env: |
| 120 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 121 | TEST_CMD="tools/buildman/buildman --list-error-boards ti" |
| 122 | INSTALL_TOOLCHAIN="arm" |
| 123 | - env: |
| 124 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 125 | TEST_CMD="tools/buildman/buildman --list-error-boards arm1136" |
| 126 | INSTALL_TOOLCHAIN="arm" |
| 127 | - env: |
| 128 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 129 | TEST_CMD="tools/buildman/buildman --list-error-boards arm1176" |
| 130 | INSTALL_TOOLCHAIN="arm" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 131 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 132 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 133 | TEST_CMD="tools/buildman/buildman --list-error-boards arm720t" |
| 134 | INSTALL_TOOLCHAIN="arm" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 135 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 136 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 137 | TEST_CMD="tools/buildman/buildman --list-error-boards arm920t" |
| 138 | INSTALL_TOOLCHAIN="arm" |
| 139 | - env: |
| 140 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 141 | TEST_CMD="tools/buildman/buildman --list-error-boards davinci" |
| 142 | INSTALL_TOOLCHAIN="arm" |
| 143 | - env: |
| 144 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 145 | TEST_CMD="tools/buildman/buildman --list-error-boards kirkwood" |
| 146 | INSTALL_TOOLCHAIN="arm" |
| 147 | - env: |
| 148 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 149 | TEST_CMD="tools/buildman/buildman mips" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 150 | INSTALL_TOOLCHAIN="mips" |
| 151 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 152 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 153 | TEST_CMD="tools/buildman/buildman mpc5xx" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 154 | INSTALL_TOOLCHAIN="ppc" |
| 155 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 156 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 157 | TEST_CMD="tools/buildman/buildman mpc8xx" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 158 | INSTALL_TOOLCHAIN="ppc" |
| 159 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 160 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 161 | TEST_CMD="tools/buildman/buildman mpc5xxx" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 162 | INSTALL_TOOLCHAIN="ppc" |
| 163 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 164 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 165 | TEST_CMD="tools/buildman/buildman mpc512x" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 166 | INSTALL_TOOLCHAIN="ppc" |
| 167 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 168 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 169 | TEST_CMD="tools/buildman/buildman mpc8260" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 170 | INSTALL_TOOLCHAIN="ppc" |
| 171 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 172 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 173 | TEST_CMD="tools/buildman/buildman mpc83xx" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 174 | INSTALL_TOOLCHAIN="ppc" |
| 175 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 176 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 177 | TEST_CMD="tools/buildman/buildman mpc85xx" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 178 | INSTALL_TOOLCHAIN="ppc" |
| 179 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 180 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 181 | TEST_CMD="tools/buildman/buildman mpc86xx" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 182 | INSTALL_TOOLCHAIN="ppc" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 183 | - env: |
Heiko Schocher | b52b66f | 2015-03-05 09:02:23 +0100 | [diff] [blame] | 184 | - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains" |
| 185 | TEST_CMD="tools/buildman/buildman --list-error-boards sandbox x86" |
| 186 | INSTALL_TOOLCHAIN="i386" |
Meier, Roger | 3029f5b | 2014-11-19 15:26:18 +0100 | [diff] [blame] | 187 | |
| 188 | # QA jobs for code analytics |
| 189 | # static code analysis with cppcheck (we can add --enable=all later) |
| 190 | - env: |
| 191 | - TEST_CMD="cppcheck --force --quiet --inline-suppr ." |
| 192 | # search for TODO within source tree |
| 193 | - env: |
| 194 | - TEST_CMD="grep -r TODO ." |
| 195 | # search for FIXME within source tree |
| 196 | - env: |
| 197 | - TEST_CMD="grep -r FIXME ." |
| 198 | # search for HACK within source tree and ignore HACKKIT board |
| 199 | - env: |
| 200 | - TEST_CMD="grep -r HACK . | grep -v HACKKIT" |
| 201 | script: |
| 202 | - grep -r HACK . | grep -v HACKKIT |
| 203 | # some statistics about the code base |
| 204 | - env: |
| 205 | - TEST_CMD="sloccount ." |
| 206 | |
| 207 | notifications: |
| 208 | email: false |
| 209 | |
| 210 | # TODO make it perfect ;-r |