.azure-pipelines.yml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. variables:
  2. windows_vm: vs2017-win2016
  3. ubuntu_vm: ubuntu-18.04
  4. ci_runner_image: trini/u-boot-gitlab-ci-runner:bionic-20200311-10Apr2020
  5. # Add '-u 0' options for Azure pipelines, otherwise we get "permission
  6. # denied" error when it tries to "useradd -m -u 1001 vsts_azpcontainer",
  7. # since our $(ci_runner_image) user is not root.
  8. container_option: -u 0
  9. work_dir: /u
  10. jobs:
  11. - job: tools_only_windows
  12. displayName: 'Ensure host tools build for Windows'
  13. pool:
  14. vmImage: $(windows_vm)
  15. strategy:
  16. matrix:
  17. i686:
  18. MSYS_DIR: msys32
  19. BASE_REPO: msys2-ci-base-i686
  20. x86_64:
  21. MSYS_DIR: msys64
  22. BASE_REPO: msys2-ci-base
  23. steps:
  24. - script: |
  25. git clone https://github.com/msys2/$(BASE_REPO).git %CD:~0,2%\$(MSYS_DIR)
  26. displayName: 'Install MSYS2'
  27. - script: |
  28. set PATH=%CD:~0,2%\$(MSYS_DIR)\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
  29. %CD:~0,2%\$(MSYS_DIR)\usr\bin\pacman --noconfirm -Syyuu
  30. displayName: 'Update MSYS2'
  31. - script: |
  32. set PATH=%CD:~0,2%\$(MSYS_DIR)\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
  33. %CD:~0,2%\$(MSYS_DIR)\usr\bin\pacman --noconfirm --needed -S make gcc bison diffutils openssl-devel
  34. displayName: 'Install Toolchain'
  35. - script: |
  36. set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
  37. echo make tools-only_defconfig tools-only NO_SDL=1 > build-tools.sh
  38. %CD:~0,2%\$(MSYS_DIR)\usr\bin\bash -lc "bash build-tools.sh"
  39. displayName: 'Build Host Tools'
  40. env:
  41. # Tell MSYS2 we need a POSIX emulation layer
  42. MSYSTEM: MSYS
  43. # Tell MSYS2 not to ‘cd’ our startup directory to HOME
  44. CHERE_INVOKING: yes
  45. - job: cppcheck
  46. displayName: 'Static code analysis with cppcheck'
  47. pool:
  48. vmImage: $(ubuntu_vm)
  49. container:
  50. image: $(ci_runner_image)
  51. options: $(container_option)
  52. steps:
  53. - script: cppcheck --force --quiet --inline-suppr .
  54. - job: htmldocs
  55. displayName: 'Build HTML documentation'
  56. pool:
  57. vmImage: $(ubuntu_vm)
  58. container:
  59. image: $(ci_runner_image)
  60. options: $(container_option)
  61. steps:
  62. - script: make htmldocs
  63. - job: todo
  64. displayName: 'Search for TODO within source tree'
  65. pool:
  66. vmImage: $(ubuntu_vm)
  67. container:
  68. image: $(ci_runner_image)
  69. options: $(container_option)
  70. steps:
  71. - script: grep -r TODO .
  72. - script: grep -r FIXME .
  73. - script: grep -r HACK . | grep -v HACKKIT
  74. - job: sloccount
  75. displayName: 'Some statistics about the code base'
  76. pool:
  77. vmImage: $(ubuntu_vm)
  78. container:
  79. image: $(ci_runner_image)
  80. options: $(container_option)
  81. steps:
  82. - script: sloccount .
  83. - job: maintainers
  84. displayName: 'Ensure all configs have MAINTAINERS entries'
  85. pool:
  86. vmImage: $(ubuntu_vm)
  87. container:
  88. image: $(ci_runner_image)
  89. options: $(container_option)
  90. steps:
  91. - script: |
  92. if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
  93. - job: tools_only
  94. displayName: 'Ensure host tools build'
  95. pool:
  96. vmImage: $(ubuntu_vm)
  97. container:
  98. image: $(ci_runner_image)
  99. options: $(container_option)
  100. steps:
  101. - script: |
  102. make tools-only_config tools-only -j$(nproc)
  103. - job: envtools
  104. displayName: 'Ensure env tools build'
  105. pool:
  106. vmImage: $(ubuntu_vm)
  107. container:
  108. image: $(ci_runner_image)
  109. options: $(container_option)
  110. steps:
  111. - script: |
  112. make tools-only_config envtools -j$(nproc)
  113. - job: utils
  114. displayName: 'Run binman, buildman, dtoc, Kconfig and patman testsuites'
  115. pool:
  116. vmImage: $(ubuntu_vm)
  117. steps:
  118. - script: |
  119. cat << EOF > build.sh
  120. set -ex
  121. cd ${WORK_DIR}
  122. EOF
  123. cat << "EOF" >> build.sh
  124. git config --global user.name "Azure Pipelines"
  125. git config --global user.email bmeng.cn@gmail.com
  126. export USER=azure
  127. virtualenv -p /usr/bin/python3 /tmp/venv
  128. . /tmp/venv/bin/activate
  129. pip install pyelftools pytest
  130. export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl
  131. export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt
  132. export PATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}
  133. ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl
  134. ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test
  135. ./tools/buildman/buildman -t
  136. ./tools/dtoc/dtoc -t
  137. ./tools/patman/patman --test
  138. make O=${UBOOT_TRAVIS_BUILD_DIR} testconfig
  139. EOF
  140. cat build.sh
  141. # We cannot use "container" like other jobs above, as buildman
  142. # seems to hang forever with pre-configured "container" environment
  143. docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh
  144. - job: test_py
  145. displayName: 'test.py'
  146. pool:
  147. vmImage: $(ubuntu_vm)
  148. strategy:
  149. matrix:
  150. sandbox:
  151. TEST_PY_BD: "sandbox"
  152. BUILDMAN: "^sandbox$"
  153. sandbox_clang:
  154. TEST_PY_BD: "sandbox"
  155. BUILDMAN: "^sandbox$"
  156. OVERRIDE: "-O clang-7"
  157. sandbox_spl:
  158. TEST_PY_BD: "sandbox_spl"
  159. TEST_PY_TEST_SPEC: "test_ofplatdata"
  160. BUILDMAN: "^sandbox_spl$"
  161. sandbox_flattree:
  162. TEST_PY_BD: "sandbox_flattree"
  163. BUILDMAN: "^sandbox_flattree$"
  164. evb_ast2500:
  165. TEST_PY_BD: "evb-ast2500"
  166. TEST_PY_ID: "--id qemu"
  167. BUILDMAN: "^evb-ast2500$"
  168. vexpress_ca15_tc2:
  169. TEST_PY_BD: "vexpress_ca15_tc2"
  170. TEST_PY_ID: "--id qemu"
  171. BUILDMAN: "^vexpress_ca15_tc2$"
  172. vexpress_ca9x4:
  173. TEST_PY_BD: "vexpress_ca9x4"
  174. TEST_PY_ID: "--id qemu"
  175. BUILDMAN: "^vexpress_ca9x4$"
  176. integratorcp_cm926ejs:
  177. TEST_PY_BD: "integratorcp_cm926ejs"
  178. TEST_PY_ID: "--id qemu"
  179. TEST_PY_TEST_SPEC: "not sleep"
  180. BUILDMAN: "^integratorcp_cm926ejs$"
  181. qemu_arm:
  182. TEST_PY_BD: "qemu_arm"
  183. TEST_PY_TEST_SPEC: "not sleep"
  184. BUILDMAN: "^qemu_arm$"
  185. qemu_arm64:
  186. TEST_PY_BD: "qemu_arm64"
  187. TEST_PY_TEST_SPEC: "not sleep"
  188. BUILDMAN: "^qemu_arm64$"
  189. qemu_mips:
  190. TEST_PY_BD: "qemu_mips"
  191. TEST_PY_TEST_SPEC: "not sleep"
  192. BUILDMAN: "^qemu_mips$"
  193. qemu_mipsel:
  194. TEST_PY_BD: "qemu_mipsel"
  195. TEST_PY_TEST_SPEC: "not sleep"
  196. BUILDMAN: "^qemu_mipsel$"
  197. qemu_mips64:
  198. TEST_PY_BD: "qemu_mips64"
  199. TEST_PY_TEST_SPEC: "not sleep"
  200. BUILDMAN: "^qemu_mips64$"
  201. qemu_mips64el:
  202. TEST_PY_BD: "qemu_mips64el"
  203. TEST_PY_TEST_SPEC: "not sleep"
  204. BUILDMAN: "^qemu_mips64el$"
  205. qemu_ppce500:
  206. TEST_PY_BD: "qemu-ppce500"
  207. TEST_PY_TEST_SPEC: "not sleep"
  208. BUILDMAN: "^qemu-ppce500$"
  209. qemu_riscv32:
  210. TEST_PY_BD: "qemu-riscv32"
  211. TEST_PY_TEST_SPEC: "not sleep"
  212. BUILDMAN: "^qemu-riscv32$"
  213. qemu_riscv64:
  214. TEST_PY_BD: "qemu-riscv64"
  215. TEST_PY_TEST_SPEC: "not sleep"
  216. BUILDMAN: "^qemu-riscv64$"
  217. qemu_riscv32_spl:
  218. TEST_PY_BD: "qemu-riscv32_spl"
  219. TEST_PY_TEST_SPEC: "not sleep"
  220. BUILDMAN: "^qemu-riscv32_spl$"
  221. qemu_riscv64_spl:
  222. TEST_PY_BD: "qemu-riscv64_spl"
  223. TEST_PY_TEST_SPEC: "not sleep"
  224. BUILDMAN: "^qemu-riscv64_spl$"
  225. qemu_x86:
  226. TEST_PY_BD: "qemu-x86"
  227. TEST_PY_TEST_SPEC: "not sleep"
  228. BUILDMAN: "^qemu-x86$"
  229. qemu_x86_64:
  230. TEST_PY_BD: "qemu-x86_64"
  231. TEST_PY_TEST_SPEC: "not sleep"
  232. BUILDMAN: "^qemu-x86_64$"
  233. xilinx_zynq_virt:
  234. TEST_PY_BD: "xilinx_zynq_virt"
  235. TEST_PY_ID: "--id qemu"
  236. TEST_PY_TEST_SPEC: "not sleep"
  237. BUILDMAN: "^xilinx_zynq_virt$"
  238. xilinx_versal_virt:
  239. TEST_PY_BD: "xilinx_versal_virt"
  240. TEST_PY_ID: "--id qemu"
  241. TEST_PY_TEST_SPEC: "not sleep"
  242. BUILDMAN: "^xilinx_versal_virt$"
  243. xtfpga:
  244. TEST_PY_BD: "xtfpga"
  245. TEST_PY_ID: "--id qemu"
  246. TEST_PY_TEST_SPEC: "not sleep"
  247. BUILDMAN: "^xtfpga$"
  248. steps:
  249. - script: |
  250. cat << EOF > test.sh
  251. set -ex
  252. # make environment variables available as tests are running inside a container
  253. export WORK_DIR="${WORK_DIR}"
  254. export TEST_PY_BD="${TEST_PY_BD}"
  255. export TEST_PY_ID="${TEST_PY_ID}"
  256. export TEST_PY_TEST_SPEC="${TEST_PY_TEST_SPEC}"
  257. export BUILDMAN="${BUILDMAN}"
  258. export OVERRIDE="${OVERRIDE}"
  259. EOF
  260. cat << "EOF" >> test.sh
  261. # the below corresponds to .gitlab-ci.yml "before_script"
  262. cd ${WORK_DIR}
  263. git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
  264. ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
  265. ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
  266. grub-mkimage --prefix=\"\" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
  267. grub-mkimage --prefix=\"\" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
  268. cp /opt/grub/grubriscv64.efi ~/grub_riscv64.efi
  269. cp /opt/grub/grubriscv32.efi ~/grub_riscv32.efi
  270. cp /opt/grub/grubaa64.efi ~/grub_arm64.efi
  271. cp /opt/grub/grubarm.efi ~/grub_arm.efi
  272. if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
  273. wget -O - https://github.com/riscv/opensbi/releases/download/v0.6/opensbi-0.6-rv32-bin.tar.xz | tar -C /tmp -xJ;
  274. export OPENSBI=/tmp/opensbi-0.6-rv32-bin/platform/qemu/virt/firmware/fw_dynamic.bin;
  275. fi
  276. if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
  277. wget -O - https://github.com/riscv/opensbi/releases/download/v0.6/opensbi-0.6-rv64-bin.tar.xz | tar -C /tmp -xJ;
  278. export OPENSBI=/tmp/opensbi-0.6-rv64-bin/platform/qemu/virt/firmware/fw_dynamic.bin;
  279. fi
  280. # the below corresponds to .gitlab-ci.yml "script"
  281. cd ${WORK_DIR}
  282. if [[ "${BUILDMAN}" != "" ]]; then
  283. ret=0;
  284. tools/buildman/buildman -o /tmp -P -E ${BUILDMAN} ${OVERRIDE} || ret=$?;
  285. if [[ $ret -ne 0 && $ret -ne 129 ]]; then
  286. tools/buildman/buildman -o /tmp -sdeP ${BUILDMAN};
  287. exit $ret;
  288. fi;
  289. fi
  290. virtualenv -p /usr/bin/python3 /tmp/venv
  291. . /tmp/venv/bin/activate
  292. pip install -r test/py/requirements.txt
  293. export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/${TEST_PY_BD};
  294. export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
  295. export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
  296. if [[ "${TEST_PY_BD}" != "" ]]; then
  297. ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID} -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}" --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
  298. ret=$?;
  299. if [[ $ret -ne 0 ]]; then
  300. exit $ret;
  301. fi;
  302. fi
  303. # the below corresponds to .gitlab-ci.yml "after_script"
  304. rm -rf /tmp/uboot-test-hooks /tmp/venv
  305. EOF
  306. cat test.sh
  307. # make current directory writeable to uboot user inside the container
  308. # as sandbox testing need create files like spi flash images, etc.
  309. # (TODO: clean up this in the future)
  310. chmod 777 .
  311. docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/test.sh
  312. - job: build_the_world
  313. displayName: 'Build the World'
  314. pool:
  315. vmImage: $(ubuntu_vm)
  316. strategy:
  317. # Use almost the same target division in .travis.yml, only merged
  318. # 4 small build jobs (arc/microblaze/nds32/xtensa) into one.
  319. matrix:
  320. arc_microblaze_nds32_xtensa:
  321. BUILDMAN: "arc microblaze nds32 xtensa"
  322. arm11_arm7_arm920t_arm946es:
  323. BUILDMAN: "arm11 arm7 arm920t arm946es"
  324. arm926ejs:
  325. BUILDMAN: "arm926ejs -x freescale,siemens,at91,kirkwood,spear,omap"
  326. at91_non_armv7:
  327. BUILDMAN: "at91 -x armv7"
  328. at91_non_arm926ejs:
  329. BUILDMAN: "at91 -x arm926ejs"
  330. boundary_engicam_toradex:
  331. BUILDMAN: "boundary engicam toradex"
  332. arm_bcm:
  333. BUILDMAN: "bcm -x mips"
  334. nxp_arm32:
  335. BUILDMAN: "freescale -x powerpc,m68k,aarch64,ls101,ls102,ls104,ls108,ls20,lx216"
  336. nxp_ls101x:
  337. BUILDMAN: "freescale&ls101"
  338. nxp_ls102x:
  339. BUILDMAN: "freescale&ls102"
  340. nxp_ls104x:
  341. BUILDMAN: "freescale&ls104"
  342. nxp_ls108x:
  343. BUILDMAN: "freescale&ls108"
  344. nxp_ls20xx:
  345. BUILDMAN: "freescale&ls20"
  346. nxp_lx216x:
  347. BUILDMAN: "freescale&lx216"
  348. imx6:
  349. BUILDMAN: "mx6 -x boundary,engicam,freescale,technexion,toradex"
  350. imx:
  351. BUILDMAN: "mx -x mx6,freescale,technexion,toradex"
  352. keystone2_keystone3:
  353. BUILDMAN: "k2 k3"
  354. samsung_socfpga:
  355. BUILDMAN: "samsung socfpga"
  356. spear:
  357. BUILDMAN: "spear"
  358. sun4i:
  359. BUILDMAN: "sun4i"
  360. sun5i:
  361. BUILDMAN: "sun5i"
  362. sun6i:
  363. BUILDMAN: "sun6i"
  364. sun7i:
  365. BUILDMAN: "sun7i"
  366. sun8i_32bit:
  367. BUILDMAN: "sun8i&armv7"
  368. sun8i_64bit:
  369. BUILDMAN: "sun8i&aarch64"
  370. sun9i:
  371. BUILDMAN: "sun9i"
  372. sun50i:
  373. BUILDMAN: "sun50i"
  374. arm_catch_all:
  375. BUILDMAN: "arm -x arm11,arm7,arm9,aarch64,at91,bcm,freescale,kirkwood,mvebu,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap,rk,toradex,socfpga,k2,k3,zynq"
  376. sandbox_x86:
  377. BUILDMAN: "sandbox x86"
  378. technexion:
  379. BUILDMAN: "technexion"
  380. kirkwood:
  381. BUILDMAN: "kirkwood"
  382. mvebu:
  383. BUILDMAN: "mvebu"
  384. m68k:
  385. BUILDMAN: "m68k"
  386. mips:
  387. BUILDMAN: "mips"
  388. non_fsl_ppc:
  389. BUILDMAN: "powerpc -x freescale"
  390. mpc85xx_freescale:
  391. BUILDMAN: "mpc85xx&freescale -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x bsc91*"
  392. t208xrdb_corenet_ds:
  393. BUILDMAN: "t208xrdb corenet_ds"
  394. fsl_ppc:
  395. BUILDMAN: "t4qds b4860qds mpc83xx&freescale mpc86xx&freescale"
  396. t102x:
  397. BUILDMAN: "t102*"
  398. p1_p2_rdb_pc:
  399. BUILDMAN: "p1_p2_rdb_pc"
  400. p1010rdb_bsc91:
  401. BUILDMAN: "p1010rdb bsc91"
  402. siemens:
  403. BUILDMAN: "siemens"
  404. tegra:
  405. BUILDMAN: "tegra -x toradex"
  406. am33xx_no_siemens:
  407. BUILDMAN: "am33xx -x siemens"
  408. omap:
  409. BUILDMAN: "omap"
  410. uniphier:
  411. BUILDMAN: "uniphier"
  412. aarch64_catch_all:
  413. BUILDMAN: "aarch64 -x bcm,k3,tegra,ls1,ls2,lx216,mvebu,uniphier,sunxi,samsung,socfpga,rk,versal,zynq"
  414. rockchip:
  415. BUILDMAN: "rk"
  416. sh:
  417. BUILDMAN: "sh -x arm"
  418. zynq:
  419. BUILDMAN: "zynq&armv7"
  420. zynqmp_versal:
  421. BUILDMAN: "versal|zynqmp&aarch64"
  422. riscv:
  423. BUILDMAN: "riscv"
  424. steps:
  425. - script: |
  426. cat << EOF > build.sh
  427. set -ex
  428. cd ${WORK_DIR}
  429. # make environment variables available as tests are running inside a container
  430. export BUILDMAN="${BUILDMAN}"
  431. EOF
  432. cat << "EOF" >> build.sh
  433. if [[ "${BUILDMAN}" != "" ]]; then
  434. ret=0;
  435. tools/buildman/buildman -o /tmp -P -E ${BUILDMAN} ${OVERRIDE} || ret=$?;
  436. if [[ $ret -ne 0 && $ret -ne 129 ]]; then
  437. tools/buildman/buildman -o /tmp -sdeP ${BUILDMAN};
  438. exit $ret;
  439. fi;
  440. fi
  441. EOF
  442. cat build.sh
  443. docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh