blob: 8d1a90eb164b010141fcff2f072727d2ea7e808a [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:
13 packages:
14 - cppcheck
15 - sloccount
16 - sparse
17 - bc
18 - build-essential
19 - libsdl1.2-dev
Stephen Warren07bf2122016-02-08 18:23:35 -070020 - python
21 - python-virtualenv
Tom Rinicd402e02016-10-20 11:08:26 -040022 - gcc-powerpc-linux-gnu
23 - gcc-arm-linux-gnueabihf
24 - iasl
Meier, Rogerc7cb3342014-11-19 15:26:18 +010025
26install:
Meier, Rogerc7cb3342014-11-19 15:26:18 +010027 # install latest device tree compiler
Tom Rini4084c7f2016-10-20 11:04:10 -040028 - git clone --depth=1 git://git.kernel.org/pub/scm/utils/dtc/dtc.git /tmp/dtc
Meier, Rogerc7cb3342014-11-19 15:26:18 +010029 - make -j4 -C /tmp/dtc
30 # prepare buildman environment
31 - export BUILDMAN_ROOT="root:"
Tom Rinicd402e02016-10-20 11:08:26 -040032 - echo -e "[toolchain]\n${BUILDMAN_ROOT} /usr" > ~/.buildman
33 - echo -e "\n[toolchain-alias]\nblackfin = bfin\nsh = sh4\nopenrisc = or32" >> ~/.buildman
Meier, Rogerc7cb3342014-11-19 15:26:18 +010034 - cat ~/.buildman
Stephen Warren07bf2122016-02-08 18:23:35 -070035 - virtualenv /tmp/venv
36 - . /tmp/venv/bin/activate
37 - pip install pytest
Meier, Rogerc7cb3342014-11-19 15:26:18 +010038
39env:
40 global:
41 - PATH=/tmp/dtc:$PATH
42 - BUILD_DIR=build
Meier, Rogerc7cb3342014-11-19 15:26:18 +010043 - HOSTCC="cc"
44 - HOSTCXX="c++"
Meier, Rogerc7cb3342014-11-19 15:26:18 +010045
46before_script:
Roger Meier050c7562016-01-25 20:22:41 +010047 # install toolchains based on TOOLCHAIN} variable
48 - if [[ "${TOOLCHAIN}" == *aarch64* ]]; then ./tools/buildman/buildman --fetch-arch aarch64 ; fi
Roger Meier050c7562016-01-25 20:22:41 +010049 - if [[ "${TOOLCHAIN}" == *avr32* ]]; then ./tools/buildman/buildman --fetch-arch avr32 ; fi
Tom Rinicd402e02016-10-20 11:08:26 -040050 - if [[ "${TOOLCHAIN}" == *bfin* ]]; then ./tools/buildman/buildman --fetch-arch bfin ; fi
Roger Meier050c7562016-01-25 20:22:41 +010051 - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi
Tom Rinicd402e02016-10-20 11:08:26 -040052 - if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi
Roger Meier050c7562016-01-25 20:22:41 +010053 - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi
Tom Rinicd402e02016-10-20 11:08:26 -040054 - if [[ "${TOOLCHAIN}" == *or32* ]]; then ./tools/buildman/buildman --fetch-arch or32 ; fi
55 - if [[ "${TOOLCHAIN}" == *sh4* ]]; then ./tools/buildman/buildman --fetch-arch sh4 ; fi
56 - if [[ "${TOOLCHAIN}" == *x86_64* ]]; then ./tools/buildman/buildman --fetch-arch x86_64 ; fi
57 - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then ./tools/buildman/buildman --fetch-arch xtensa ; fi
Meier, Rogerc7cb3342014-11-19 15:26:18 +010058
59script:
60 # the execution sequence for each test
Roger Meier050c7562016-01-25 20:22:41 +010061 - if [[ "${TEST_CMD}" != "" ]]; then
62 ${TEST_CMD};
63 fi
Tom Rini48992102016-10-20 11:05:57 -040064 # Exit code 129 means warnings only.
Roger Meier050c7562016-01-25 20:22:41 +010065 - if [[ "${BUILDMAN}" != "" ]]; then
Tom Rini48992102016-10-20 11:05:57 -040066 set +e;
Roger Meier050c7562016-01-25 20:22:41 +010067 tools/buildman/buildman ${BUILDMAN};
Tom Rini48992102016-10-20 11:05:57 -040068 if [[ "$?" == "0" || "$?" == "129" ]]; then
69 exit 0;
70 else
71 exit $?;
72 fi
Roger Meier050c7562016-01-25 20:22:41 +010073 fi
Meier, Rogerc7cb3342014-11-19 15:26:18 +010074
75matrix:
76 include:
77 # we need to build by vendor due to 50min time limit for builds
78 # each env setting here is a dedicated build
79 - env:
Roger Meier050c7562016-01-25 20:22:41 +010080 - BUILDMAN="arm1136"
Meier, Rogerc7cb3342014-11-19 15:26:18 +010081 - env:
Roger Meier050c7562016-01-25 20:22:41 +010082 - BUILDMAN="arm1136"
Meier, Rogerc7cb3342014-11-19 15:26:18 +010083 - env:
Roger Meier050c7562016-01-25 20:22:41 +010084 - BUILDMAN="arm1176"
Meier, Rogerc7cb3342014-11-19 15:26:18 +010085 - env:
Roger Meier050c7562016-01-25 20:22:41 +010086 - BUILDMAN="arm720t"
Meier, Rogerc7cb3342014-11-19 15:26:18 +010087 - env:
Roger Meier050c7562016-01-25 20:22:41 +010088 - BUILDMAN="arm920t"
Meier, Rogerc7cb3342014-11-19 15:26:18 +010089 - env:
Roger Meier050c7562016-01-25 20:22:41 +010090 - BUILDMAN="atmel -x avr32"
Meier, Rogerc7cb3342014-11-19 15:26:18 +010091 - env:
Roger Meier050c7562016-01-25 20:22:41 +010092 - BUILDMAN="avr32"
93 TOOLCHAIN="avr32"
Meier, Rogerc7cb3342014-11-19 15:26:18 +010094 - env:
Roger Meier050c7562016-01-25 20:22:41 +010095 - BUILDMAN="davinci"
Meier, Rogerc7cb3342014-11-19 15:26:18 +010096 - env:
Roger Meier050c7562016-01-25 20:22:41 +010097 - BUILDMAN="denx"
Heiko Schocherd9aa0192015-03-05 09:02:23 +010098 - env:
Roger Meier050c7562016-01-25 20:22:41 +010099 - BUILDMAN="freescale -x powerpc,m68k,aarch64"
Heiko Schocherd9aa0192015-03-05 09:02:23 +0100100 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100101 - BUILDMAN="sandbox x86"
Tom Rinicd402e02016-10-20 11:08:26 -0400102 TOOLCHAIN="x86_64"
103 script:
104 - export BUILDMAN_X86="x86:";
105 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 +0100106 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100107 - BUILDMAN="kirkwood"
Heiko Schocherd9aa0192015-03-05 09:02:23 +0100108 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100109 - BUILDMAN="m68k"
110 TOOLCHAIN="m68k"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100111 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100112 - BUILDMAN="mips"
113 TOOLCHAIN="mips"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100114 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100115 - BUILDMAN="mpc512x"
Heiko Schocherd9aa0192015-03-05 09:02:23 +0100116 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100117 - BUILDMAN="mpc5xx"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100118 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100119 - BUILDMAN="mpc5xxx"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100120 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100121 - BUILDMAN="mpc8260"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100122 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100123 - BUILDMAN="mpc83xx"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100124 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100125 - BUILDMAN="mpc85xx -x freescale"
Heiko Schocherd9aa0192015-03-05 09:02:23 +0100126 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100127 - 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 +0100128 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100129 - BUILDMAN="t208xrdb t4qds t102*"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100130 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100131 - BUILDMAN="p1_p2_rdb_pc p1010rdb"
Heiko Schocher8cb21012015-03-17 08:21:41 +0100132 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100133 - BUILDMAN="corenet_ds b4860qds sbc8548 bsc91*"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100134 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100135 - BUILDMAN="mpc86xx"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100136 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100137 - BUILDMAN="mpc8xx"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100138 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100139 - BUILDMAN="siemens"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100140 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100141 - BUILDMAN="ti"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100142 - env:
Roger Meier050c7562016-01-25 20:22:41 +0100143 - BUILDMAN="aarch64"
144 TOOLCHAIN="aarch64"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100145
146 # QA jobs for code analytics
147 # static code analysis with cppcheck (we can add --enable=all later)
148 - env:
149 - TEST_CMD="cppcheck --force --quiet --inline-suppr ."
150 # search for TODO within source tree
151 - env:
152 - TEST_CMD="grep -r TODO ."
153 # search for FIXME within source tree
154 - env:
155 - TEST_CMD="grep -r FIXME ."
156 # search for HACK within source tree and ignore HACKKIT board
157 - env:
158 - TEST_CMD="grep -r HACK . | grep -v HACKKIT"
159 script:
160 - grep -r HACK . | grep -v HACKKIT
161 # some statistics about the code base
162 - env:
163 - TEST_CMD="sloccount ."
Stephen Warren07bf2122016-02-08 18:23:35 -0700164 # test/py
165 - env:
166 - TEST_CMD="./test/py/test.py --bd sandbox --build"
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100167
Meier, Rogerc7cb3342014-11-19 15:26:18 +0100168# TODO make it perfect ;-r