.travis.yml 7.86 KB
Newer Older
1 2 3 4 5
# Copyright Roger Meier <r.meier@siemens.com>
# SPDX-License-Identifier:	GPL-2.0+

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

6 7
sudo: required
dist: trusty
8

9 10
language: c

11 12
addons:
  apt:
13 14
    sources:
    - sourceline: 'ppa:gns3/qemu'
15 16 17 18 19 20 21
    packages:
    - cppcheck
    - sloccount
    - sparse
    - bc
    - build-essential
    - libsdl1.2-dev
22 23
    - python
    - python-virtualenv
24 25 26 27
    - qemu-system-arm
    - qemu-system-mips
    - qemu-system-ppc
    - qemu-system-x86
28 29
    - gcc-powerpc-linux-gnu
    - gcc-arm-linux-gnueabihf
30
    - gcc-aarch64-linux-gnu
31
    - iasl
32 33 34

install:
 # install latest device tree compiler
35
 - git clone --depth=1 git://git.kernel.org/pub/scm/utils/dtc/dtc.git /tmp/dtc
36
 - make -j4 -C /tmp/dtc
37 38 39 40
 # Clone uboot-test-hooks
 - git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
 - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
 - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
41
 # prepare buildman environment
42
 - echo -e "[toolchain]\nroot = /usr" > ~/.buildman
43
 - echo -e "\n[toolchain-alias]\nblackfin = bfin\nsh = sh4\nopenrisc = or32" >> ~/.buildman
44
 - cat ~/.buildman
45 46 47
 - virtualenv /tmp/venv
 - . /tmp/venv/bin/activate
 - pip install pytest
48 49 50

env:
  global:
51
    - PATH=/tmp/dtc:/tmp/uboot-test-hooks/bin:$PATH
52 53 54 55 56
    - BUILD_DIR=build
    - HOSTCC="cc"
    - HOSTCXX="c++"

before_script:
57 58
  # install toolchains based on TOOLCHAIN} variable
  - if [[ "${TOOLCHAIN}" == *avr32* ]]; then ./tools/buildman/buildman --fetch-arch avr32 ; fi
59
  - if [[ "${TOOLCHAIN}" == *bfin* ]]; then ./tools/buildman/buildman --fetch-arch bfin ; fi
60
  - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi
61
  - if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi
62
  - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi
63 64
  - if [[ "${TOOLCHAIN}" == *or32* ]]; then ./tools/buildman/buildman --fetch-arch or32 ; fi
  - if [[ "${TOOLCHAIN}" == *sh4* ]]; then ./tools/buildman/buildman --fetch-arch sh4 ; fi
65 66 67 68
  - if [[ "${TOOLCHAIN}" == *x86_64* ]]; then
      ./tools/buildman/buildman --fetch-arch x86_64;
      echo -e "\n[toolchain-prefix]\nx86 = ${HOME}/.buildman-toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-" >> ~/.buildman;
    fi
69
  - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then ./tools/buildman/buildman --fetch-arch xtensa ; fi
70 71

script:
72 73 74
 # Comments must be outside the command strings below, or the Travis parser
 # will get confused.
 #
75
 # Exit code 129 means warnings only.
76
 - if [[ "${BUILDMAN}" != "" ]]; then
77
     set +e;
78
     tools/buildman/buildman -P ${BUILDMAN};
79
     ret=$?;
80
     if [[ $ret -ne 0 && $ret -ne 129 ]]; then
81
       tools/buildman/buildman -sdeP ${BUILDMAN};
82 83
       exit $ret;
     fi;
84
   fi
85 86 87 88 89 90 91 92 93
 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
 # never prevent any test from running. That way, we can always pass
 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
 # value.
 - if [[ "${TEST_PY_BD}" != "" ]]; then
     ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
       -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
       --build-dir `cd .. && pwd`/.bm-work/${TEST_PY_BD};
   fi
94 95 96 97 98

matrix:
  include:
  # we need to build by vendor due to 50min time limit for builds
  # each env setting here is a dedicated build
99
    - env:
100
        - BUILDMAN="arm11"
101
    - env:
102
        - BUILDMAN="arm7"
103
    - env:
104
        - BUILDMAN="arm920t"
105 106 107 108 109
    - env:
        - JOB="arm926ejs"
          BUILDMAN="arm926ejs -x mx,siemens,atmel"
    - env:
        - BUILDMAN="arm946es"
110
    - env:
111
        - BUILDMAN="atmel -x avr32"
112
    - env:
113 114
        - BUILDMAN="avr32"
          TOOLCHAIN="avr32"
115
    - env:
116
        - BUILDMAN="denx"
117
    - env:
118 119
        - JOB="Freescale ARM"
          BUILDMAN="freescale -x powerpc,m68k"
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
    - env:
        - JOB="i.MX (non-Freescale)"
          BUILDMAN="mx -x freescale"
    - env:
        - BUILDMAN="sun4i"
    - env:
        - BUILDMAN="sun5i"
    - env:
        - BUILDMAN="sun6i"
    - env:
        - BUILDMAN="sun7i"
    - env:
        - BUILDMAN="sun8i"
    - env:
        - BUILDMAN="sun9i"
    - env:
        - BUILDMAN="sun50i"
    - env:
        - JOB="Catch-all ARM"
          BUILDMAN="arm -x arm11,arm7,arm9,aarch64,atmel,denx,freescale,kirkwood,siemens,tegra,uniphier,mx,sunxi,am33xx,omap3,omap4,omap5,pxa"
140
    - env:
141
        - BUILDMAN="sandbox x86"
142
          TOOLCHAIN="x86_64"
143
    - env:
144
        - BUILDMAN="kirkwood"
145 146
    - env:
        - BUILDMAN="pxa"
147
    - env:
148 149
        - BUILDMAN="m68k"
          TOOLCHAIN="m68k"
Tom Rini's avatar
Tom Rini committed
150 151 152
    - env:
        - BUILDMAN="microblaze"
          TOOLCHAIN="microblaze"
153
    - env:
154 155
        - BUILDMAN="mips"
          TOOLCHAIN="mips"
Heiko Schocher's avatar
Heiko Schocher committed
156
    - env:
157
        - BUILDMAN="mpc512x"
Heiko Schocher's avatar
Heiko Schocher committed
158
    - env:
159
        - BUILDMAN="mpc5xx"
Heiko Schocher's avatar
Heiko Schocher committed
160
    - env:
161
        - BUILDMAN="mpc5xxx"
Heiko Schocher's avatar
Heiko Schocher committed
162
    - env:
163
        - BUILDMAN="mpc8260"
164
    - env:
165
        - BUILDMAN="mpc83xx"
166
    - env:
167
        - BUILDMAN="mpc85xx -x freescale"
Heiko Schocher's avatar
Heiko Schocher committed
168
    - env:
169
        - BUILDMAN="mpc85xx -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x sbc8548 -x bsc91*"
Heiko Schocher's avatar
Heiko Schocher committed
170
    - env:
171
        - BUILDMAN="t208xrdb t4qds t102*"
172
    - env:
173
        - BUILDMAN="p1_p2_rdb_pc p1010rdb"
Heiko Schocher's avatar
Heiko Schocher committed
174
    - env:
175
        - BUILDMAN="corenet_ds b4860qds sbc8548 bsc91*"
176
    - env:
177
        - BUILDMAN="mpc86xx"
178
    - env:
179
        - BUILDMAN="mpc8xx"
180
    - env:
181
        - BUILDMAN="siemens"
Stephen Warren's avatar
Stephen Warren committed
182
    - env:
183
        - BUILDMAN="tegra"
184
    - env:
185 186 187 188 189 190 191 192
        - JOB="am33xx"
          BUILDMAN="am33xx -x siemens"
    - env:
        - BUILDMAN="omap3"
    - env:
        - BUILDMAN="omap4"
    - env:
        - BUILDMAN="omap5"
193
    - env:
194 195
        - BUILDMAN="uniphier"
    - env:
196
        - BUILDMAN="aarch64 -x tegra,freescale,uniphier,sunxi"
197
          TOOLCHAIN="aarch64"
Tom Rini's avatar
Tom Rini committed
198 199 200 201 202 203
    - env:
        - BUILDMAN="sh4"
          TOOLCHAIN="sh4"
    - env:
        - BUILDMAN="xtensa"
          TOOLCHAIN="xtensa"
204 205 206

    # QA jobs for code analytics
    # static code analysis with cppcheck (we can add --enable=all later)
207 208 209
    - env:
        - JOB="cppcheck"
      script:
Tom Rini's avatar
Tom Rini committed
210
        - cppcheck --force --quiet --inline-suppr .
211
    # search for TODO within source tree
212 213 214
    - env:
        - JOB="grep TODO"
      script:
Tom Rini's avatar
Tom Rini committed
215
        - grep -r TODO .
216
    # search for FIXME within source tree
217 218 219
    - env:
        - JOB="grep FIXME HACK"
      script:
Tom Rini's avatar
Tom Rini committed
220
        - grep -r FIXME .
221 222 223 224
    # search for HACK within source tree and ignore HACKKIT board
      script:
        - grep -r HACK . | grep -v HACKKIT
    # some statistics about the code base
225 226 227
    - env:
        - JOB="sloccount"
      script:
Tom Rini's avatar
Tom Rini committed
228
        - sloccount .
229

230
    # test/py
231
    - env:
232 233 234
        - TEST_PY_BD="sandbox"
          BUILDMAN="^sandbox$"
          TOOLCHAIN="x86_64"
235
    - env:
236 237 238
        - TEST_PY_BD="vexpress_ca15_tc2"
          TEST_PY_ID="--id qemu"
          BUILDMAN="^vexpress_ca15_tc2$"
239
    - env:
240 241 242
        - TEST_PY_BD="vexpress_ca9x4"
          TEST_PY_ID="--id qemu"
          BUILDMAN="^vexpress_ca9x4$"
243
    - env:
244 245 246
        - TEST_PY_BD="integratorcp_cm926ejs"
          TEST_PY_ID="--id qemu"
          BUILDMAN="^integratorcp_cm926ejs$"
247
    - env:
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
        - TEST_PY_BD="qemu_mips"
          TEST_PY_TEST_SPEC="not sleep"
          BUILDMAN="^qemu_mips$"
          TOOLCHAIN="mips"
    - env:
        - TEST_PY_BD="qemu_mipsel"
          TEST_PY_TEST_SPEC="not sleep"
          BUILDMAN="^qemu_mipsel$"
          TOOLCHAIN="mips"
    - env:
        - TEST_PY_BD="qemu_mips64"
          TEST_PY_TEST_SPEC="not sleep"
          BUILDMAN="^qemu_mips64$"
          TOOLCHAIN="mips"
    - env:
        - TEST_PY_BD="qemu_mips64el"
          TEST_PY_TEST_SPEC="not sleep"
          BUILDMAN="^qemu_mips64el$"
          TOOLCHAIN="mips"
    - env:
        - TEST_PY_BD="qemu-ppce500"
          TEST_PY_TEST_SPEC="not sleep"
          BUILDMAN="^qemu-ppce500$"
    - env:
        - TEST_PY_BD="qemu-x86"
          TEST_PY_TEST_SPEC="not sleep"
          BUILDMAN="^qemu-x86$"
          TOOLCHAIN="x86_64"
          BUILD_ROM="yes"
277 278

# TODO make it perfect ;-r