.azure-pipelines.yml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. variables:
  2. windows_vm: windows-2019
  3. ubuntu_vm: ubuntu-22.04
  4. macos_vm: macOS-12
  5. ci_runner_image: trini/u-boot-gitlab-ci-runner:jammy-20240227-14Mar2024
  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. stages:
  12. - stage: testsuites
  13. jobs:
  14. - job: tools_only_windows
  15. displayName: 'Ensure host tools build for Windows'
  16. pool:
  17. vmImage: $(windows_vm)
  18. steps:
  19. - powershell: |
  20. (New-Object Net.WebClient).DownloadFile("https://github.com/msys2/msys2-installer/releases/download/2021-06-04/msys2-base-x86_64-20210604.sfx.exe", "sfx.exe")
  21. displayName: 'Install MSYS2'
  22. - script: |
  23. sfx.exe -y -o%CD:~0,2%\
  24. %CD:~0,2%\msys64\usr\bin\bash -lc " "
  25. %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu"
  26. %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu"
  27. displayName: 'Update MSYS2'
  28. - script: |
  29. %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm --needed -Sy make gcc bison flex diffutils openssl-devel libgnutls-devel libutil-linux-devel"
  30. displayName: 'Install Toolchain'
  31. - script: |
  32. echo make tools-only_defconfig tools-only > build-tools.sh
  33. %CD:~0,2%\msys64\usr\bin\bash -lc "bash build-tools.sh"
  34. displayName: 'Build Host Tools'
  35. env:
  36. # Tell MSYS2 we need a POSIX emulation layer
  37. MSYSTEM: MSYS
  38. # Tell MSYS2 not to ‘cd’ our startup directory to HOME
  39. CHERE_INVOKING: yes
  40. - job: tools_only_macOS
  41. displayName: 'Ensure host tools build for macOS X'
  42. pool:
  43. vmImage: $(macos_vm)
  44. steps:
  45. - script: brew install make ossp-uuid
  46. displayName: Brew install dependencies
  47. - script: |
  48. gmake tools-only_config tools-only \
  49. HOSTCFLAGS="-I/usr/local/opt/openssl@1.1/include" \
  50. HOSTLDFLAGS="-L/usr/local/opt/openssl@1.1/lib" \
  51. -j$(sysctl -n hw.logicalcpu)
  52. displayName: 'Perform tools-only build'
  53. - job: check_for_new_CONFIG_symbols_outside_Kconfig
  54. displayName: 'Check for new CONFIG symbols outside Kconfig'
  55. pool:
  56. vmImage: $(ubuntu_vm)
  57. container:
  58. image: $(ci_runner_image)
  59. options: $(container_option)
  60. steps:
  61. # If grep succeeds and finds a match the test fails as we should
  62. # have no matches.
  63. - script: git grep -E '^#[[:blank:]]*(define|undef)[[:blank:]]*CONFIG_'
  64. :^doc/ :^arch/arm/dts/ :^scripts/kconfig/lkc.h
  65. :^include/linux/kconfig.h :^tools/ :^dts/upstream/ &&
  66. exit 1 || exit 0
  67. - job: docs
  68. displayName: 'Build documentation'
  69. pool:
  70. vmImage: $(ubuntu_vm)
  71. container:
  72. image: $(ci_runner_image)
  73. options: $(container_option)
  74. steps:
  75. - script: |
  76. virtualenv -p /usr/bin/python3 /tmp/venvhtml
  77. . /tmp/venvhtml/bin/activate
  78. pip install -r doc/sphinx/requirements.txt
  79. make htmldocs KDOC_WERROR=1
  80. make infodocs
  81. - job: maintainers
  82. displayName: 'Ensure all configs have MAINTAINERS entries'
  83. pool:
  84. vmImage: $(ubuntu_vm)
  85. container:
  86. image: $(ci_runner_image)
  87. options: $(container_option)
  88. steps:
  89. - script: |
  90. ./tools/buildman/buildman --maintainer-check
  91. - job: tools_only
  92. displayName: 'Ensure host tools and env tools build'
  93. pool:
  94. vmImage: $(ubuntu_vm)
  95. container:
  96. image: $(ci_runner_image)
  97. options: $(container_option)
  98. steps:
  99. - script: |
  100. make tools-only_config tools-only -j$(nproc)
  101. make mrproper
  102. make tools-only_config envtools -j$(nproc)
  103. - job: utils
  104. displayName: 'Run binman, buildman, dtoc, Kconfig and patman testsuites'
  105. pool:
  106. vmImage: $(ubuntu_vm)
  107. steps:
  108. - script: |
  109. cat << "EOF" > build.sh
  110. cd $(work_dir)
  111. git config --global user.name "Azure Pipelines"
  112. git config --global user.email bmeng.cn@gmail.com
  113. git config --global --add safe.directory $(work_dir)
  114. export USER=azure
  115. virtualenv -p /usr/bin/python3 /tmp/venv
  116. . /tmp/venv/bin/activate
  117. pip install -r test/py/requirements.txt
  118. pip install -r tools/buildman/requirements.txt
  119. export UBOOT_TRAVIS_BUILD_DIR=/tmp/tools-only
  120. export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt
  121. export PATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}
  122. ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w --board tools-only
  123. set -ex
  124. ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test
  125. ./tools/buildman/buildman -t
  126. ./tools/dtoc/dtoc -t
  127. ./tools/patman/patman test
  128. make O=${UBOOT_TRAVIS_BUILD_DIR} testconfig
  129. EOF
  130. cat build.sh
  131. # We cannot use "container" like other jobs above, as buildman
  132. # seems to hang forever with pre-configured "container" environment
  133. docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh
  134. - job: pylint
  135. displayName: Check for any pylint regressions
  136. pool:
  137. vmImage: $(ubuntu_vm)
  138. container:
  139. image: $(ci_runner_image)
  140. options: $(container_option)
  141. steps:
  142. - script: |
  143. git config --global --add safe.directory $(work_dir)
  144. export USER=azure
  145. pip install -r test/py/requirements.txt
  146. pip install -r tools/buildman/requirements.txt
  147. pip install asteval pylint==2.12.2 pyopenssl
  148. export PATH=${PATH}:~/.local/bin
  149. echo "[MASTER]" >> .pylintrc
  150. echo "load-plugins=pylint.extensions.docparams" >> .pylintrc
  151. export UBOOT_TRAVIS_BUILD_DIR=/tmp/tools-only
  152. ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w --board tools-only
  153. set -ex
  154. pylint --version
  155. export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt
  156. make pylint_err
  157. - job: check_for_pre_schema_tags
  158. displayName: 'Check for pre-schema driver model tags'
  159. pool:
  160. vmImage: $(ubuntu_vm)
  161. container:
  162. image: $(ci_runner_image)
  163. options: $(container_option)
  164. steps:
  165. # If grep succeeds and finds a match the test fails as we should
  166. # have no matches.
  167. - script: git grep u-boot,dm- -- '*.dts*' && exit 1 || exit 0
  168. - job: check_packing_of_python_tools
  169. displayName: 'Check we can package the Python tools'
  170. pool:
  171. vmImage: $(ubuntu_vm)
  172. container:
  173. image: $(ci_runner_image)
  174. options: $(container_option)
  175. steps:
  176. - script: make pip
  177. - job: create_test_py_wrapper_script
  178. displayName: 'Create and stage a wrapper for test.py runs'
  179. pool:
  180. vmImage: $(ubuntu_vm)
  181. steps:
  182. - checkout: none
  183. - script: |
  184. cat << EOF > test.sh
  185. #!/bin/bash
  186. set -ex
  187. # the below corresponds to .gitlab-ci.yml "before_script"
  188. cd \${WORK_DIR}
  189. git config --global --add safe.directory \${WORK_DIR}
  190. git clone --depth=1 https://source.denx.de/u-boot/u-boot-test-hooks /tmp/uboot-test-hooks
  191. ln -s travis-ci /tmp/uboot-test-hooks/bin/\`hostname\`
  192. ln -s travis-ci /tmp/uboot-test-hooks/py/\`hostname\`
  193. grub-mkimage --prefix=\"\" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
  194. grub-mkimage --prefix=\"\" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
  195. if [[ "\${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
  196. wget -O - https://github.com/riscv-software-src/opensbi/releases/download/v1.3.1/opensbi-1.3.1-rv-bin.tar.xz | tar -C /tmp -xJ;
  197. export OPENSBI=/tmp/opensbi-1.3.1-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
  198. fi
  199. if [[ "\${TEST_PY_BD}" == "qemu-riscv64_spl" ]] || [[ "\${TEST_PY_BD}" == "sifive_unleashed" ]]; then
  200. wget -O - https://github.com/riscv-software-src/opensbi/releases/download/v1.3.1/opensbi-1.3.1-rv-bin.tar.xz | tar -C /tmp -xJ;
  201. export OPENSBI=/tmp/opensbi-1.3.1-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
  202. fi
  203. # the below corresponds to .gitlab-ci.yml "script"
  204. cd \${WORK_DIR}
  205. export UBOOT_TRAVIS_BUILD_DIR=/tmp/\${TEST_PY_BD}
  206. if [ -n "\${BUILD_ENV}" ]; then
  207. export \${BUILD_ENV};
  208. fi
  209. pip install -r tools/buildman/requirements.txt
  210. tools/buildman/buildman -o \${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e --board \${TEST_PY_BD} \${OVERRIDE}
  211. cp ~/grub_x86.efi \${UBOOT_TRAVIS_BUILD_DIR}/
  212. cp ~/grub_x64.efi \${UBOOT_TRAVIS_BUILD_DIR}/
  213. cp /opt/grub/grubriscv64.efi \${UBOOT_TRAVIS_BUILD_DIR}/grub_riscv64.efi
  214. cp /opt/grub/grubaa64.efi \${UBOOT_TRAVIS_BUILD_DIR}/grub_arm64.efi
  215. cp /opt/grub/grubarm.efi \${UBOOT_TRAVIS_BUILD_DIR}/grub_arm.efi
  216. # create sdcard / spi-nor images for sifive unleashed using genimage
  217. if [[ "\${TEST_PY_BD}" == "sifive_unleashed" ]]; then
  218. mkdir -p root;
  219. cp \${UBOOT_TRAVIS_BUILD_DIR}/spl/u-boot-spl.bin .;
  220. cp \${UBOOT_TRAVIS_BUILD_DIR}/u-boot.itb .;
  221. rm -rf tmp;
  222. genimage --inputpath . --config board/sifive/unleashed/genimage_sdcard.cfg;
  223. cp images/sdcard.img \${UBOOT_TRAVIS_BUILD_DIR}/;
  224. rm -rf tmp;
  225. genimage --inputpath . --config board/sifive/unleashed/genimage_spi-nor.cfg;
  226. cp images/spi-nor.img \${UBOOT_TRAVIS_BUILD_DIR}/;
  227. fi
  228. if [[ "\${TEST_PY_BD}" == "coreboot" ]]; then
  229. cp /opt/coreboot/coreboot.rom \${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom;
  230. /opt/coreboot/cbfstool \${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom remove -n fallback/payload;
  231. /opt/coreboot/cbfstool \${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom add-flat-binary -f \${UBOOT_TRAVIS_BUILD_DIR}/u-boot.bin -n fallback/payload -c LZMA -l 0x1110000 -e 0x1110000;
  232. fi
  233. virtualenv -p /usr/bin/python3 /tmp/venv
  234. . /tmp/venv/bin/activate
  235. pip install -r test/py/requirements.txt
  236. pip install pytest-azurepipelines
  237. export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:\${PATH}
  238. export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci
  239. # "\${var:+"-k \$var"}" expands to "" if \$var is empty, "-k \$var" if not
  240. ./test/py/test.py -ra -o cache_dir="\$UBOOT_TRAVIS_BUILD_DIR"/.pytest_cache --bd \${TEST_PY_BD} \${TEST_PY_ID} \${TEST_PY_TEST_SPEC:+"-k \${TEST_PY_TEST_SPEC}"} --build-dir "\$UBOOT_TRAVIS_BUILD_DIR" --report-dir "\$UBOOT_TRAVIS_BUILD_DIR"
  241. # the below corresponds to .gitlab-ci.yml "after_script"
  242. rm -rf /tmp/uboot-test-hooks /tmp/venv
  243. EOF
  244. - task: CopyFiles@2
  245. displayName: 'Copy test.sh for later usage'
  246. inputs:
  247. contents: 'test.sh'
  248. targetFolder: '$(Build.ArtifactStagingDirectory)'
  249. - publish: '$(Build.ArtifactStagingDirectory)/test.sh'
  250. displayName: 'Publish test.sh'
  251. artifact: testsh
  252. - stage: test_py_sandbox
  253. jobs:
  254. - job: test_py_sandbox
  255. displayName: 'test.py for sandbox'
  256. pool:
  257. vmImage: $(ubuntu_vm)
  258. strategy:
  259. matrix:
  260. sandbox:
  261. TEST_PY_BD: "sandbox"
  262. sandbox_asan:
  263. TEST_PY_BD: "sandbox"
  264. OVERRIDE: "-a ASAN"
  265. TEST_PY_TEST_SPEC: "version"
  266. sandbox_clang:
  267. TEST_PY_BD: "sandbox"
  268. OVERRIDE: "-O clang-17"
  269. sandbox_clang_asan:
  270. TEST_PY_BD: "sandbox"
  271. OVERRIDE: "-O clang-17 -a ASAN"
  272. TEST_PY_TEST_SPEC: "version"
  273. sandbox64:
  274. TEST_PY_BD: "sandbox64"
  275. sandbox64_clang:
  276. TEST_PY_BD: "sandbox64"
  277. OVERRIDE: "-O clang-17"
  278. sandbox_spl:
  279. TEST_PY_BD: "sandbox_spl"
  280. TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
  281. sandbox_vpl:
  282. TEST_PY_BD: "sandbox_vpl"
  283. TEST_PY_TEST_SPEC: "vpl or test_spl"
  284. sandbox_noinst:
  285. TEST_PY_BD: "sandbox_noinst"
  286. TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
  287. sandbox_noinst_load_fit_full:
  288. TEST_PY_BD: "sandbox_noinst"
  289. TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
  290. OVERRIDE: "-a CONFIG_SPL_LOAD_FIT_FULL=y"
  291. sandbox_flattree:
  292. TEST_PY_BD: "sandbox_flattree"
  293. sandbox_trace:
  294. TEST_PY_BD: "sandbox"
  295. BUILD_ENV: "FTRACE=1 NO_LTO=1"
  296. TEST_PY_TEST_SPEC: "trace"
  297. OVERRIDE: "-a CONFIG_TRACE=y -a CONFIG_TRACE_EARLY=y -a CONFIG_TRACE_EARLY_SIZE=0x01000000 -a CONFIG_TRACE_BUFFER_SIZE=0x02000000"
  298. steps:
  299. - download: current
  300. artifact: testsh
  301. - script: |
  302. # make current directory writeable to uboot user inside the container
  303. # as sandbox testing need create files like spi flash images, etc.
  304. # (TODO: clean up this in the future)
  305. chmod 777 .
  306. chmod 755 $(Pipeline.Workspace)/testsh/test.sh
  307. # Filesystem tests need extra docker args to run
  308. set --
  309. # mount -o loop needs the loop devices
  310. if modprobe loop; then
  311. for d in $(find /dev -maxdepth 1 -name 'loop*'); do
  312. set -- "$@" --device $d:$d
  313. done
  314. fi
  315. # Needed for mount syscall (for guestmount as well)
  316. set -- "$@" --cap-add SYS_ADMIN
  317. # Default apparmor profile denies mounts
  318. set -- "$@" --security-opt apparmor=unconfined
  319. # Some tests using libguestfs-tools need the fuse device to run
  320. docker run "$@" --device /dev/fuse:/dev/fuse \
  321. -v $PWD:$(work_dir) \
  322. -v $(Pipeline.Workspace):$(Pipeline.Workspace) \
  323. -e WORK_DIR="${WORK_DIR}" \
  324. -e TEST_PY_BD="${TEST_PY_BD}" \
  325. -e TEST_PY_ID="${TEST_PY_ID}" \
  326. -e TEST_PY_TEST_SPEC="${TEST_PY_TEST_SPEC}" \
  327. -e OVERRIDE="${OVERRIDE}" \
  328. -e BUILD_ENV="${BUILD_ENV}" $(ci_runner_image) \
  329. $(Pipeline.Workspace)/testsh/test.sh
  330. - stage: test_py_qemu
  331. jobs:
  332. - job: test_py_qemu
  333. displayName: 'test.py for QEMU platforms'
  334. pool:
  335. vmImage: $(ubuntu_vm)
  336. strategy:
  337. matrix:
  338. coreboot:
  339. TEST_PY_BD: "coreboot"
  340. TEST_PY_ID: "--id qemu"
  341. TEST_PY_TEST_SPEC: "not sleep"
  342. evb_ast2500:
  343. TEST_PY_BD: "evb-ast2500"
  344. TEST_PY_ID: "--id qemu"
  345. evb_ast2600:
  346. TEST_PY_BD: "evb-ast2600"
  347. TEST_PY_ID: "--id qemu"
  348. vexpress_ca9x4:
  349. TEST_PY_BD: "vexpress_ca9x4"
  350. TEST_PY_ID: "--id qemu"
  351. integratorcp_cm926ejs:
  352. TEST_PY_BD: "integratorcp_cm926ejs"
  353. TEST_PY_ID: "--id qemu"
  354. TEST_PY_TEST_SPEC: "not sleep"
  355. qemu_arm:
  356. TEST_PY_BD: "qemu_arm"
  357. TEST_PY_TEST_SPEC: "not sleep"
  358. qemu_arm64:
  359. TEST_PY_BD: "qemu_arm64"
  360. TEST_PY_TEST_SPEC: "not sleep"
  361. qemu_m68k:
  362. TEST_PY_BD: "M5208EVBE"
  363. TEST_PY_ID: "--id qemu"
  364. TEST_PY_TEST_SPEC: "not sleep and not efi"
  365. OVERRIDE: "-a CONFIG_M68K_QEMU=y -a ~CONFIG_MCFTMR"
  366. qemu_malta:
  367. TEST_PY_BD: "malta"
  368. TEST_PY_ID: "--id qemu"
  369. TEST_PY_TEST_SPEC: "not sleep and not efi"
  370. qemu_maltael:
  371. TEST_PY_BD: "maltael"
  372. TEST_PY_ID: "--id qemu"
  373. TEST_PY_TEST_SPEC: "not sleep and not efi"
  374. qemu_malta64:
  375. TEST_PY_BD: "malta64"
  376. TEST_PY_ID: "--id qemu"
  377. TEST_PY_TEST_SPEC: "not sleep and not efi"
  378. qemu_malta64el:
  379. TEST_PY_BD: "malta64el"
  380. TEST_PY_ID: "--id qemu"
  381. TEST_PY_TEST_SPEC: "not sleep and not efi"
  382. qemu_ppce500:
  383. TEST_PY_BD: "qemu-ppce500"
  384. TEST_PY_TEST_SPEC: "not sleep"
  385. qemu_riscv32:
  386. TEST_PY_BD: "qemu-riscv32"
  387. TEST_PY_TEST_SPEC: "not sleep"
  388. qemu_riscv64:
  389. TEST_PY_BD: "qemu-riscv64"
  390. TEST_PY_TEST_SPEC: "not sleep"
  391. qemu_riscv32_spl:
  392. TEST_PY_BD: "qemu-riscv32_spl"
  393. TEST_PY_TEST_SPEC: "not sleep"
  394. qemu_riscv64_spl:
  395. TEST_PY_BD: "qemu-riscv64_spl"
  396. TEST_PY_TEST_SPEC: "not sleep"
  397. qemu_x86:
  398. TEST_PY_BD: "qemu-x86"
  399. TEST_PY_TEST_SPEC: "not sleep"
  400. qemu_x86_64:
  401. TEST_PY_BD: "qemu-x86_64"
  402. TEST_PY_TEST_SPEC: "not sleep"
  403. r2dplus_i82557c:
  404. TEST_PY_BD: "r2dplus"
  405. TEST_PY_ID: "--id i82557c_qemu"
  406. r2dplus_pcnet:
  407. TEST_PY_BD: "r2dplus"
  408. TEST_PY_ID: "--id pcnet_qemu"
  409. r2dplus_rtl8139:
  410. TEST_PY_BD: "r2dplus"
  411. TEST_PY_ID: "--id rtl8139_qemu"
  412. r2dplus_tulip:
  413. TEST_PY_BD: "r2dplus"
  414. TEST_PY_ID: "--id tulip_qemu"
  415. sifive_unleashed_sdcard:
  416. TEST_PY_BD: "sifive_unleashed"
  417. TEST_PY_ID: "--id sdcard_qemu"
  418. sifive_unleashed_spi-nor:
  419. TEST_PY_BD: "sifive_unleashed"
  420. TEST_PY_ID: "--id spi-nor_qemu"
  421. xilinx_zynq_virt:
  422. TEST_PY_BD: "xilinx_zynq_virt"
  423. TEST_PY_ID: "--id qemu"
  424. TEST_PY_TEST_SPEC: "not sleep"
  425. xilinx_versal_virt:
  426. TEST_PY_BD: "xilinx_versal_virt"
  427. TEST_PY_ID: "--id qemu"
  428. TEST_PY_TEST_SPEC: "not sleep"
  429. xtfpga:
  430. TEST_PY_BD: "xtfpga"
  431. TEST_PY_ID: "--id qemu"
  432. TEST_PY_TEST_SPEC: "not sleep"
  433. steps:
  434. - download: current
  435. artifact: testsh
  436. - script: |
  437. # make current directory writeable to uboot user inside the container
  438. # as sandbox testing need create files like spi flash images, etc.
  439. # (TODO: clean up this in the future)
  440. chmod 777 .
  441. chmod 755 $(Pipeline.Workspace)/testsh/test.sh
  442. # Some tests using libguestfs-tools need the fuse device to run
  443. docker run "$@" --device /dev/fuse:/dev/fuse \
  444. -v $PWD:$(work_dir) \
  445. -v $(Pipeline.Workspace):$(Pipeline.Workspace) \
  446. -e WORK_DIR="${WORK_DIR}" \
  447. -e TEST_PY_BD="${TEST_PY_BD}" \
  448. -e TEST_PY_ID="${TEST_PY_ID}" \
  449. -e TEST_PY_TEST_SPEC="${TEST_PY_TEST_SPEC}" \
  450. -e OVERRIDE="${OVERRIDE}" \
  451. -e BUILD_ENV="${BUILD_ENV}" $(ci_runner_image) \
  452. $(Pipeline.Workspace)/testsh/test.sh
  453. retryCountOnTaskFailure: 2 # QEMU may be too slow, etc.
  454. - stage: world_build
  455. jobs:
  456. - job: build_the_world
  457. timeoutInMinutes: 0 # Use the maximum allowed
  458. displayName: 'Build the World'
  459. pool:
  460. vmImage: $(ubuntu_vm)
  461. strategy:
  462. # Use almost the same target division in .travis.yml, only merged
  463. # 3 small build jobs (arc/microblaze/xtensa) into one.
  464. matrix:
  465. am33xx_at91_kirkwood_mvebu_omap:
  466. BUILDMAN: "am33xx at91_kirkwood mvebu omap -x siemens"
  467. amlogic_bcm_boundary_engicam_siemens_technexion_oradex:
  468. BUILDMAN: "amlogic bcm boundary engicam siemens technexion toradex -x mips"
  469. arm_nxp_minus_imx:
  470. BUILDMAN: "freescale -x powerpc,m68k,imx,mx"
  471. imx:
  472. BUILDMAN: "mx imx -x boundary,engicam,technexion,toradex"
  473. rk:
  474. BUILDMAN: "rk"
  475. sunxi:
  476. BUILDMAN: "sunxi"
  477. powerpc:
  478. BUILDMAN: "powerpc"
  479. arm_catch_all:
  480. BUILDMAN: "arm -x aarch64,am33xx,at91,bcm,ls1,kirkwood,mvebu,omap,rk,siemens,mx,sunxi,technexion,toradex"
  481. aarch64_catch_all:
  482. BUILDMAN: "aarch64 -x amlogic,bcm,engicam,imx,ls1,ls2,lx216,mvebu,rk,siemens,sunxi,toradex"
  483. everything_but_arm_and_powerpc:
  484. BUILDMAN: "-x arm,powerpc"
  485. steps:
  486. - script: |
  487. cat << EOF > build.sh
  488. set -ex
  489. cd ${WORK_DIR}
  490. # make environment variables available as tests are running inside a container
  491. export BUILDMAN="${BUILDMAN}"
  492. git config --global --add safe.directory ${WORK_DIR}
  493. pip install -r tools/buildman/requirements.txt
  494. EOF
  495. cat << "EOF" >> build.sh
  496. if [[ "${BUILDMAN}" != "" ]]; then
  497. ret=0;
  498. tools/buildman/buildman -o /tmp -PEWM ${BUILDMAN} ${OVERRIDE} || ret=$?;
  499. if [[ $ret -ne 0 ]]; then
  500. tools/buildman/buildman -o /tmp -seP ${BUILDMAN};
  501. exit $ret;
  502. fi;
  503. fi
  504. EOF
  505. cat build.sh
  506. docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh