]> git.sur5r.net Git - u-boot/blob - .travis.yml
travis-ci: Add test.py for various qemu platforms
[u-boot] / .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  - export BUILDMAN_ROOT="root:"
42  - echo -e "[toolchain]\n${BUILDMAN_ROOT} /usr" > ~/.buildman
43  - echo -e "\n[toolchain-alias]\nblackfin = bfin\nsh = sh4\nopenrisc = or32" >> ~/.buildman
44  - cat ~/.buildman
45  - virtualenv /tmp/venv
46  - . /tmp/venv/bin/activate
47  - pip install pytest
48
49 env:
50   global:
51     - PATH=/tmp/dtc:/tmp/uboot-test-hooks/bin:$PATH
52     - BUILD_DIR=build
53     - HOSTCC="cc"
54     - HOSTCXX="c++"
55
56 before_script:
57   # install toolchains based on TOOLCHAIN} variable
58   - if [[ "${TOOLCHAIN}" == *aarch64* ]]; then ./tools/buildman/buildman --fetch-arch aarch64 ; fi
59   - if [[ "${TOOLCHAIN}" == *avr32* ]]; then ./tools/buildman/buildman --fetch-arch avr32 ; fi
60   - if [[ "${TOOLCHAIN}" == *bfin* ]]; then ./tools/buildman/buildman --fetch-arch bfin ; fi
61   - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi
62   - if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi
63   - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi
64   - 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
68
69 script:
70  # Exit code 129 means warnings only.
71  - if [[ "${BUILDMAN}" != "" ]]; then
72      set +e;
73      tools/buildman/buildman ${BUILDMAN};
74      if [[ "$?" == "0" || "$?" == "129" ]]; then
75        exit 0;
76      else
77        exit $?;
78      fi
79    fi
80
81 matrix:
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:
86         - BUILDMAN="arm1136"
87     - env:
88         - BUILDMAN="arm1136"
89     - env:
90         - BUILDMAN="arm1176"
91     - env:
92         - BUILDMAN="arm720t"
93     - env:
94         - BUILDMAN="arm920t"
95     - env:
96         - BUILDMAN="atmel -x avr32"
97     - env:
98         - BUILDMAN="avr32"
99           TOOLCHAIN="avr32"
100     - env:
101         - BUILDMAN="davinci"
102     - env:
103         - BUILDMAN="denx"
104     - env:
105         - BUILDMAN="freescale -x powerpc,m68k,aarch64"
106     - env:
107         - BUILDMAN="sandbox x86"
108           TOOLCHAIN="x86_64"
109       script:
110         - export BUILDMAN_X86="x86:";
111           echo -e "\n[toolchain-prefix]\n${BUILDMAN_X86} ${HOME}/.buildman-toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-" >> ~/.buildman
112     - env:
113         - BUILDMAN="kirkwood"
114     - env:
115         - BUILDMAN="m68k"
116           TOOLCHAIN="m68k"
117     - env:
118         - BUILDMAN="microblaze"
119           TOOLCHAIN="microblaze"
120     - env:
121         - BUILDMAN="mips"
122           TOOLCHAIN="mips"
123     - env:
124         - BUILDMAN="mpc512x"
125     - env:
126         - BUILDMAN="mpc5xx"
127     - env:
128         - BUILDMAN="mpc5xxx"
129     - env:
130         - BUILDMAN="mpc8260"
131     - env:
132         - BUILDMAN="mpc83xx"
133     - env:
134         - BUILDMAN="mpc85xx -x freescale"
135     - env:
136         - BUILDMAN="mpc85xx -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x sbc8548 -x bsc91*"
137     - env:
138         - BUILDMAN="t208xrdb t4qds t102*"
139     - env:
140         - BUILDMAN="p1_p2_rdb_pc p1010rdb"
141     - env:
142         - BUILDMAN="corenet_ds b4860qds sbc8548 bsc91*"
143     - env:
144         - BUILDMAN="mpc86xx"
145     - env:
146         - BUILDMAN="mpc8xx"
147     - env:
148         - BUILDMAN="siemens"
149     - env:
150         - BUILDMAN="ti"
151     - env:
152         - BUILDMAN="aarch64"
153           TOOLCHAIN="aarch64"
154     - env:
155         - BUILDMAN="sh4"
156           TOOLCHAIN="sh4"
157     - env:
158         - BUILDMAN="xtensa"
159           TOOLCHAIN="xtensa"
160
161     # QA jobs for code analytics
162     # static code analysis with cppcheck (we can add --enable=all later)
163     - script:
164         - cppcheck --force --quiet --inline-suppr .
165     # search for TODO within source tree
166     - script:
167         - grep -r TODO .
168     # search for FIXME within source tree
169     - script:
170         - grep -r FIXME .
171     # search for HACK within source tree and ignore HACKKIT board
172       script:
173         - grep -r HACK . | grep -v HACKKIT
174     # some statistics about the code base
175     - script:
176         - sloccount .
177     # test/py
178     - script:
179         - ./test/py/test.py --bd sandbox --build
180     - env:
181         - CROSS_COMPILE="/usr/bin/arm-linux-gnueabihf-"
182       script:
183         - ./test/py/test.py --bd vexpress_ca15_tc2 --id qemu --build;
184           ./test/py/test.py --bd vexpress_ca9x4 --id qemu --build;
185           ./test/py/test.py --bd integratorcp_cm926ejs --id qemu --build;
186     - env:
187         - TOOLCHAIN="mips"
188           CROSS_COMPILE="${HOME}/.buildman-toolchains/gcc-4.9.0-nolibc/mips-linux/bin/mips-linux-"
189       script:
190         - ./test/py/test.py --bd qemu_mips --build -k 'not sleep';
191           ./test/py/test.py --bd qemu_mipsel --build -k 'not sleep';
192           ./test/py/test.py --bd qemu_mips64 --build -k 'not sleep';
193           ./test/py/test.py --bd qemu_mips64el --build -k 'not sleep';
194     - env:
195         - CROSS_COMPILE="/usr/bin/powerpc-linux-gnu-"
196       script:
197         - ./test/py/test.py --bd qemu-ppce500 --build -k 'not sleep'
198     - env:
199         - TOOLCHAIN="x86_64"
200           BUILD_ROM=yes
201           CROSS_COMPILE="${HOME}/.buildman-toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-"
202       script:
203         - ./test/py/test.py --bd qemu-x86 --build -k 'not sleep'
204
205 # TODO make it perfect ;-r