.azure-pipelines.yml 16 KB

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