blob: cda2d979ee4ad2ce7119380fb69c921e13cd00d5 [file] [log] [blame]
Meier, Rogerc7cb3342014-11-19 15:26:18 +01001# 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
Tom Rini2bb76f32016-10-20 11:03:19 -04006sudo: required
7dist: trusty
Stephen Warrene4c1b4d2016-02-03 10:41:34 -07008
Meier, Rogerc7cb3342014-11-19 15:26:18 +01009language: c
10
Roger Meier050c7562016-01-25 20:22:41 +010011addons:
12 apt:
Tom Rini5ac58612016-10-20 11:26:40 -040013 sources:
14 - sourceline: 'ppa:gns3/qemu'
Roger Meier050c7562016-01-25 20:22:41 +010015 packages:
16 - cppcheck
17 - sloccount
18 - sparse
19 - bc
20 - build-essential
21 - libsdl1.2-dev
Stephen Warren07bf2122016-02-08 18:23:35 -070022 - python
23 - python-virtualenv
Tom Rini5ac58612016-10-20 11:26:40 -040024 - qemu-system-arm
25 - qemu-system-mips
26 - qemu-system-ppc
27 - qemu-system-x86
Tom Rinicd402e02016-10-20 11:08:26 -040028 - gcc-powerpc-linux-gnu
29 - gcc-arm-linux-gnueabihf
30 - iasl
Meier, Rogerc7cb3342014-11-19 15:26:18 +010031
32install:
Meier, Rogerc7cb3342014-11-19 15:26:18 +010033 # install latest device tree compiler
Tom Rini4084c7f2016-10-20 11:04:10 -040034 - git clone --depth=1 git://git.kernel.org/pub/scm/utils/dtc/dtc.git /tmp/dtc
Meier, Rogerc7cb3342014-11-19 15:26:18 +010035 - make -j4 -C /tmp/dtc
Tom Rini5ac58612016-10-20 11:26:40 -040036 # Clone uboot-test-hooks
37 - git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
38 - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
39 - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
Meier, Rogerc7cb3342014-11-19 15:26:18 +010040 # prepare buildman environment
Stephen Warren43a68e42016-10-26 11:05:31 -060041 - echo -e "[toolchain]\nroot = /usr" > ~/.buildman
Tom Rinicd402e02016-10-20 11:08:26 -040042 - echo -e "\n[toolchain-alias]\nblackfin = bfin\nsh = sh4\nopenrisc = or32" >> ~/.buildman
Meier, Rogerc7cb3342014-11-19 15:26:18 +010043 - cat ~/.buildman
Stephen Warren07bf2122016-02-08 18:23:35 -070044 - virtualenv /tmp/venv
45 - . /tmp/venv/bin/activate
46 - pip install pytest
Meier, Rogerc7cb3342014-11-19 15:26:18 +010047
48env:
49 global:
Tom Rini5ac58612016-10-20 11:26:40 -040050 - PATH=/tmp/dtc:/tmp/uboot-test-hooks/bin:$PATH
Meier, Rogerc7cb3342014-11-19 15:26:18 +010051 - BUILD_DIR=build
Meier, Rogerc7cb3342014-11-19 15:26:18 +010052 - HOSTCC="cc"
53 - HOSTCXX="c++"
Meier, Rogerc7cb3342014-11-19 15:26:18 +010054
55before_script:
Roger Meier050c7562016-01-25 20:22:41 +010056 # install toolchains based on TOOLCHAIN} variable
57 - if [[ "${TOOLCHAIN}" == *aarch64* ]]; then ./tools/buildman/buildman --fetch-arch aarch64 ; fi
Roger Meier050c7562016-01-25 20:22:41 +010058 - if [[ "${TOOLCHAIN}" == *avr32* ]]; then ./tools/buildman/buildman --fetch-arch avr32 ; fi
Tom Rinicd402e02016-10-20 11:08:26 -040059 - if [[ "${TOOLCHAIN}" == *bfin* ]]; then ./tools/buildman/buildman --fetch-arch bfin ; fi
Roger Meier050c7562016-01-25 20:22:41 +010060 - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi
Tom Rinicd402e02016-10-20 11:08:26 -040061 - if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi
Roger Meier050c7562016-01-25 20:22:41 +010062 - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi
Tom Rinicd402e02016-10-20 11:08:26 -040063 - if [[ "${TOOLCHAIN}" == *or32* ]]; then ./tools/buildman/buildman --fetch-arch or32 ; fi
64 - if [[ "${TOOLCHAIN}" == *sh4* ]]; then ./tools/buildman/buildman --fetch-arch sh4 ; fi
Stephen Warren2ded4bf2016-10-26 11:05:33 -060065 - if [[ "${TOOLCHAIN}" == *x86_64* ]]; then
66 ./tools/buildman/buildman --fetch-arch x86_64;
67 echo -e "\n[toolchain-prefix]\nx86 = ${HOME}/.buildman-toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-" >> ~/.buildman;
68 fi
Tom Rinicd402e02016-10-20 11:08:26 -040069 - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then ./tools/buildman/buildman --fetch-arch xtensa ; fi
Meier, Rogerc7cb3342014-11-19 15:26:18 +010070
71script:
Stephen Warren8304f052016-10-26 11:05:36 -060072 # Comments must be outside the command strings below, or the Travis parser
73 # will get confused.
74 #
Tom Rini48992102016-10-20 11:05:57 -040075 # Exit code 129 means warnings only.
Roger Meier050c7562016-01-25 20:22:41 +010076 - if [[ "${BUILDMAN}" != "" ]]; then
Tom Rini48992102016-10-20 11:05:57 -040077 set +e;
Stephen Warren440d8462016-10-26 11:05:34 -060078 tools/buildman/buildman -P ${BUILDMAN};
Stephen Warren0c5145f2016-10-26 11:05:32 -060079 ret=$?;
Stephen Warrenbf1c0882016-10-26 11:05:35 -060080 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Stephen Warren0c5145f2016-10-26 11:05:32 -060081 exit $ret;
82 fi;
Roger Meier050c7562016-01-25 20:22:41 +010083 fi
Stephen Warren8304f052016-10-26 11:05:36 -060084 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
85 # never prevent any test from running. That way, we can always pass
86 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
87 # value.
88 - if [[ "${TEST_PY_BD}" != "" ]]; then
89 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
90 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
91 --build-dir `cd .. && pwd`/.bm-work/${TEST_PY_BD};
92 fi
Meier, Rogerc7cb3342014-11-19 15:26:18 +010093
94matrix:
95 include:
96 # we need to build by vendor due to 50min time limit for builds
97 # each env setting here is a dedicated build
98 - env:
Roger Meier050c7562016-01-25 20:22:41 +010099 - BUILDMAN="arm1136"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100100 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100101 - BUILDMAN="arm1176"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100102 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100103 - BUILDMAN="arm720t"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100104 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100105 - BUILDMAN="arm920t"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100106 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100107 - BUILDMAN="atmel -x avr32"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100108 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100109 - BUILDMAN="avr32"
110 TOOLCHAIN="avr32"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100111 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100112 - BUILDMAN="davinci"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100113 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100114 - BUILDMAN="denx"
Heiko Schocherd9aa0192015-03-05 09:02:23 +0100115 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100116 - BUILDMAN="freescale -x powerpc,m68k,aarch64"
Heiko Schocherd9aa0192015-03-05 09:02:23 +0100117 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100118 - BUILDMAN="sandbox x86"
Tom Rinicd402e02016-10-20 11:08:26 -0400119 TOOLCHAIN="x86_64"
Heiko Schocherd9aa0192015-03-05 09:02:23 +0100120 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100121 - BUILDMAN="kirkwood"
Heiko Schocherd9aa0192015-03-05 09:02:23 +0100122 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100123 - BUILDMAN="m68k"
124 TOOLCHAIN="m68k"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100125 - env:
Tom Rini76761e72016-10-20 11:23:15 -0400126 - BUILDMAN="microblaze"
127 TOOLCHAIN="microblaze"
128 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100129 - BUILDMAN="mips"
130 TOOLCHAIN="mips"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100131 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100132 - BUILDMAN="mpc512x"
Heiko Schocherd9aa0192015-03-05 09:02:23 +0100133 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100134 - BUILDMAN="mpc5xx"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100135 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100136 - BUILDMAN="mpc5xxx"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100137 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100138 - BUILDMAN="mpc8260"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100139 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100140 - BUILDMAN="mpc83xx"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100141 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100142 - BUILDMAN="mpc85xx -x freescale"
Heiko Schocherd9aa0192015-03-05 09:02:23 +0100143 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100144 - 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 Schocher8cb21012015-03-17 08:21:41 +0100145 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100146 - BUILDMAN="t208xrdb t4qds t102*"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100147 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100148 - BUILDMAN="p1_p2_rdb_pc p1010rdb"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100149 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100150 - BUILDMAN="corenet_ds b4860qds sbc8548 bsc91*"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100151 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100152 - BUILDMAN="mpc86xx"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100153 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100154 - BUILDMAN="mpc8xx"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100155 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100156 - BUILDMAN="siemens"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100157 - env:
Stephen Warren1fcf0ee2016-10-26 13:05:52 -0600158 - BUILDMAN="tegra -x aarch64"
159 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100160 - BUILDMAN="ti"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100161 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100162 - BUILDMAN="aarch64"
163 TOOLCHAIN="aarch64"
Tom Rini76761e72016-10-20 11:23:15 -0400164 - env:
165 - BUILDMAN="sh4"
166 TOOLCHAIN="sh4"
167 - env:
168 - BUILDMAN="xtensa"
169 TOOLCHAIN="xtensa"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100170
171 # QA jobs for code analytics
172 # static code analysis with cppcheck (we can add --enable=all later)
Stephen Warrend7882212016-10-24 16:41:48 -0600173 - env:
174 - JOB="cppcheck"
175 script:
Tom Rinic85b52e2016-10-20 11:24:52 -0400176 - cppcheck --force --quiet --inline-suppr .
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100177 # search for TODO within source tree
Stephen Warrend7882212016-10-24 16:41:48 -0600178 - env:
179 - JOB="grep TODO"
180 script:
Tom Rinic85b52e2016-10-20 11:24:52 -0400181 - grep -r TODO .
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100182 # search for FIXME within source tree
Stephen Warrend7882212016-10-24 16:41:48 -0600183 - env:
184 - JOB="grep FIXME HACK"
185 script:
Tom Rinic85b52e2016-10-20 11:24:52 -0400186 - grep -r FIXME .
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100187 # search for HACK within source tree and ignore HACKKIT board
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100188 script:
189 - grep -r HACK . | grep -v HACKKIT
190 # some statistics about the code base
Stephen Warrend7882212016-10-24 16:41:48 -0600191 - env:
192 - JOB="sloccount"
193 script:
Tom Rinic85b52e2016-10-20 11:24:52 -0400194 - sloccount .
Stephen Warren8304f052016-10-26 11:05:36 -0600195
Stephen Warren07bf2122016-02-08 18:23:35 -0700196 # test/py
Stephen Warrend7882212016-10-24 16:41:48 -0600197 - env:
Stephen Warren8304f052016-10-26 11:05:36 -0600198 - TEST_PY_BD="sandbox"
199 BUILDMAN="^sandbox$"
200 TOOLCHAIN="x86_64"
Tom Rini5ac58612016-10-20 11:26:40 -0400201 - env:
Stephen Warren8304f052016-10-26 11:05:36 -0600202 - TEST_PY_BD="vexpress_ca15_tc2"
203 TEST_PY_ID="--id qemu"
204 BUILDMAN="^vexpress_ca15_tc2$"
Tom Rini5ac58612016-10-20 11:26:40 -0400205 - env:
Stephen Warren8304f052016-10-26 11:05:36 -0600206 - TEST_PY_BD="vexpress_ca9x4"
207 TEST_PY_ID="--id qemu"
208 BUILDMAN="^vexpress_ca9x4$"
Tom Rini5ac58612016-10-20 11:26:40 -0400209 - env:
Stephen Warren8304f052016-10-26 11:05:36 -0600210 - TEST_PY_BD="integratorcp_cm926ejs"
211 TEST_PY_ID="--id qemu"
212 BUILDMAN="^integratorcp_cm926ejs$"
Tom Rini5ac58612016-10-20 11:26:40 -0400213 - env:
Stephen Warren8304f052016-10-26 11:05:36 -0600214 - TEST_PY_BD="qemu_mips"
215 TEST_PY_TEST_SPEC="not sleep"
216 BUILDMAN="^qemu_mips$"
217 TOOLCHAIN="mips"
218 - env:
219 - TEST_PY_BD="qemu_mipsel"
220 TEST_PY_TEST_SPEC="not sleep"
221 BUILDMAN="^qemu_mipsel$"
222 TOOLCHAIN="mips"
223 - env:
224 - TEST_PY_BD="qemu_mips64"
225 TEST_PY_TEST_SPEC="not sleep"
226 BUILDMAN="^qemu_mips64$"
227 TOOLCHAIN="mips"
228 - env:
229 - TEST_PY_BD="qemu_mips64el"
230 TEST_PY_TEST_SPEC="not sleep"
231 BUILDMAN="^qemu_mips64el$"
232 TOOLCHAIN="mips"
233 - env:
234 - TEST_PY_BD="qemu-ppce500"
235 TEST_PY_TEST_SPEC="not sleep"
236 BUILDMAN="^qemu-ppce500$"
237 - env:
238 - TEST_PY_BD="qemu-x86"
239 TEST_PY_TEST_SPEC="not sleep"
240 BUILDMAN="^qemu-x86$"
241 TOOLCHAIN="x86_64"
242 BUILD_ROM="yes"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100243
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100244# TODO make it perfect ;-r