.gitlab-ci.yml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. # SPDX-License-Identifier: GPL-2.0+
  2. # Grab our configured image. The source for this is found at:
  3. # https://gitlab.denx.de/u-boot/gitlab-ci-runner
  4. image: trini/u-boot-gitlab-ci-runner:xenial-20190720-02Aug2019
  5. # We run some tests in different order, to catch some failures quicker.
  6. stages:
  7. - testsuites
  8. - test.py
  9. - world build
  10. .buildman_and_testpy_template: &buildman_and_testpy_dfn
  11. tags: [ 'all' ]
  12. stage: test.py
  13. before_script:
  14. # Clone uboot-test-hooks
  15. - git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
  16. - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
  17. - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
  18. - virtualenv /tmp/venv
  19. - . /tmp/venv/bin/activate
  20. - pip install pytest==2.8.7
  21. - pip install python-subunit
  22. - grub-mkimage -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
  23. - grub-mkimage -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
  24. - mkdir ~/grub2-arm
  25. - ( 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 )
  26. - mkdir ~/grub2-arm64
  27. - ( 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 )
  28. after_script:
  29. - rm -rf ~/grub2* /tmp/uboot-test-hooks /tmp/venv
  30. script:
  31. # From buildman, exit code 129 means warnings only. If we've been asked to
  32. # use clang only do one configuration.
  33. - if [[ "${BUILDMAN}" != "" ]]; then
  34. ret=0;
  35. tools/buildman/buildman -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
  36. if [[ $ret -ne 0 && $ret -ne 129 ]]; then
  37. tools/buildman/buildman -sdeP ${BUILDMAN};
  38. exit $ret;
  39. fi;
  40. fi
  41. # "not a_test_which_does_not_exist" is a dummy -k parameter which will
  42. # never prevent any test from running. That way, we can always pass
  43. # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
  44. # value.
  45. - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
  46. export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin;
  47. export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
  48. if [[ "${TEST_PY_BD}" != "" ]]; then
  49. ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
  50. -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
  51. --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
  52. ret=$?;
  53. if [[ $ret -ne 0 ]]; then
  54. exit $ret;
  55. fi;
  56. fi;
  57. build all 32bit ARM plaforms:
  58. tags: [ 'all' ]
  59. stage: world build
  60. script:
  61. - ret=0;
  62. ./tools/buildman/buildman -P -E arm -x aarch64 || ret=$?;
  63. if [[ $ret -ne 0 && $ret -ne 129 ]]; then
  64. ./tools/buildman/buildman -sdeP;
  65. exit $ret;
  66. fi;
  67. build all 64bit ARM plaforms:
  68. tags: [ 'all' ]
  69. stage: world build
  70. script:
  71. - virtualenv /tmp/venv
  72. - . /tmp/venv/bin/activate
  73. - pip install pyelftools
  74. - ret=0;
  75. ./tools/buildman/buildman -P -E aarch64 || ret=$?;
  76. if [[ $ret -ne 0 && $ret -ne 129 ]]; then
  77. ./tools/buildman/buildman -sdeP;
  78. exit $ret;
  79. fi;
  80. build all PowerPC plaforms:
  81. tags: [ 'all' ]
  82. stage: world build
  83. script:
  84. - ret=0;
  85. ./tools/buildman/buildman -P -E powerpc || ret=$?;
  86. if [[ $ret -ne 0 && $ret -ne 129 ]]; then
  87. ./tools/buildman/buildman -sdeP;
  88. exit $ret;
  89. fi;
  90. build all other plaforms:
  91. tags: [ 'all' ]
  92. stage: world build
  93. script:
  94. - ret=0;
  95. ./tools/buildman/buildman -P -E -x arm,powerpc || ret=$?;
  96. if [[ $ret -ne 0 && $ret -ne 129 ]]; then
  97. ./tools/buildman/buildman -sdeP;
  98. exit $ret;
  99. fi;
  100. # QA jobs for code analytics
  101. # static code analysis with cppcheck (we can add --enable=all later)
  102. cppcheck:
  103. tags: [ 'all' ]
  104. stage: testsuites
  105. script:
  106. - cppcheck --force --quiet --inline-suppr .
  107. # search for TODO within source tree
  108. grep TODO/FIXME/HACK:
  109. tags: [ 'all' ]
  110. stage: testsuites
  111. script:
  112. - grep -r TODO .
  113. - grep -r FIXME .
  114. # search for HACK within source tree and ignore HACKKIT board
  115. - grep -r HACK . | grep -v HACKKIT
  116. # some statistics about the code base
  117. sloccount:
  118. tags: [ 'all' ]
  119. stage: testsuites
  120. script:
  121. - sloccount .
  122. # ensure all configs have MAINTAINERS entries
  123. Check for configs without MAINTAINERS entry:
  124. tags: [ 'all' ]
  125. stage: testsuites
  126. script:
  127. - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
  128. # Ensure host tools build
  129. Build tools-only:
  130. tags: [ 'all' ]
  131. stage: testsuites
  132. script:
  133. - make tools-only_config tools-only -j$(nproc)
  134. # Run various tool tests
  135. Run patman testsuite:
  136. tags: [ 'all' ]
  137. stage: testsuites
  138. script:
  139. - git config --global user.name "GitLab CI Runner"
  140. - git config --global user.email trini@konsulko.com
  141. - ./tools/patman/patman --test
  142. Run buildman testsuite:
  143. tags: [ 'all' ]
  144. stage: testsuites
  145. script:
  146. - ./tools/buildman/buildman -t
  147. Run binman and dtoc testsuite:
  148. tags: [ 'all' ]
  149. stage: testsuites
  150. script:
  151. - virtualenv /tmp/venv
  152. - . /tmp/venv/bin/activate
  153. - pip install pyelftools
  154. - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/sandbox_spl;
  155. ./tools/buildman/buildman -P sandbox_spl &&
  156. export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
  157. export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
  158. ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test &&
  159. ./tools/dtoc/dtoc -t
  160. # Test sandbox with test.py
  161. sandbox test.py:
  162. tags: [ 'all' ]
  163. variables:
  164. TEST_PY_BD: "sandbox"
  165. BUILDMAN: "^sandbox$"
  166. <<: *buildman_and_testpy_dfn
  167. sandbox_spl test.py:
  168. tags: [ 'all' ]
  169. variables:
  170. TEST_PY_BD: "sandbox_spl"
  171. BUILDMAN: "^sandbox_spl$"
  172. TEST_PY_TEST_SPEC: "test_ofplatdata"
  173. <<: *buildman_and_testpy_dfn
  174. evb-ast2500 test.py:
  175. tags: [ 'all' ]
  176. variables:
  177. TEST_PY_BD: "evb-ast2500"
  178. TEST_PY_ID: "--id qemu"
  179. BUILDMAN: "^evb-ast2500$"
  180. <<: *buildman_and_testpy_dfn
  181. sandbox_flattree test.py:
  182. tags: [ 'all' ]
  183. variables:
  184. TEST_PY_BD: "sandbox_flattree"
  185. BUILDMAN: "^sandbox_flattree$"
  186. <<: *buildman_and_testpy_dfn
  187. vexpress_ca15_tc2 test.py:
  188. tags: [ 'all' ]
  189. variables:
  190. TEST_PY_BD: "vexpress_ca15_tc2"
  191. TEST_PY_ID: "--id qemu"
  192. BUILDMAN: "^vexpress_ca15_tc2$"
  193. <<: *buildman_and_testpy_dfn
  194. vexpress_ca9x4 test.py:
  195. tags: [ 'all' ]
  196. variables:
  197. TEST_PY_BD: "vexpress_ca9x4"
  198. TEST_PY_ID: "--id qemu"
  199. BUILDMAN: "^vexpress_ca9x4$"
  200. <<: *buildman_and_testpy_dfn
  201. integratorcp_cm926ejs test.py:
  202. tags: [ 'all' ]
  203. variables:
  204. TEST_PY_BD: "integratorcp_cm926ejs"
  205. TEST_PY_TEST_SPEC: "not sleep"
  206. TEST_PY_ID: "--id qemu"
  207. BUILDMAN: "^integratorcp_cm926ejs$"
  208. <<: *buildman_and_testpy_dfn
  209. qemu_arm test.py:
  210. tags: [ 'all' ]
  211. variables:
  212. TEST_PY_BD: "qemu_arm"
  213. TEST_PY_TEST_SPEC: "not sleep"
  214. BUILDMAN: "^qemu_arm$"
  215. <<: *buildman_and_testpy_dfn
  216. qemu_arm64 test.py:
  217. tags: [ 'all' ]
  218. variables:
  219. TEST_PY_BD: "qemu_arm64"
  220. TEST_PY_TEST_SPEC: "not sleep"
  221. BUILDMAN: "^qemu_arm64$"
  222. <<: *buildman_and_testpy_dfn
  223. qemu_mips test.py:
  224. tags: [ 'all' ]
  225. variables:
  226. TEST_PY_BD: "qemu_mips"
  227. TEST_PY_TEST_SPEC: "not sleep"
  228. BUILDMAN: "^qemu_mips$"
  229. <<: *buildman_and_testpy_dfn
  230. qemu_mipsel test.py:
  231. tags: [ 'all' ]
  232. variables:
  233. TEST_PY_BD: "qemu_mipsel"
  234. TEST_PY_TEST_SPEC: "not sleep"
  235. BUILDMAN: "^qemu_mipsel$"
  236. <<: *buildman_and_testpy_dfn
  237. qemu_mips64 test.py:
  238. tags: [ 'all' ]
  239. variables:
  240. TEST_PY_BD: "qemu_mips64"
  241. TEST_PY_TEST_SPEC: "not sleep"
  242. BUILDMAN: "^qemu_mips64$"
  243. <<: *buildman_and_testpy_dfn
  244. qemu_mips64el test.py:
  245. tags: [ 'all' ]
  246. variables:
  247. TEST_PY_BD: "qemu_mips64el"
  248. TEST_PY_TEST_SPEC: "not sleep"
  249. BUILDMAN: "^qemu_mips64el$"
  250. <<: *buildman_and_testpy_dfn
  251. qemu-ppce500 test.py:
  252. tags: [ 'all' ]
  253. variables:
  254. TEST_PY_BD: "qemu-ppce500"
  255. TEST_PY_TEST_SPEC: "not sleep"
  256. BUILDMAN: "^qemu-ppce500$"
  257. <<: *buildman_and_testpy_dfn
  258. qemu-riscv64 test.py:
  259. tags: [ 'all' ]
  260. variables:
  261. TEST_PY_BD: "qemu-riscv64"
  262. TEST_PY_TEST_SPEC: "not sleep"
  263. BUILDMAN: "^qemu-riscv64$"
  264. <<: *buildman_and_testpy_dfn
  265. qemu-x86 test.py:
  266. tags: [ 'all' ]
  267. variables:
  268. TEST_PY_BD: "qemu-x86"
  269. TEST_PY_TEST_SPEC: "not sleep"
  270. BUILDMAN: "^qemu-x86$"
  271. <<: *buildman_and_testpy_dfn
  272. qemu-x86_64 test.py:
  273. tags: [ 'all' ]
  274. variables:
  275. TEST_PY_BD: "qemu-x86_64"
  276. TEST_PY_TEST_SPEC: "not sleep"
  277. BUILDMAN: "^qemu-x86_64$"
  278. <<: *buildman_and_testpy_dfn
  279. zynq_zc702 test.py:
  280. tags: [ 'all' ]
  281. variables:
  282. TEST_PY_BD: "zynq_zc702"
  283. TEST_PY_TEST_SPEC: "not sleep"
  284. TEST_PY_ID: "--id qemu"
  285. BUILDMAN: "^zynq_zc702$"
  286. <<: *buildman_and_testpy_dfn
  287. xilinx_versal_virt test.py:
  288. tags: [ 'all' ]
  289. variables:
  290. TEST_PY_BD: "xilinx_versal_virt"
  291. TEST_PY_TEST_SPEC: "not sleep"
  292. TEST_PY_ID: "--id qemu"
  293. BUILDMAN: "^xilinx_versal_virt$"
  294. <<: *buildman_and_testpy_dfn
  295. xtfpga test.py:
  296. tags: [ 'all' ]
  297. variables:
  298. TEST_PY_BD: "xtfpga"
  299. TEST_PY_TEST_SPEC: "not sleep"
  300. TEST_PY_ID: "--id qemu"
  301. BUILDMAN: "^xtfpga$"
  302. <<: *buildman_and_testpy_dfn