configs: Remove am335x_boneblack_defconfig
[platform/kernel/u-boot.git] / .travis.yml
1 # SPDX-License-Identifier: GPL-2.0+
2 # Copyright Roger Meier <r.meier@siemens.com>
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     - ubuntu-toolchain-r-test
15     - llvm-toolchain-trusty-7
16     packages:
17     - cppcheck
18     - sloccount
19     - sparse
20     - bc
21     - build-essential
22     - libsdl1.2-dev
23     - python
24     - python-virtualenv
25     - swig
26     - libpython-dev
27     - iasl
28     - grub-efi-ia32-bin
29     - grub-efi-amd64-bin
30     - rpm2cpio
31     - wget
32     - device-tree-compiler
33     - lzop
34     - liblz4-tool
35     - libisl15
36     - clang-7
37
38 install:
39  # Clone uboot-test-hooks
40  - git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
41  - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
42  - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
43  # prepare buildman environment
44  - echo -e "[toolchain]\nroot = /usr" > ~/.buildman
45  - echo -e "arc = /tmp/arc_gnu_2018.09_prebuilt_uclibc_le_archs_linux_install" >> ~/.buildman
46  - echo -e "\n[toolchain-alias]\nsh = sh2\n" >> ~/.buildman
47  - cat ~/.buildman
48  - virtualenv /tmp/venv
49  - . /tmp/venv/bin/activate
50  - pip install pytest==2.8.7
51  - pip install python-subunit
52  - grub-mkimage -o ~/grub_x86.efi -O i386-efi normal  echo lsefimmap lsefi lsefisystab efinet tftp minicmd
53  - grub-mkimage -o ~/grub_x64.efi -O x86_64-efi normal  echo lsefimmap lsefi lsefisystab efinet tftp minicmd
54  - mkdir ~/grub2-arm
55  - ( cd ~/grub2-arm; wget -O - http://download.opensuse.org/ports/armv7hl/distribution/leap/42.2/repo/oss/suse/armv7hl/grub2-arm-efi-2.02~beta2-87.1.armv7hl.rpm | rpm2cpio | cpio -di )
56  - mkdir ~/grub2-arm64
57  - ( cd ~/grub2-arm64; wget -O - http://download.opensuse.org/ports/aarch64/distribution/leap/42.2/repo/oss/suse/aarch64/grub2-arm64-efi-2.02~beta2-87.1.aarch64.rpm | rpm2cpio | cpio -di )
58
59 env:
60   global:
61     - PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin
62     - PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci
63     - BUILD_DIR=build
64     - HOSTCC="cc"
65     - HOSTCXX="c++"
66     - QEMU_VERSION="v3.1.0"
67
68 before_script:
69   # install toolchains based on TOOLCHAIN} variable
70   - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi
71   - if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi
72   - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi
73   - if [[ "${TOOLCHAIN}" == *sh* ]]; then ./tools/buildman/buildman --fetch-arch sh2 ; fi
74   - if [[ "${TOOLCHAIN}" == *i386* ]]; then
75       ./tools/buildman/buildman --fetch-arch i386;
76       echo -e "\n[toolchain-alias]\nx86 = i386" >> ~/.buildman;
77     fi
78   - if [[ "${TOOLCHAIN}" == arc ]]; then
79        wget https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2018.09-release/arc_gnu_2018.09_prebuilt_uclibc_le_archs_linux_install.tar.gz &&
80        tar -C /tmp -xf arc_gnu_2018.09_prebuilt_uclibc_le_archs_linux_install.tar.gz;
81     fi
82   - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then
83        wget https://github.com/foss-xtensa/toolchain/releases/download/2018.02/x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
84        tar -C /tmp -xf x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
85        echo -e "\n[toolchain-prefix]\nxtensa = /tmp/2018.02/${TOOLCHAIN}/bin/${TOOLCHAIN}-" >> ~/.buildman;
86     fi
87   # If TOOLCHAIN is unset, we're on some flavour of ARM.
88   - if [[ "${TOOLCHAIN}" == "" ]]; then
89        ./tools/buildman/buildman --fetch-arch arm &&
90        ./tools/buildman/buildman --fetch-arch aarch64;
91     fi
92   - if [[ "${TOOLCHAIN}" == "powerpc" ]]; then ./tools/buildman/buildman --fetch-arch powerpc; fi
93   - if [[ "${TOOLCHAIN}" == "riscv" ]]; then
94        ./tools/buildman/buildman --fetch-arch riscv64;
95        echo -e "\n[toolchain-alias]\nriscv = riscv64" >> ~/.buildman;
96     fi
97   - if [[ "${QEMU_TARGET}" != "" ]]; then
98        git clone git://git.qemu.org/qemu.git /tmp/qemu;
99        pushd /tmp/qemu;
100        git submodule update --init dtc &&
101        git checkout ${QEMU_VERSION} &&
102        ./configure --prefix=/tmp/qemu-install --target-list=${QEMU_TARGET} &&
103        make -j4 all install;
104        popd;
105     fi
106
107 script:
108  # Comments must be outside the command strings below, or the Travis parser
109  # will get confused.
110  #
111  # From buildman, exit code 129 means warnings only.  If we've been asked to
112  # use clang only do one configuration.
113  - if [[ "${BUILDMAN}" != "" ]]; then
114      ret=0;
115      tools/buildman/buildman -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
116      if [[ $ret -ne 0 && $ret -ne 129 ]]; then
117        tools/buildman/buildman -sdeP ${BUILDMAN};
118        exit $ret;
119      fi;
120    fi
121  # "not a_test_which_does_not_exist" is a dummy -k parameter which will
122  # never prevent any test from running. That way, we can always pass
123  # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
124  # value.
125  - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
126    cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/;
127    cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/;
128    cp ~/grub2-arm/usr/lib/grub2/arm-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi;
129    cp ~/grub2-arm64/usr/lib/grub2/arm64-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi;
130    if [[ "${TEST_PY_BD}" != "" ]]; then
131      ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
132        -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
133        --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
134      ret=$?;
135      if [[ $ret -ne 0 ]]; then
136        exit $ret;
137      fi;
138    fi;
139    if [[ -n "${TEST_PY_TOOLS}" ]]; then
140      PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
141      PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
142      ./tools/binman/binman -t &&
143      ./tools/patman/patman --test &&
144      ./tools/buildman/buildman -t &&
145      PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
146      PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
147      ./tools/dtoc/dtoc -t;
148    fi
149
150 matrix:
151   include:
152   # we need to build by vendor due to 50min time limit for builds
153   # each env setting here is a dedicated build
154     - name: "buildman arc"
155       env:
156         - BUILDMAN="arc"
157           TOOLCHAIN="arc"
158     - name: "buildman arm11 arm7 arm920t arm946es"
159       env:
160         - BUILDMAN="arm11 arm7 arm920t arm946es"
161     - name: "buildman arm926ejs (non-NXP,siemens,atmel,kirkwood,spear)"
162       env:
163         - JOB="arm926ejs"
164           BUILDMAN="arm926ejs -x freescale,siemens,atmel,kirkwood,spear"
165     - name: "buildman atmel"
166       env:
167         - BUILDMAN="atmel"
168     - name: "buildman boundary engicam toradex"
169       env:
170         - BUILDMAN="boundary engicam toradex"
171     - name: "buildman NXP ARM32"
172       env:
173         - BUILDMAN="freescale -x powerpc,m68k,aarch64"
174     - name: "buildman NXP AArch64 LS101x"
175       env:
176         - BUILDMAN="freescale&aarch64&ls101"
177     - name: "buildman NXP AArch64 LS104x"
178       env:
179         - BUILDMAN="freescale&aarch64&ls104"
180     - name: "buildman NXP AArch64 LS108x"
181       env:
182         - BUILDMAN="freescale&aarch64&ls108"
183     - name: "buildman NXP AArch64 LS20xx"
184       env:
185         - BUILDMAN="freescale&aarch64&&ls20"
186     - name: "buildman i.MX6 (non-NXP)"
187       env:
188         - BUILDMAN="mx6 -x freescale,toradex,boundary,engicam"
189     - name: "buildman i.MX (non-NXP,i.MX6,toradex)"
190       env:
191         - BUILDMAN="mx -x freescale,mx6,toradex"
192     - name: "buildman k2"
193       env:
194         - BUILDMAN="k2"
195     - name: "buildman samsung socfpga"
196       env:
197         - BUILDMAN="samsung socfpga"
198     - name: "buildman spear"
199       env:
200         - BUILDMAN="spear"
201     - name: "buildman sun4i"
202       env:
203         - BUILDMAN="sun4i"
204     - name: "buildman sun5i"
205       env:
206         - BUILDMAN="sun5i"
207     - name: "buildman sun6i"
208       env:
209         - BUILDMAN="sun6i"
210     - name: "buildman sun7i"
211       env:
212         - BUILDMAN="sun7i"
213     - name: "buildman sun8i"
214       env:
215         - BUILDMAN="sun8i"
216     - name: "buildman sun9i"
217       env:
218         - BUILDMAN="sun9i"
219     - name: "buildman sun50i"
220       env:
221         - BUILDMAN="sun50i"
222     - name: "buildman catch-all ARM"
223       env:
224         - BUILDMAN="arm -x arm11,arm7,arm9,aarch64,atmel,freescale,kirkwood,mvebu,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap,pxa,rockchip,toradex,socfpga,k2,xilinx"
225     - name: "buildman sandbox x86"
226       env:
227         - BUILDMAN="sandbox x86"
228           TOOLCHAIN="i386"
229     - name: "buildman kirkwood (excluding openrd)"
230       env:
231         - BUILDMAN="kirkwood -x openrd"
232     - name: "buildman mvebu"
233       env:
234         - BUILDMAN="mvebu"
235     - name: "buildman PXA (non-toradex)"
236       env:
237         - BUILDMAN="pxa -x toradex"
238     - name: "buildman m68k"
239       env:
240         - BUILDMAN="m68k"
241           TOOLCHAIN="m68k"
242     - name: "buildman microblaze"
243       env:
244         - BUILDMAN="microblaze"
245           TOOLCHAIN="microblaze"
246     - name: "buildman mips"
247       env:
248         - BUILDMAN="mips"
249           TOOLCHAIN="mips"
250     - name: "buildman non-Freescale PowerPC"
251       env:
252         - BUILDMAN="powerpc -x freescale"
253           TOOLCHAIN="powerpc"
254     - name: "buildman mpc85xx&freescale (excluding many)"
255       env:
256         - BUILDMAN="mpc85xx&freescale -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x bsc91*"
257           TOOLCHAIN="powerpc"
258     - name: "buildman t208xrdb corenet_ds"
259       env:
260         - BUILDMAN="t208xrdb corenet_ds"
261           TOOLCHAIN="powerpc"
262     - name: "buildman Freescale PowerPC"
263       env:
264         - BUILDMAN="t4qds b4860qds mpc83xx&freescale mpc86xx&freescale"
265           TOOLCHAIN="powerpc"
266     - name: "buildman t102*"
267       env:
268         - BUILDMAN="t102*"
269           TOOLCHAIN="powerpc"
270     - name: "buildman p1_p2_rdb_pc"
271       env:
272         - BUILDMAN="p1_p2_rdb_pc"
273           TOOLCHAIN="powerpc"
274     - name: "buildman p1010rdb bsc91"
275       env:
276         - BUILDMAN="p1010rdb bsc91"
277           TOOLCHAIN="powerpc"
278     - name: "buildman siemens"
279       env:
280         - BUILDMAN="siemens"
281     - name: "buildman tegra"
282       env:
283         - BUILDMAN="tegra -x toradex"
284     - name: "buildman am33xx (no siemens)"
285       env:
286         - BUILDMAN="am33xx -x siemens"
287     - name: "buildman omap"
288       env:
289         - BUILDMAN="omap"
290     - name: "buildman uniphier"
291       env:
292         - BUILDMAN="uniphier"
293     - name: "buildman catch-all AArch64"
294       env:
295         - BUILDMAN="aarch64 -x tegra,ls1,ls2,mvebu,uniphier,sunxi,samsung,rockchip,xilinx"
296     - name: "buildman rockchip"
297       env:
298         - BUILDMAN="rockchip"
299     - name: "buildman sh"
300       env:
301         - BUILDMAN="sh -x arm"
302           TOOLCHAIN="sh"
303     - name: "buildman Xilinx (ARM)"
304       env:
305         - BUILDMAN="xilinx -x microblaze"
306     - name: "buildman xtensa"
307       env:
308         - BUILDMAN="xtensa"
309           TOOLCHAIN="xtensa-dc233c-elf"
310     - name: "buildman riscv"
311       env:
312         - BUILDMAN="riscv"
313           TOOLCHAIN="riscv"
314
315     # QA jobs for code analytics
316     # static code analysis with cppcheck (we can add --enable=all later)
317     - name: "cppcheck"
318       script:
319         - cppcheck --force --quiet --inline-suppr .
320     # search for TODO within source tree
321     - name: "grep TODO"
322       script:
323         - grep -r TODO .
324     # search for FIXME within source tree
325     - name: "grep FIXME HACK"
326       script:
327         - grep -r FIXME .
328     # search for HACK within source tree and ignore HACKKIT board
329       script:
330         - grep -r HACK . | grep -v HACKKIT
331     # some statistics about the code base
332     - name: "sloccount"
333       script:
334         - sloccount .
335     # ensure all configs have MAINTAINERS entries
336     - name: "Check for configs without MAINTAINERS entry"
337       script:
338         - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
339     # Ensure host tools build
340     - name: "Build tools-only"
341       script:
342         - make tools-only_config tools-only -j$(nproc)
343
344     # test/py
345     - name: "test/py sandbox"
346       env:
347         - TEST_PY_BD="sandbox"
348           BUILDMAN="^sandbox$"
349           TOOLCHAIN="i386"
350     - name: "test/py sandbox with clang"
351       env:
352         - TEST_PY_BD="sandbox"
353           BUILDMAN="^sandbox$"
354           OVERRIDE="clang-7"
355     - name: "test/py sandbox_spl"
356       env:
357         - TEST_PY_BD="sandbox_spl"
358           TEST_PY_TEST_SPEC="test_ofplatdata"
359           BUILDMAN="^sandbox$"
360           TOOLCHAIN="i386"
361           TEST_PY_TOOLS="yes"
362     - name: "test/py sandbox_flattree"
363       env:
364         - TEST_PY_BD="sandbox_flattree"
365           BUILDMAN="^sandbox_flattree$"
366           TOOLCHAIN="i386"
367     - name: "test/py vexpress_ca15_tc2"
368       env:
369         - TEST_PY_BD="vexpress_ca15_tc2"
370           TEST_PY_ID="--id qemu"
371           QEMU_TARGET="arm-softmmu"
372           QEMU_VERSION="v3.0.0"
373           BUILDMAN="^vexpress_ca15_tc2$"
374     - name: "test/py vexpress_ca9x4"
375       env:
376         - TEST_PY_BD="vexpress_ca9x4"
377           TEST_PY_ID="--id qemu"
378           QEMU_TARGET="arm-softmmu"
379           BUILDMAN="^vexpress_ca9x4$"
380     - name: "test/py integratorcp_cm926ejs"
381       env:
382         - TEST_PY_BD="integratorcp_cm926ejs"
383           TEST_PY_TEST_SPEC="not sleep"
384           TEST_PY_ID="--id qemu"
385           QEMU_TARGET="arm-softmmu"
386           BUILDMAN="^integratorcp_cm926ejs$"
387     - name: "test/py qemu_arm"
388       env:
389         - TEST_PY_BD="qemu_arm"
390           TEST_PY_TEST_SPEC="not sleep"
391           QEMU_TARGET="arm-softmmu"
392           BUILDMAN="^qemu_arm$"
393     - name: "test/py qemu_arm64"
394       env:
395         - TEST_PY_BD="qemu_arm64"
396           TEST_PY_TEST_SPEC="not sleep"
397           QEMU_TARGET="aarch64-softmmu"
398           BUILDMAN="^qemu_arm64$"
399     - name: "test/py qemu_mips"
400       env:
401         - TEST_PY_BD="qemu_mips"
402           TEST_PY_TEST_SPEC="not sleep"
403           QEMU_TARGET="mips-softmmu"
404           BUILDMAN="^qemu_mips$"
405           TOOLCHAIN="mips"
406     - name: "test/py qemu_mipsel"
407       env:
408         - TEST_PY_BD="qemu_mipsel"
409           TEST_PY_TEST_SPEC="not sleep"
410           QEMU_TARGET="mipsel-softmmu"
411           BUILDMAN="^qemu_mipsel$"
412           TOOLCHAIN="mips"
413     - name: "test/py qemu_mips64"
414       env:
415         - TEST_PY_BD="qemu_mips64"
416           TEST_PY_TEST_SPEC="not sleep"
417           QEMU_TARGET="mips64-softmmu"
418           BUILDMAN="^qemu_mips64$"
419           TOOLCHAIN="mips"
420     - name: "test/py qemu_mips64el"
421       env:
422         - TEST_PY_BD="qemu_mips64el"
423           TEST_PY_TEST_SPEC="not sleep"
424           QEMU_TARGET="mips64el-softmmu"
425           BUILDMAN="^qemu_mips64el$"
426           TOOLCHAIN="mips"
427     - name: "test/py qemu-ppce500"
428       env:
429         - TEST_PY_BD="qemu-ppce500"
430           TEST_PY_TEST_SPEC="not sleep"
431           QEMU_TARGET="ppc-softmmu"
432           BUILDMAN="^qemu-ppce500$"
433           TOOLCHAIN="powerpc"
434     - name: "test/py qemu-x86"
435       env:
436         - TEST_PY_BD="qemu-x86"
437           TEST_PY_TEST_SPEC="not sleep"
438           QEMU_TARGET="i386-softmmu"
439           BUILDMAN="^qemu-x86$"
440           TOOLCHAIN="i386"
441           BUILD_ROM="yes"
442     - name: "test/py qemu-x86_64"
443       env:
444         - TEST_PY_BD="qemu-x86_64"
445           TEST_PY_TEST_SPEC="not sleep"
446           QEMU_TARGET="x86_64-softmmu"
447           BUILDMAN="^qemu-x86_64$"
448           TOOLCHAIN="i386"
449           BUILD_ROM="yes"
450     - name: "test/py zynq_zc702"
451       env:
452         - TEST_PY_BD="zynq_zc702"
453           TEST_PY_TEST_SPEC="not sleep"
454           QEMU_TARGET="arm-softmmu"
455           TEST_PY_ID="--id qemu"
456           BUILDMAN="^zynq_zc702$"
457     - name: "test/py xtfpga"
458       env:
459         - TEST_PY_BD="xtfpga"
460           TEST_PY_TEST_SPEC="not sleep"
461           QEMU_TARGET="xtensa-softmmu"
462           TEST_PY_ID="--id qemu"
463           BUILDMAN="^xtfpga$"
464           TOOLCHAIN="xtensa-dc233c-elf"
465
466 # TODO make it perfect ;-r