]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ti-u-boot/ti-u-boot.git/blob - .azure-pipelines.yml
azure: Add the missing build dependency for MSYS2 build
[ti-u-boot/ti-u-boot.git] / .azure-pipelines.yml
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-20200526-18Jun2020
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
12 jobs:
13   - job: tools_only_windows
14     displayName: 'Ensure host tools build for Windows'
15     pool:
16       vmImage: $(windows_vm)
17     steps:
18       - script: |
19           git clone https://github.com/msys2/msys2-ci-base.git %CD:~0,2%\msys64
20         displayName: 'Install MSYS2'
21       - script: |
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
37   - job: tools_only_macOS
38     displayName: 'Ensure host tools build for macOS X'
39     pool:
40       vmImage: $(macos_vm)
41     steps:
42       - script: brew install make
43         displayName: Brew install dependencies
44       - script: |
45           gmake tools-only_config tools-only NO_SDL=1 \
46             HOSTCFLAGS="-I/usr/local/opt/openssl@1.1/include" \
47             HOSTLDFLAGS="-L/usr/local/opt/openssl@1.1/lib" \
48             -j$(sysctl -n hw.logicalcpu)
49         displayName: 'Perform tools-only build'
51   - job: cppcheck
52     displayName: 'Static code analysis with cppcheck'
53     pool:
54       vmImage: $(ubuntu_vm)
55     container:
56       image: $(ci_runner_image)
57       options: $(container_option)
58     steps:
59       - script: cppcheck -j$(nproc) --force --quiet --inline-suppr .
61   - job: htmldocs
62     displayName: 'Build HTML documentation'
63     pool:
64       vmImage: $(ubuntu_vm)
65     container:
66       image: $(ci_runner_image)
67       options: $(container_option)
68     steps:
69       - script: make htmldocs
71   - job: todo
72     displayName: 'Search for TODO within source tree'
73     pool:
74       vmImage: $(ubuntu_vm)
75     container:
76       image: $(ci_runner_image)
77       options: $(container_option)
78     steps:
79       - script: grep -r TODO .
80       - script: grep -r FIXME .
81       - script: grep -r HACK . | grep -v HACKKIT
83   - job: sloccount
84     displayName: 'Some statistics about the code base'
85     pool:
86       vmImage: $(ubuntu_vm)
87     container:
88       image: $(ci_runner_image)
89       options: $(container_option)
90     steps:
91       - script: sloccount .
93   - job: maintainers
94     displayName: 'Ensure all configs have MAINTAINERS entries'
95     pool:
96       vmImage: $(ubuntu_vm)
97     container:
98       image: $(ci_runner_image)
99       options: $(container_option)
100     steps:
101       - script: |
102           if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
104   - job: tools_only
105     displayName: 'Ensure host tools build'
106     pool:
107       vmImage: $(ubuntu_vm)
108     container:
109       image: $(ci_runner_image)
110       options: $(container_option)
111     steps:
112       - script: |
113           make tools-only_config tools-only -j$(nproc)
115   - job: envtools
116     displayName: 'Ensure env tools build'
117     pool:
118       vmImage: $(ubuntu_vm)
119     container:
120       image: $(ci_runner_image)
121       options: $(container_option)
122     steps:
123       - script: |
124           make tools-only_config envtools -j$(nproc)
126   - job: utils
127     displayName: 'Run binman, buildman, dtoc, Kconfig and patman testsuites'
128     pool:
129       vmImage: $(ubuntu_vm)
130     steps:
131       - script: |
132           cat << EOF > build.sh
133           set -ex
134           cd ${WORK_DIR}
135           EOF
136           cat << "EOF" >> build.sh
137           git config --global user.name "Azure Pipelines"
138           git config --global user.email bmeng.cn@gmail.com
139           export USER=azure
140           virtualenv -p /usr/bin/python3 /tmp/venv
141           . /tmp/venv/bin/activate
142           pip install pyelftools pytest
143           export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl
144           export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt
145           export PATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}
146           ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl
147           ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test
148           ./tools/buildman/buildman -t
149           ./tools/dtoc/dtoc -t
150           ./tools/patman/patman test
151           make O=${UBOOT_TRAVIS_BUILD_DIR} testconfig
152           EOF
153           cat build.sh
154           # We cannot use "container" like other jobs above, as buildman
155           # seems to hang forever with pre-configured "container" environment
156           docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh
158   - job: nokia_rx51_test
159     displayName: 'Run tests for Nokia RX-51 (aka N900)'
160     pool:
161       vmImage: $(ubuntu_vm)
162     container:
163       image: $(ci_runner_image)
164       options: $(container_option)
165     steps:
166       - script: |
167           ./tools/buildman/buildman --fetch-arch arm
168           export PATH=~/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/:$PATH
169           test/nokia_rx51_test.sh
171   - job: test_py
172     displayName: 'test.py'
173     pool:
174       vmImage: $(ubuntu_vm)
175     strategy:
176       matrix:
177         sandbox:
178           TEST_PY_BD: "sandbox"
179         sandbox_clang:
180           TEST_PY_BD: "sandbox"
181           OVERRIDE: "-O clang-10"
182         sandbox_spl:
183           TEST_PY_BD: "sandbox_spl"
184           TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff"
185         sandbox_flattree:
186           TEST_PY_BD: "sandbox_flattree"
187         evb_ast2500:
188           TEST_PY_BD: "evb-ast2500"
189           TEST_PY_ID: "--id qemu"
190         vexpress_ca15_tc2:
191           TEST_PY_BD: "vexpress_ca15_tc2"
192           TEST_PY_ID: "--id qemu"
193         vexpress_ca9x4:
194           TEST_PY_BD: "vexpress_ca9x4"
195           TEST_PY_ID: "--id qemu"
196         integratorcp_cm926ejs:
197           TEST_PY_BD: "integratorcp_cm926ejs"
198           TEST_PY_ID: "--id qemu"
199           TEST_PY_TEST_SPEC: "not sleep"
200         qemu_arm:
201           TEST_PY_BD: "qemu_arm"
202           TEST_PY_TEST_SPEC: "not sleep"
203         qemu_arm64:
204           TEST_PY_BD: "qemu_arm64"
205           TEST_PY_TEST_SPEC: "not sleep"
206         qemu_mips:
207           TEST_PY_BD: "qemu_mips"
208           TEST_PY_TEST_SPEC: "not sleep"
209         qemu_mipsel:
210           TEST_PY_BD: "qemu_mipsel"
211           TEST_PY_TEST_SPEC: "not sleep"
212         qemu_mips64:
213           TEST_PY_BD: "qemu_mips64"
214           TEST_PY_TEST_SPEC: "not sleep"
215         qemu_mips64el:
216           TEST_PY_BD: "qemu_mips64el"
217           TEST_PY_TEST_SPEC: "not sleep"
218         qemu_malta:
219           TEST_PY_BD: "malta"
220           TEST_PY_ID: "--id qemu"
221           TEST_PY_TEST_SPEC: "not sleep and not efi"
222         qemu_maltael:
223           TEST_PY_BD: "maltael"
224           TEST_PY_ID: "--id qemu"
225           TEST_PY_TEST_SPEC: "not sleep and not efi"
226         qemu_malta64:
227           TEST_PY_BD: "malta64"
228           TEST_PY_ID: "--id qemu"
229           TEST_PY_TEST_SPEC: "not sleep and not efi"
230         qemu_malta64el:
231           TEST_PY_BD: "malta64el"
232           TEST_PY_ID: "--id qemu"
233           TEST_PY_TEST_SPEC: "not sleep and not efi"
234         qemu_ppce500:
235           TEST_PY_BD: "qemu-ppce500"
236           TEST_PY_TEST_SPEC: "not sleep"
237         qemu_riscv32:
238           TEST_PY_BD: "qemu-riscv32"
239           TEST_PY_TEST_SPEC: "not sleep"
240         qemu_riscv64:
241           TEST_PY_BD: "qemu-riscv64"
242           TEST_PY_TEST_SPEC: "not sleep"
243         qemu_riscv32_spl:
244           TEST_PY_BD: "qemu-riscv32_spl"
245           TEST_PY_TEST_SPEC: "not sleep"
246         qemu_riscv64_spl:
247           TEST_PY_BD: "qemu-riscv64_spl"
248           TEST_PY_TEST_SPEC: "not sleep"
249         qemu_x86:
250           TEST_PY_BD: "qemu-x86"
251           TEST_PY_TEST_SPEC: "not sleep"
252         qemu_x86_64:
253           TEST_PY_BD: "qemu-x86_64"
254           TEST_PY_TEST_SPEC: "not sleep"
255         xilinx_zynq_virt:
256           TEST_PY_BD: "xilinx_zynq_virt"
257           TEST_PY_ID: "--id qemu"
258           TEST_PY_TEST_SPEC: "not sleep"
259         xilinx_versal_virt:
260           TEST_PY_BD: "xilinx_versal_virt"
261           TEST_PY_ID: "--id qemu"
262           TEST_PY_TEST_SPEC: "not sleep"
263         xtfpga:
264           TEST_PY_BD: "xtfpga"
265           TEST_PY_ID: "--id qemu"
266           TEST_PY_TEST_SPEC: "not sleep"
267     steps:
268       - script: |
269           cat << EOF > test.sh
270           set -ex
271           # make environment variables available as tests are running inside a container
272           export WORK_DIR="${WORK_DIR}"
273           export TEST_PY_BD="${TEST_PY_BD}"
274           export TEST_PY_ID="${TEST_PY_ID}"
275           export TEST_PY_TEST_SPEC="${TEST_PY_TEST_SPEC}"
276           export OVERRIDE="${OVERRIDE}"
277           EOF
278           cat << "EOF" >> test.sh
279           # the below corresponds to .gitlab-ci.yml "before_script"
280           cd ${WORK_DIR}
281           git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
282           ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
283           ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
284           grub-mkimage --prefix=\"\" -o ~/grub_x86.efi -O i386-efi normal  echo lsefimmap lsefi lsefisystab efinet tftp minicmd
285           grub-mkimage --prefix=\"\" -o ~/grub_x64.efi -O x86_64-efi normal  echo lsefimmap lsefi lsefisystab efinet tftp minicmd
286           if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
287               wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
288               export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
289           fi
290           if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
291               wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
292               export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
293           fi
294           # the below corresponds to .gitlab-ci.yml "script"
295           cd ${WORK_DIR}
296           export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD};
297           tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e --board ${TEST_PY_BD} ${OVERRIDE}
298           cp ~/grub_x86.efi ${UBOOT_TRAVIS_BUILD_DIR}/
299           cp ~/grub_x64.efi ${UBOOT_TRAVIS_BUILD_DIR}/
300           cp /opt/grub/grubriscv64.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_riscv64.efi
301           cp /opt/grub/grubriscv32.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_riscv32.efi
302           cp /opt/grub/grubaa64.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_arm64.efi
303           cp /opt/grub/grubarm.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_arm.efi
304           virtualenv -p /usr/bin/python3 /tmp/venv
305           . /tmp/venv/bin/activate
306           pip install -r test/py/requirements.txt
307           export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
308           export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
309           # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
310           ./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";
311           # the below corresponds to .gitlab-ci.yml "after_script"
312           rm -rf /tmp/uboot-test-hooks /tmp/venv
313           EOF
314           cat test.sh
315           # make current directory writeable to uboot user inside the container
316           # as sandbox testing need create files like spi flash images, etc.
317           # (TODO: clean up this in the future)
318           chmod 777 .
319           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