.travis.yml 9.48 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
# Copyright Roger Meier <r.meier@siemens.com>
# SPDX-License-Identifier:	GPL-2.0+

# build U-Boot on Travis CI - https://travis-ci.org/

language: c

cache:
 - apt

install:
 # install U-Boot build dependencies
Heiko Schocher's avatar
Heiko Schocher committed
13
 - sudo apt-get install -qq cppcheck sloccount sparse bc libsdl-dev build-essential
14 15 16 17 18 19 20
 # install latest device tree compiler
 - git clone --depth=1 https://git.kernel.org/pub/scm/utils/dtc/dtc.git /tmp/dtc
 - make -j4 -C /tmp/dtc
 # prepare buildman environment
 - export BUILDMAN_ROOT="root:"
 - export BUILDMAN_MIPS="mips:"
 - export BUILDMAN_PPC="ppc:"
Heiko Schocher's avatar
Heiko Schocher committed
21 22 23 24 25 26 27
 - export BUILDMAN_ARM="arm:"
 - export BUILDMAN_SANDBOX="sandbox:"
 - echo -e "[toolchain]\n${BUILDMAN_ROOT} /\n" > ~/.buildman
 - echo -e "${BUILDMAN_MIPS} /opt/eldk-5.4/mips/sysroots/i686-eldk-linux/usr/bin/mips32-linux/\n" >> ~/.buildman
 - echo -e "${BUILDMAN_PPC} /opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux/\n" >> ~/.buildman
 - echo -e "${BUILDMAN_ARM} /opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi/\n" >> ~/.buildman
 - echo -e "${BUILDMAN_SANDBOX} /usr/bin/gcc\n" >> ~/.buildman
28
 - export BUILDMAN_ALIAS="x86:"
Heiko Schocher's avatar
Heiko Schocher committed
29 30 31
 - export BUILDMAN_ALIAS_ARM="arm:"
 - echo -e "\n\n[toolchain-alias]\n${BUILDMAN_ALIAS} i386\n" >> ~/.buildman
 - echo -e "${BUILDMAN_ALIAS_ARM} armv5te\n" >> ~/.buildman
32 33 34 35 36 37 38 39 40 41 42 43 44
 - cat ~/.buildman

env:
  global:
    - PATH=/tmp/dtc:$PATH
    - BUILD_DIR=build
    - CROSS_COMPILE=""
    - HOSTCC="cc"
    - HOSTCXX="c++"
    - TEST_CONFIG_CMD=""

before_script:
  # install toolchains based on INSTALL_TOOLCHAIN} variable
Heiko Schocher's avatar
Heiko Schocher committed
45 46 47
  - 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
  - if [[ "${INSTALL_TOOLCHAIN}" == *arm* ]]; then sh eldk-eglibc-i686-arm-toolchain-gmae-5.4.sh -y ; fi
  - if [[ "${INSTALL_TOOLCHAIN}" == *arm* ]]; then ls -al /opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi ; fi
48
  - if [[ "${INSTALL_TOOLCHAIN}" == *avr32* ]]; then ./tools/buildman/buildman --fetch-arch avr32 ; fi
Heiko Schocher's avatar
Heiko Schocher committed
49
  - if [[ "${INSTALL_TOOLCHAIN}" == *i386* ]]; then ./tools/buildman/buildman sandbox --fetch-arch i386 ; fi
50 51 52 53 54
  - if [[ "${INSTALL_TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi
  - 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
  - if [[ "${INSTALL_TOOLCHAIN}" == *mips* ]]; then sh eldk-eglibc-i686-mips-toolchain-gmae-5.4.sh -y ; fi
  - 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
  - if [[ "${INSTALL_TOOLCHAIN}" == *ppc* ]]; then sh eldk-eglibc-i686-powerpc-toolchain-gmae-5.4.sh -y ; fi
55 56 57 58 59 60 61 62 63 64 65 66 67 68

script:
 # the execution sequence for each test
 - echo ${TEST_CONFIG_CMD}
 - ${TEST_CONFIG_CMD}
 - echo ${TEST_CMD}
 - ${TEST_CMD}

matrix:
  include:
  # we need to build by vendor due to 50min time limit for builds
  # each env setting here is a dedicated build
    - env:
        - TEST_CMD="./MAKEALL -a arm -v atmel"
Heiko Schocher's avatar
Heiko Schocher committed
69 70
          INSTALL_TOOLCHAIN="arm"
          CROSS_COMPILE="/opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi/arm-linux-gnueabi-"
71 72
    - env:
        - TEST_CMD="./MAKEALL -a arm -v denx"
Heiko Schocher's avatar
Heiko Schocher committed
73 74
          INSTALL_TOOLCHAIN="arm"
          CROSS_COMPILE="/opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi/arm-linux-gnueabi-"
75 76
    - env:
        - TEST_CMD="./MAKEALL -a arm -v freescale"
Heiko Schocher's avatar
Heiko Schocher committed
77 78
          INSTALL_TOOLCHAIN="arm"
          CROSS_COMPILE="/opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi/arm-linux-gnueabi-"
79 80
    - env:
        - TEST_CMD="./MAKEALL -a arm -v siemens"
Heiko Schocher's avatar
Heiko Schocher committed
81 82
          INSTALL_TOOLCHAIN="arm"
          CROSS_COMPILE="/opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi/arm-linux-gnueabi-"
83 84
    - env:
        - TEST_CMD="./MAKEALL -a arm -v ti"
Heiko Schocher's avatar
Heiko Schocher committed
85 86
          INSTALL_TOOLCHAIN="arm"
          CROSS_COMPILE="/opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi/arm-linux-gnueabi-"
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
    - env:
        - TEST_CONFIG_CMD="make sandbox_defconfig"
          TEST_CMD="make -j4"
          HOSTCC  = "gcc"
          HOSTCXX  = "g++"
    - env:
        - TEST_CONFIG_CMD="make sandbox_defconfig"
          TEST_CMD="make -j4"
          HOSTCC  = "clang"
          HOSTCXX  = "clang++"
    - env:
        - TEST_CMD="./MAKEALL -a mips"
          INSTALL_TOOLCHAIN="mips"
          CROSS_COMPILE="/opt/eldk-5.4/mips/sysroots/i686-eldk-linux/usr/bin/mips32-linux/mips-linux-"
    - env:
Heiko Schocher's avatar
Heiko Schocher committed
102
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
103
          TEST_CMD="tools/buildman/buildman --list-error-boards arm1136"
Heiko Schocher's avatar
Heiko Schocher committed
104
          INSTALL_TOOLCHAIN="arm"
105
    - env:
Heiko Schocher's avatar
Heiko Schocher committed
106
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
107
          TEST_CMD="tools/buildman/buildman --list-error-boards arm1176"
Heiko Schocher's avatar
Heiko Schocher committed
108
          INSTALL_TOOLCHAIN="arm"
109
    - env:
Heiko Schocher's avatar
Heiko Schocher committed
110
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
111
          TEST_CMD="tools/buildman/buildman --list-error-boards arm720t"
Heiko Schocher's avatar
Heiko Schocher committed
112
          INSTALL_TOOLCHAIN="arm"
113
    - env:
Heiko Schocher's avatar
Heiko Schocher committed
114
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
115 116
          TEST_CMD="tools/buildman/buildman --list-error-boards arm920t"
          INSTALL_TOOLCHAIN="arm"
Heiko Schocher's avatar
Heiko Schocher committed
117 118
    - env:
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
119
          TEST_CMD="tools/buildman/buildman --list-error-boards atmel -x avr32"
Heiko Schocher's avatar
Heiko Schocher committed
120 121 122
          INSTALL_TOOLCHAIN="arm"
    - env:
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
123 124
          TEST_CMD="tools/buildman/buildman --list-error-boards avr32"
          INSTALL_TOOLCHAIN="avr32"
Heiko Schocher's avatar
Heiko Schocher committed
125 126
    - env:
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
127
          TEST_CMD="tools/buildman/buildman --list-error-boards davinci"
Heiko Schocher's avatar
Heiko Schocher committed
128 129 130
          INSTALL_TOOLCHAIN="arm"
    - env:
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
131
          TEST_CMD="tools/buildman/buildman --list-error-boards denx"
Heiko Schocher's avatar
Heiko Schocher committed
132
          INSTALL_TOOLCHAIN="arm"
133
    - env:
Heiko Schocher's avatar
Heiko Schocher committed
134
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
135
          TEST_CMD="tools/buildman/buildman --list-error-boards freescale -x powerpc,m68k,aarch64"
Heiko Schocher's avatar
Heiko Schocher committed
136
          INSTALL_TOOLCHAIN="arm"
137
    - env:
Heiko Schocher's avatar
Heiko Schocher committed
138
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
139 140
          TEST_CMD="tools/buildman/buildman --list-error-boards freescale -x arm,m68k,aarch64"
          INSTALL_TOOLCHAIN="ppc"
Heiko Schocher's avatar
Heiko Schocher committed
141 142
    - env:
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
143 144
          TEST_CMD="tools/buildman/buildman --list-error-boards sandbox x86"
          INSTALL_TOOLCHAIN="i386"
Heiko Schocher's avatar
Heiko Schocher committed
145 146 147 148
    - env:
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
          TEST_CMD="tools/buildman/buildman --list-error-boards kirkwood"
          INSTALL_TOOLCHAIN="arm"
149 150 151 152
    - env:
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
          TEST_CMD="tools/buildman/buildman --list-error-boards m68k"
          INSTALL_TOOLCHAIN="m68k"
Heiko Schocher's avatar
Heiko Schocher committed
153 154 155
    - env:
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
          TEST_CMD="tools/buildman/buildman mips"
156 157
          INSTALL_TOOLCHAIN="mips"
    - env:
Heiko Schocher's avatar
Heiko Schocher committed
158
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
159
          TEST_CMD="tools/buildman/buildman mpc512x"
160 161
          INSTALL_TOOLCHAIN="ppc"
    - env:
Heiko Schocher's avatar
Heiko Schocher committed
162
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
163
          TEST_CMD="tools/buildman/buildman mpc5xx"
164 165
          INSTALL_TOOLCHAIN="ppc"
    - env:
Heiko Schocher's avatar
Heiko Schocher committed
166 167
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
          TEST_CMD="tools/buildman/buildman mpc5xxx"
168 169
          INSTALL_TOOLCHAIN="ppc"
    - env:
Heiko Schocher's avatar
Heiko Schocher committed
170 171
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
          TEST_CMD="tools/buildman/buildman mpc8260"
172 173
          INSTALL_TOOLCHAIN="ppc"
    - env:
Heiko Schocher's avatar
Heiko Schocher committed
174 175
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
          TEST_CMD="tools/buildman/buildman mpc83xx"
176 177
          INSTALL_TOOLCHAIN="ppc"
    - env:
Heiko Schocher's avatar
Heiko Schocher committed
178 179
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
          TEST_CMD="tools/buildman/buildman mpc85xx"
180 181
          INSTALL_TOOLCHAIN="ppc"
    - env:
Heiko Schocher's avatar
Heiko Schocher committed
182 183
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
          TEST_CMD="tools/buildman/buildman mpc86xx"
184 185
          INSTALL_TOOLCHAIN="ppc"
    - env:
Heiko Schocher's avatar
Heiko Schocher committed
186
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
187 188 189 190 191 192 193 194 195 196
          TEST_CMD="tools/buildman/buildman mpc8xx"
          INSTALL_TOOLCHAIN="ppc"
    - env:
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
          TEST_CMD="tools/buildman/buildman --list-error-boards siemens"
          INSTALL_TOOLCHAIN="arm"
    - env:
        - TEST_CONFIG_CMD="tools/buildman/buildman --list-tool-chains"
          TEST_CMD="tools/buildman/buildman --list-error-boards ti"
          INSTALL_TOOLCHAIN="arm"
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220

    # QA jobs for code analytics
    # static code analysis with cppcheck (we can add --enable=all later)
    - env:
        - TEST_CMD="cppcheck --force --quiet --inline-suppr ."
    # search for TODO within source tree
    - env:
        - TEST_CMD="grep -r TODO ."
    # search for FIXME within source tree
    - env:
        - TEST_CMD="grep -r FIXME ."
    # search for HACK within source tree and ignore HACKKIT board
    - env:
        - TEST_CMD="grep -r HACK . | grep -v HACKKIT"
      script:
        - grep -r HACK . | grep -v HACKKIT
    # some statistics about the code base
    - env:
        - TEST_CMD="sloccount ."

notifications:
  email: false

# TODO make it perfect ;-r