.travis.yml 15 KB

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