.travis.yml 9.58 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 13 14 15 16 17 18 19
addons:
  apt:
    packages:
    - cppcheck
    - sloccount
    - sparse
    - bc
    - build-essential
    - libsdl1.2-dev
20 21
    - python
    - python-virtualenv
22 23
    - swig
    - libpython-dev
24 25
    - gcc-powerpc-linux-gnu
    - gcc-arm-linux-gnueabihf
26
    - gcc-aarch64-linux-gnu
27
    - iasl
28 29 30
    - grub-efi-ia32-bin
    - rpm2cpio
    - wget
31
    - device-tree-compiler
32 33 34

install:
 # install latest device tree compiler
35 36
 #- git clone --depth=1 git://git.kernel.org/pub/scm/utils/dtc/dtc.git /tmp/dtc
 #- 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
 - grub-mkimage -o ~/grub_x86.efi -O i386-efi normal  echo lsefimmap lsefi lsefisystab efinet tftp minicmd
 - mkdir ~/grub2-arm
 - ( cd ~/grub2-arm; wget -O - http://download.opensuse.org/ports/armv7hl/distribution/leap/42.2/repo/oss/suse/armv7hl/grub2-arm-efi-2.02~beta2-87.1.armv7hl.rpm | rpm2cpio | cpio -di )
51 52 53

env:
  global:
54
    - PATH=/tmp/dtc:/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:$PATH
55
    - PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci
56 57 58 59 60
    - BUILD_DIR=build
    - HOSTCC="cc"
    - HOSTCXX="c++"

before_script:
61 62
  # install toolchains based on TOOLCHAIN} variable
  - if [[ "${TOOLCHAIN}" == *avr32* ]]; then ./tools/buildman/buildman --fetch-arch avr32 ; fi
63
  - if [[ "${TOOLCHAIN}" == *bfin* ]]; then ./tools/buildman/buildman --fetch-arch bfin ; fi
64
  - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi
65
  - if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi
66
  - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi
67 68
  - if [[ "${TOOLCHAIN}" == *or32* ]]; then ./tools/buildman/buildman --fetch-arch or32 ; fi
  - if [[ "${TOOLCHAIN}" == *sh4* ]]; then ./tools/buildman/buildman --fetch-arch sh4 ; fi
69 70 71 72
  - 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
73
  - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then ./tools/buildman/buildman --fetch-arch xtensa ; fi
74 75 76 77 78 79 80 81 82
  - if [[ "${QEMU_TARGET}" != "" ]]; then
       git clone git://git.qemu.org/qemu.git /tmp/qemu;
       pushd /tmp/qemu;
       git submodule update --init dtc &&
       git checkout v2.8.0-rc3 &&
       ./configure --prefix=/tmp/qemu-install --target-list=${QEMU_TARGET} &&
       make -j4 all install;
       popd;
    fi
83 84

script:
85 86 87
 # Comments must be outside the command strings below, or the Travis parser
 # will get confused.
 #
88
 # Exit code 129 means warnings only.
89
 - if [[ "${BUILDMAN}" != "" ]]; then
90
     set +e;
91
     tools/buildman/buildman -P ${BUILDMAN};
92
     ret=$?;
93
     if [[ $ret -ne 0 && $ret -ne 129 ]]; then
94
       tools/buildman/buildman -sdeP ${BUILDMAN};
95 96
       exit $ret;
     fi;
97
   fi
98 99 100 101
 # "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.
102
 - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
103 104
   cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/;
   cp ~/grub2-arm/usr/lib/grub2/arm-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi;
105
   if [[ "${TEST_PY_BD}" != "" ]]; then
106 107
     ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
       -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
108
       --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
109
   fi
110 111 112 113 114

matrix:
  include:
  # we need to build by vendor due to 50min time limit for builds
  # each env setting here is a dedicated build
115
    - env:
116
        - BUILDMAN="arm11"
117
    - env:
118
        - BUILDMAN="arm7"
119
    - env:
120
        - BUILDMAN="arm920t"
121 122 123 124 125
    - env:
        - JOB="arm926ejs"
          BUILDMAN="arm926ejs -x mx,siemens,atmel"
    - env:
        - BUILDMAN="arm946es"
126
    - env:
127
        - BUILDMAN="atmel -x avr32"
128
    - env:
129 130
        - BUILDMAN="avr32"
          TOOLCHAIN="avr32"
131
    - env:
132
        - BUILDMAN="denx"
133
    - env:
134 135 136 137 138
        - JOB="Freescale ARM32"
          BUILDMAN="freescale -x powerpc,m68k,aarch64"
    - env:
        - JOB="Freescale AArch64"
          BUILDMAN="freescale -x powerpc,m68k,armv7,arm9,arm11"
139 140 141
    - env:
        - JOB="i.MX (non-Freescale)"
          BUILDMAN="mx -x freescale"
142 143
    - env:
        - BUILDMAN="samsung"
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
    - 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"
160
          BUILDMAN="arm -x arm11,arm7,arm9,aarch64,atmel,denx,freescale,kirkwood,mvebu,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap3,omap4,omap5,pxa,rockchip"
161
    - env:
162
        - BUILDMAN="sandbox x86"
163
          TOOLCHAIN="x86_64"
164
    - env:
165
        - BUILDMAN="kirkwood"
166 167
    - env:
        - BUILDMAN="mvebu"
168 169
    - env:
        - BUILDMAN="pxa"
170
    - env:
171 172
        - BUILDMAN="m68k"
          TOOLCHAIN="m68k"
173 174 175
    - env:
        - BUILDMAN="microblaze"
          TOOLCHAIN="microblaze"
176
    - env:
177 178
        - BUILDMAN="mips"
          TOOLCHAIN="mips"
179
    - env:
180
        - BUILDMAN="mpc512x"
181
    - env:
182
        - BUILDMAN="mpc5xx"
183
    - env:
184
        - BUILDMAN="mpc5xxx"
185
    - env:
186
        - BUILDMAN="mpc8260"
187
    - env:
188
        - BUILDMAN="mpc83xx"
189
    - env:
190
        - BUILDMAN="mpc85xx -x freescale"
191
    - env:
192
        - BUILDMAN="mpc85xx -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x sbc8548 -x bsc91*"
193
    - env:
194
        - BUILDMAN="t208xrdb t4qds t102*"
195
    - env:
196 197 198
        - BUILDMAN="p1_p2_rdb_pc"
    - env:
        - BUILDMAN="p1010rdb"
199
    - env:
200
        - BUILDMAN="corenet_ds b4860qds sbc8548 bsc91*"
201
    - env:
202
        - BUILDMAN="mpc86xx"
203
    - env:
204
        - BUILDMAN="mpc8xx"
205
    - env:
206
        - BUILDMAN="siemens"
207
    - env:
208
        - BUILDMAN="tegra"
209
    - env:
210 211 212 213 214 215 216 217
        - JOB="am33xx"
          BUILDMAN="am33xx -x siemens"
    - env:
        - BUILDMAN="omap3"
    - env:
        - BUILDMAN="omap4"
    - env:
        - BUILDMAN="omap5"
218
    - env:
219 220
        - BUILDMAN="uniphier"
    - env:
221
        - BUILDMAN="aarch64 -x tegra,freescale,mvebu,uniphier,sunxi,samsung,rockchip"
222
          TOOLCHAIN="aarch64"
223 224
    - env:
        - BUILDMAN="rockchip"
225 226 227 228 229 230
    - env:
        - BUILDMAN="sh4"
          TOOLCHAIN="sh4"
    - env:
        - BUILDMAN="xtensa"
          TOOLCHAIN="xtensa"
231 232 233

    # QA jobs for code analytics
    # static code analysis with cppcheck (we can add --enable=all later)
234 235 236
    - env:
        - JOB="cppcheck"
      script:
Tom Rini's avatar
Tom Rini committed
237
        - cppcheck --force --quiet --inline-suppr .
238
    # search for TODO within source tree
239 240 241
    - env:
        - JOB="grep TODO"
      script:
Tom Rini's avatar
Tom Rini committed
242
        - grep -r TODO .
243
    # search for FIXME within source tree
244 245 246
    - env:
        - JOB="grep FIXME HACK"
      script:
Tom Rini's avatar
Tom Rini committed
247
        - grep -r FIXME .
248 249 250 251
    # search for HACK within source tree and ignore HACKKIT board
      script:
        - grep -r HACK . | grep -v HACKKIT
    # some statistics about the code base
252 253 254
    - env:
        - JOB="sloccount"
      script:
Tom Rini's avatar
Tom Rini committed
255
        - sloccount .
256

257
    # test/py
258
    - env:
259 260 261
        - TEST_PY_BD="sandbox"
          BUILDMAN="^sandbox$"
          TOOLCHAIN="x86_64"
262
    - env:
263 264
        - TEST_PY_BD="vexpress_ca15_tc2"
          TEST_PY_ID="--id qemu"
265
          QEMU_TARGET="arm-softmmu"
266
          BUILDMAN="^vexpress_ca15_tc2$"
267
    - env:
268 269
        - TEST_PY_BD="vexpress_ca9x4"
          TEST_PY_ID="--id qemu"
270
          QEMU_TARGET="arm-softmmu"
271
          BUILDMAN="^vexpress_ca9x4$"
272
    - env:
273
        - TEST_PY_BD="integratorcp_cm926ejs"
274
          TEST_PY_TEST_SPEC="not sleep"
275
          TEST_PY_ID="--id qemu"
276
          QEMU_TARGET="arm-softmmu"
277
          BUILDMAN="^integratorcp_cm926ejs$"
278
    - env:
279 280
        - TEST_PY_BD="qemu_mips"
          TEST_PY_TEST_SPEC="not sleep"
281
          QEMU_TARGET="mips-softmmu"
282 283 284 285 286
          BUILDMAN="^qemu_mips$"
          TOOLCHAIN="mips"
    - env:
        - TEST_PY_BD="qemu_mipsel"
          TEST_PY_TEST_SPEC="not sleep"
287
          QEMU_TARGET="mipsel-softmmu"
288 289 290 291 292
          BUILDMAN="^qemu_mipsel$"
          TOOLCHAIN="mips"
    - env:
        - TEST_PY_BD="qemu_mips64"
          TEST_PY_TEST_SPEC="not sleep"
293
          QEMU_TARGET="mips64-softmmu"
294 295 296 297 298
          BUILDMAN="^qemu_mips64$"
          TOOLCHAIN="mips"
    - env:
        - TEST_PY_BD="qemu_mips64el"
          TEST_PY_TEST_SPEC="not sleep"
299
          QEMU_TARGET="mips64el-softmmu"
300 301 302 303 304
          BUILDMAN="^qemu_mips64el$"
          TOOLCHAIN="mips"
    - env:
        - TEST_PY_BD="qemu-ppce500"
          TEST_PY_TEST_SPEC="not sleep"
305
          QEMU_TARGET="ppc-softmmu"
306 307 308 309
          BUILDMAN="^qemu-ppce500$"
    - env:
        - TEST_PY_BD="qemu-x86"
          TEST_PY_TEST_SPEC="not sleep"
310
          QEMU_TARGET="i386-softmmu"
311 312 313
          BUILDMAN="^qemu-x86$"
          TOOLCHAIN="x86_64"
          BUILD_ROM="yes"
314 315 316 317 318 319
    - env:
        - TEST_PY_BD="zynq_zc702"
          TEST_PY_TEST_SPEC="not sleep"
          QEMU_TARGET="arm-softmmu"
          TEST_PY_ID="--id qemu"
          BUILDMAN="^zynq_zc702$"
320 321

# TODO make it perfect ;-r