119dec8df5b2cb3541c1665795231f94b7465790
[platform/kernel/u-boot.git] / .travis.yml
1 # 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
6 sudo: required
7 dist: trusty
8
9 language: c
10
11 addons:
12   apt:
13     sources:
14     - sourceline: 'ppa:gns3/qemu'
15     packages:
16     - cppcheck
17     - sloccount
18     - sparse
19     - bc
20     - build-essential
21     - libsdl1.2-dev
22     - python
23     - python-virtualenv
24     - qemu-system-arm
25     - qemu-system-mips
26     - qemu-system-ppc
27     - qemu-system-x86
28     - gcc-powerpc-linux-gnu
29     - gcc-arm-linux-gnueabihf
30     - iasl
31
32 install:
33  # install latest device tree compiler
34  - git clone --depth=1 git://git.kernel.org/pub/scm/utils/dtc/dtc.git /tmp/dtc
35  - make -j4 -C /tmp/dtc
36  # 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`
40  # prepare buildman environment
41  - echo -e "[toolchain]\nroot = /usr" > ~/.buildman
42  - echo -e "\n[toolchain-alias]\nblackfin = bfin\nsh = sh4\nopenrisc = or32" >> ~/.buildman
43  - cat ~/.buildman
44  - virtualenv /tmp/venv
45  - . /tmp/venv/bin/activate
46  - pip install pytest
47
48 env:
49   global:
50     - PATH=/tmp/dtc:/tmp/uboot-test-hooks/bin:$PATH
51     - BUILD_DIR=build
52     - HOSTCC="cc"
53     - HOSTCXX="c++"
54
55 before_script:
56   # install toolchains based on TOOLCHAIN} variable
57   - if [[ "${TOOLCHAIN}" == *aarch64* ]]; then ./tools/buildman/buildman --fetch-arch aarch64 ; fi
58   - 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   - if [[ "${TOOLCHAIN}" == *or32* ]]; then ./tools/buildman/buildman --fetch-arch or32 ; fi
64   - if [[ "${TOOLCHAIN}" == *sh4* ]]; then ./tools/buildman/buildman --fetch-arch sh4 ; fi
65   - 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
69   - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then ./tools/buildman/buildman --fetch-arch xtensa ; fi
70
71 script:
72  # Exit code 129 means warnings only.
73  - if [[ "${BUILDMAN}" != "" ]]; then
74      set +e;
75      tools/buildman/buildman ${BUILDMAN};
76      ret=$?;
77      if [[ $ret -eq 0 || $ret -eq 129 ]]; then
78        exit 0;
79      else
80        exit $ret;
81      fi;
82    fi
83
84 matrix:
85   include:
86   # we need to build by vendor due to 50min time limit for builds
87   # each env setting here is a dedicated build
88     - env:
89         - BUILDMAN="arm1136"
90     - env:
91         - BUILDMAN="arm1176"
92     - env:
93         - BUILDMAN="arm720t"
94     - env:
95         - BUILDMAN="arm920t"
96     - env:
97         - BUILDMAN="atmel -x avr32"
98     - env:
99         - BUILDMAN="avr32"
100           TOOLCHAIN="avr32"
101     - env:
102         - BUILDMAN="davinci"
103     - env:
104         - BUILDMAN="denx"
105     - env:
106         - BUILDMAN="freescale -x powerpc,m68k,aarch64"
107     - env:
108         - BUILDMAN="sandbox x86"
109           TOOLCHAIN="x86_64"
110     - env:
111         - BUILDMAN="kirkwood"
112     - env:
113         - BUILDMAN="m68k"
114           TOOLCHAIN="m68k"
115     - env:
116         - BUILDMAN="microblaze"
117           TOOLCHAIN="microblaze"
118     - env:
119         - BUILDMAN="mips"
120           TOOLCHAIN="mips"
121     - env:
122         - BUILDMAN="mpc512x"
123     - env:
124         - BUILDMAN="mpc5xx"
125     - env:
126         - BUILDMAN="mpc5xxx"
127     - env:
128         - BUILDMAN="mpc8260"
129     - env:
130         - BUILDMAN="mpc83xx"
131     - env:
132         - BUILDMAN="mpc85xx -x freescale"
133     - env:
134         - BUILDMAN="mpc85xx -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x sbc8548 -x bsc91*"
135     - env:
136         - BUILDMAN="t208xrdb t4qds t102*"
137     - env:
138         - BUILDMAN="p1_p2_rdb_pc p1010rdb"
139     - env:
140         - BUILDMAN="corenet_ds b4860qds sbc8548 bsc91*"
141     - env:
142         - BUILDMAN="mpc86xx"
143     - env:
144         - BUILDMAN="mpc8xx"
145     - env:
146         - BUILDMAN="siemens"
147     - env:
148         - BUILDMAN="ti"
149     - env:
150         - BUILDMAN="aarch64"
151           TOOLCHAIN="aarch64"
152     - env:
153         - BUILDMAN="sh4"
154           TOOLCHAIN="sh4"
155     - env:
156         - BUILDMAN="xtensa"
157           TOOLCHAIN="xtensa"
158
159     # QA jobs for code analytics
160     # static code analysis with cppcheck (we can add --enable=all later)
161     - env:
162         - JOB="cppcheck"
163       script:
164         - cppcheck --force --quiet --inline-suppr .
165     # search for TODO within source tree
166     - env:
167         - JOB="grep TODO"
168       script:
169         - grep -r TODO .
170     # search for FIXME within source tree
171     - env:
172         - JOB="grep FIXME HACK"
173       script:
174         - grep -r FIXME .
175     # search for HACK within source tree and ignore HACKKIT board
176       script:
177         - grep -r HACK . | grep -v HACKKIT
178     # some statistics about the code base
179     - env:
180         - JOB="sloccount"
181       script:
182         - sloccount .
183     # test/py
184     - env:
185         - JOB="test.py sandbox"
186       script:
187         - ./test/py/test.py --bd sandbox --build
188     - env:
189         - JOB="test.py ARM"
190         - 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:
196         - JOB="test.py MIPS"
197         - 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:
205         - JOB="test.py PowerPC"
206         - CROSS_COMPILE="/usr/bin/powerpc-linux-gnu-"
207       script:
208         - ./test/py/test.py --bd qemu-ppce500 --build -k 'not sleep'
209     - env:
210         - JOB="test.py x86-64"
211         - 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'
216
217 # TODO make it perfect ;-r