blob: 00be5ff203961dead3ab6750830ff21876a97f71 [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
41 - export BUILDMAN_ROOT="root:"
Tom Rinicd402e02016-10-20 11:08:26 -040042 - echo -e "[toolchain]\n${BUILDMAN_ROOT} /usr" > ~/.buildman
43 - echo -e "\n[toolchain-alias]\nblackfin = bfin\nsh = sh4\nopenrisc = or32" >> ~/.buildman
Meier, Rogerc7cb3342014-11-19 15:26:18 +010044 - cat ~/.buildman
Stephen Warren07bf2122016-02-08 18:23:35 -070045 - virtualenv /tmp/venv
46 - . /tmp/venv/bin/activate
47 - pip install pytest
Meier, Rogerc7cb3342014-11-19 15:26:18 +010048
49env:
50 global:
Tom Rini5ac58612016-10-20 11:26:40 -040051 - PATH=/tmp/dtc:/tmp/uboot-test-hooks/bin:$PATH
Meier, Rogerc7cb3342014-11-19 15:26:18 +010052 - BUILD_DIR=build
Meier, Rogerc7cb3342014-11-19 15:26:18 +010053 - HOSTCC="cc"
54 - HOSTCXX="c++"
Meier, Rogerc7cb3342014-11-19 15:26:18 +010055
56before_script:
Roger Meier050c7562016-01-25 20:22:41 +010057 # install toolchains based on TOOLCHAIN} variable
58 - if [[ "${TOOLCHAIN}" == *aarch64* ]]; then ./tools/buildman/buildman --fetch-arch aarch64 ; fi
Roger Meier050c7562016-01-25 20:22:41 +010059 - if [[ "${TOOLCHAIN}" == *avr32* ]]; then ./tools/buildman/buildman --fetch-arch avr32 ; fi
Tom Rinicd402e02016-10-20 11:08:26 -040060 - if [[ "${TOOLCHAIN}" == *bfin* ]]; then ./tools/buildman/buildman --fetch-arch bfin ; fi
Roger Meier050c7562016-01-25 20:22:41 +010061 - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi
Tom Rinicd402e02016-10-20 11:08:26 -040062 - if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi
Roger Meier050c7562016-01-25 20:22:41 +010063 - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi
Tom Rinicd402e02016-10-20 11:08:26 -040064 - if [[ "${TOOLCHAIN}" == *or32* ]]; then ./tools/buildman/buildman --fetch-arch or32 ; fi
65 - if [[ "${TOOLCHAIN}" == *sh4* ]]; then ./tools/buildman/buildman --fetch-arch sh4 ; fi
66 - if [[ "${TOOLCHAIN}" == *x86_64* ]]; then ./tools/buildman/buildman --fetch-arch x86_64 ; fi
67 - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then ./tools/buildman/buildman --fetch-arch xtensa ; fi
Meier, Rogerc7cb3342014-11-19 15:26:18 +010068
69script:
Tom Rini48992102016-10-20 11:05:57 -040070 # Exit code 129 means warnings only.
Roger Meier050c7562016-01-25 20:22:41 +010071 - if [[ "${BUILDMAN}" != "" ]]; then
Tom Rini48992102016-10-20 11:05:57 -040072 set +e;
Roger Meier050c7562016-01-25 20:22:41 +010073 tools/buildman/buildman ${BUILDMAN};
Tom Rini48992102016-10-20 11:05:57 -040074 if [[ "$?" == "0" || "$?" == "129" ]]; then
75 exit 0;
76 else
77 exit $?;
78 fi
Roger Meier050c7562016-01-25 20:22:41 +010079 fi
Meier, Rogerc7cb3342014-11-19 15:26:18 +010080
81matrix:
82 include:
83 # we need to build by vendor due to 50min time limit for builds
84 # each env setting here is a dedicated build
85 - env:
Roger Meier050c7562016-01-25 20:22:41 +010086 - BUILDMAN="arm1136"
Meier, Rogerc7cb3342014-11-19 15:26:18 +010087 - env:
Roger Meier050c7562016-01-25 20:22:41 +010088 - BUILDMAN="arm1176"
Meier, Rogerc7cb3342014-11-19 15:26:18 +010089 - env:
Roger Meier050c7562016-01-25 20:22:41 +010090 - BUILDMAN="arm720t"
Meier, Rogerc7cb3342014-11-19 15:26:18 +010091 - env:
Roger Meier050c7562016-01-25 20:22:41 +010092 - BUILDMAN="arm920t"
Meier, Rogerc7cb3342014-11-19 15:26:18 +010093 - env:
Roger Meier050c7562016-01-25 20:22:41 +010094 - BUILDMAN="atmel -x avr32"
Meier, Rogerc7cb3342014-11-19 15:26:18 +010095 - env:
Roger Meier050c7562016-01-25 20:22:41 +010096 - BUILDMAN="avr32"
97 TOOLCHAIN="avr32"
Meier, Rogerc7cb3342014-11-19 15:26:18 +010098 - env:
Roger Meier050c7562016-01-25 20:22:41 +010099 - BUILDMAN="davinci"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100100 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100101 - BUILDMAN="denx"
Heiko Schocherd9aa0192015-03-05 09:02:23 +0100102 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100103 - BUILDMAN="freescale -x powerpc,m68k,aarch64"
Heiko Schocherd9aa0192015-03-05 09:02:23 +0100104 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100105 - BUILDMAN="sandbox x86"
Tom Rinicd402e02016-10-20 11:08:26 -0400106 TOOLCHAIN="x86_64"
107 script:
108 - export BUILDMAN_X86="x86:";
109 echo -e "\n[toolchain-prefix]\n${BUILDMAN_X86} ${HOME}/.buildman-toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-" >> ~/.buildman
Heiko Schocherd9aa0192015-03-05 09:02:23 +0100110 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100111 - BUILDMAN="kirkwood"
Heiko Schocherd9aa0192015-03-05 09:02:23 +0100112 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100113 - BUILDMAN="m68k"
114 TOOLCHAIN="m68k"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100115 - env:
Tom Rini76761e72016-10-20 11:23:15 -0400116 - BUILDMAN="microblaze"
117 TOOLCHAIN="microblaze"
118 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100119 - BUILDMAN="mips"
120 TOOLCHAIN="mips"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100121 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100122 - BUILDMAN="mpc512x"
Heiko Schocherd9aa0192015-03-05 09:02:23 +0100123 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100124 - BUILDMAN="mpc5xx"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100125 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100126 - BUILDMAN="mpc5xxx"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100127 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100128 - BUILDMAN="mpc8260"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100129 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100130 - BUILDMAN="mpc83xx"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100131 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100132 - BUILDMAN="mpc85xx -x freescale"
Heiko Schocherd9aa0192015-03-05 09:02:23 +0100133 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100134 - 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 +0100135 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100136 - BUILDMAN="t208xrdb t4qds t102*"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100137 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100138 - BUILDMAN="p1_p2_rdb_pc p1010rdb"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100139 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100140 - BUILDMAN="corenet_ds b4860qds sbc8548 bsc91*"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100141 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100142 - BUILDMAN="mpc86xx"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100143 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100144 - BUILDMAN="mpc8xx"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100145 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100146 - BUILDMAN="siemens"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100147 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100148 - BUILDMAN="ti"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100149 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100150 - BUILDMAN="aarch64"
151 TOOLCHAIN="aarch64"
Tom Rini76761e72016-10-20 11:23:15 -0400152 - env:
153 - BUILDMAN="sh4"
154 TOOLCHAIN="sh4"
155 - env:
156 - BUILDMAN="xtensa"
157 TOOLCHAIN="xtensa"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100158
159 # QA jobs for code analytics
160 # static code analysis with cppcheck (we can add --enable=all later)
Stephen Warrend7882212016-10-24 16:41:48 -0600161 - env:
162 - JOB="cppcheck"
163 script:
Tom Rinic85b52e2016-10-20 11:24:52 -0400164 - cppcheck --force --quiet --inline-suppr .
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100165 # search for TODO within source tree
Stephen Warrend7882212016-10-24 16:41:48 -0600166 - env:
167 - JOB="grep TODO"
168 script:
Tom Rinic85b52e2016-10-20 11:24:52 -0400169 - grep -r TODO .
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100170 # search for FIXME within source tree
Stephen Warrend7882212016-10-24 16:41:48 -0600171 - env:
172 - JOB="grep FIXME HACK"
173 script:
Tom Rinic85b52e2016-10-20 11:24:52 -0400174 - grep -r FIXME .
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100175 # search for HACK within source tree and ignore HACKKIT board
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100176 script:
177 - grep -r HACK . | grep -v HACKKIT
178 # some statistics about the code base
Stephen Warrend7882212016-10-24 16:41:48 -0600179 - env:
180 - JOB="sloccount"
181 script:
Tom Rinic85b52e2016-10-20 11:24:52 -0400182 - sloccount .
Stephen Warren07bf2122016-02-08 18:23:35 -0700183 # test/py
Stephen Warrend7882212016-10-24 16:41:48 -0600184 - env:
185 - JOB="test.py sandbox"
186 script:
Tom Rinic85b52e2016-10-20 11:24:52 -0400187 - ./test/py/test.py --bd sandbox --build
Tom Rini5ac58612016-10-20 11:26:40 -0400188 - env:
Stephen Warrend7882212016-10-24 16:41:48 -0600189 - JOB="test.py ARM"
Tom Rini5ac58612016-10-20 11:26:40 -0400190 - CROSS_COMPILE="/usr/bin/arm-linux-gnueabihf-"
191 script:
192 - ./test/py/test.py --bd vexpress_ca15_tc2 --id qemu --build;
193 ./test/py/test.py --bd vexpress_ca9x4 --id qemu --build;
194 ./test/py/test.py --bd integratorcp_cm926ejs --id qemu --build;
195 - env:
Stephen Warrend7882212016-10-24 16:41:48 -0600196 - JOB="test.py MIPS"
Tom Rini5ac58612016-10-20 11:26:40 -0400197 - TOOLCHAIN="mips"
198 CROSS_COMPILE="${HOME}/.buildman-toolchains/gcc-4.9.0-nolibc/mips-linux/bin/mips-linux-"
199 script:
200 - ./test/py/test.py --bd qemu_mips --build -k 'not sleep';
201 ./test/py/test.py --bd qemu_mipsel --build -k 'not sleep';
202 ./test/py/test.py --bd qemu_mips64 --build -k 'not sleep';
203 ./test/py/test.py --bd qemu_mips64el --build -k 'not sleep';
204 - env:
Stephen Warrend7882212016-10-24 16:41:48 -0600205 - JOB="test.py PowerPC"
Tom Rini5ac58612016-10-20 11:26:40 -0400206 - CROSS_COMPILE="/usr/bin/powerpc-linux-gnu-"
207 script:
208 - ./test/py/test.py --bd qemu-ppce500 --build -k 'not sleep'
209 - env:
Stephen Warrend7882212016-10-24 16:41:48 -0600210 - JOB="test.py x86-64"
Tom Rini5ac58612016-10-20 11:26:40 -0400211 - TOOLCHAIN="x86_64"
212 BUILD_ROM=yes
213 CROSS_COMPILE="${HOME}/.buildman-toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-"
214 script:
215 - ./test/py/test.py --bd qemu-x86 --build -k 'not sleep'
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100216
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100217# TODO make it perfect ;-r