2 windows_vm: vs2017-win2016
3 ubuntu_vm: ubuntu-18.04
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.
13 - job: tools_only_windows
14 displayName: 'Ensure host tools build for Windows'
16 vmImage: $(windows_vm)
19 git clone https://github.com/msys2/msys2-ci-base.git %CD:~0,2%\msys64
20 displayName: 'Install MSYS2'
22 %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Syyuu"
23 displayName: 'Update MSYS2'
25 %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm --needed -S make gcc bison flex diffutils openssl-devel"
26 displayName: 'Install Toolchain'
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'
32 # Tell MSYS2 we need a POSIX emulation layer
34 # Tell MSYS2 not to ‘cd’ our startup directory to HOME
37 - job: tools_only_macOS
38 displayName: 'Ensure host tools build for macOS X'
42 - script: brew install make
43 displayName: Brew install dependencies
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'
52 displayName: 'Static code analysis with cppcheck'
56 image: $(ci_runner_image)
57 options: $(container_option)
59 - script: cppcheck -j$(nproc) --force --quiet --inline-suppr .
62 displayName: 'Build HTML documentation'
66 image: $(ci_runner_image)
67 options: $(container_option)
69 - script: make htmldocs
72 displayName: 'Search for TODO within source tree'
76 image: $(ci_runner_image)
77 options: $(container_option)
79 - script: grep -r TODO .
80 - script: grep -r FIXME .
81 - script: grep -r HACK . | grep -v HACKKIT
84 displayName: 'Some statistics about the code base'
88 image: $(ci_runner_image)
89 options: $(container_option)
94 displayName: 'Ensure all configs have MAINTAINERS entries'
98 image: $(ci_runner_image)
99 options: $(container_option)
102 if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
105 displayName: 'Ensure host tools build'
107 vmImage: $(ubuntu_vm)
109 image: $(ci_runner_image)
110 options: $(container_option)
113 make tools-only_config tools-only -j$(nproc)
116 displayName: 'Ensure env tools build'
118 vmImage: $(ubuntu_vm)
120 image: $(ci_runner_image)
121 options: $(container_option)
124 make tools-only_config envtools -j$(nproc)
127 displayName: 'Run binman, buildman, dtoc, Kconfig and patman testsuites'
129 vmImage: $(ubuntu_vm)
132 cat << EOF > build.sh
136 cat << "EOF" >> build.sh
137 git config --global user.name "Azure Pipelines"
138 git config --global user.email bmeng.cn@gmail.com
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
150 ./tools/patman/patman test
151 make O=${UBOOT_TRAVIS_BUILD_DIR} testconfig
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)'
161 vmImage: $(ubuntu_vm)
163 image: $(ci_runner_image)
164 options: $(container_option)
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
172 displayName: 'test.py'
174 vmImage: $(ubuntu_vm)
178 TEST_PY_BD: "sandbox"
180 TEST_PY_BD: "sandbox"
181 OVERRIDE: "-O clang-10"
183 TEST_PY_BD: "sandbox_spl"
184 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff"
186 TEST_PY_BD: "sandbox_flattree"
188 TEST_PY_BD: "evb-ast2500"
189 TEST_PY_ID: "--id qemu"
191 TEST_PY_BD: "vexpress_ca15_tc2"
192 TEST_PY_ID: "--id qemu"
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"
201 TEST_PY_BD: "qemu_arm"
202 TEST_PY_TEST_SPEC: "not sleep"
204 TEST_PY_BD: "qemu_arm64"
205 TEST_PY_TEST_SPEC: "not sleep"
207 TEST_PY_BD: "qemu_mips"
208 TEST_PY_TEST_SPEC: "not sleep"
210 TEST_PY_BD: "qemu_mipsel"
211 TEST_PY_TEST_SPEC: "not sleep"
213 TEST_PY_BD: "qemu_mips64"
214 TEST_PY_TEST_SPEC: "not sleep"
216 TEST_PY_BD: "qemu_mips64el"
217 TEST_PY_TEST_SPEC: "not sleep"
220 TEST_PY_ID: "--id qemu"
221 TEST_PY_TEST_SPEC: "not sleep and not efi"
223 TEST_PY_BD: "maltael"
224 TEST_PY_ID: "--id qemu"
225 TEST_PY_TEST_SPEC: "not sleep and not efi"
227 TEST_PY_BD: "malta64"
228 TEST_PY_ID: "--id qemu"
229 TEST_PY_TEST_SPEC: "not sleep and not efi"
231 TEST_PY_BD: "malta64el"
232 TEST_PY_ID: "--id qemu"
233 TEST_PY_TEST_SPEC: "not sleep and not efi"
235 TEST_PY_BD: "qemu-ppce500"
236 TEST_PY_TEST_SPEC: "not sleep"
238 TEST_PY_BD: "qemu-riscv32"
239 TEST_PY_TEST_SPEC: "not sleep"
241 TEST_PY_BD: "qemu-riscv64"
242 TEST_PY_TEST_SPEC: "not sleep"
244 TEST_PY_BD: "qemu-riscv32_spl"
245 TEST_PY_TEST_SPEC: "not sleep"
247 TEST_PY_BD: "qemu-riscv64_spl"
248 TEST_PY_TEST_SPEC: "not sleep"
250 TEST_PY_BD: "qemu-x86"
251 TEST_PY_TEST_SPEC: "not sleep"
253 TEST_PY_BD: "qemu-x86_64"
254 TEST_PY_TEST_SPEC: "not sleep"
256 TEST_PY_BD: "xilinx_zynq_virt"
257 TEST_PY_ID: "--id qemu"
258 TEST_PY_TEST_SPEC: "not sleep"
260 TEST_PY_BD: "xilinx_versal_virt"
261 TEST_PY_ID: "--id qemu"
262 TEST_PY_TEST_SPEC: "not sleep"
265 TEST_PY_ID: "--id qemu"
266 TEST_PY_TEST_SPEC: "not sleep"
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}"
278 cat << "EOF" >> test.sh
279 # the below corresponds to .gitlab-ci.yml "before_script"
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;
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;
294 # the below corresponds to .gitlab-ci.yml "script"
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
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)
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'
324 vmImage: $(ubuntu_vm)
326 # Use almost the same target division in .travis.yml, only merged
327 # 4 small build jobs (arc/microblaze/nds32/xtensa) into one.
329 arc_microblaze_nds32_xtensa:
330 BUILDMAN: "arc microblaze nds32 xtensa"
331 arm11_arm7_arm920t_arm946es:
332 BUILDMAN: "arm11 arm7 arm920t arm946es"
334 BUILDMAN: "arm926ejs -x freescale,siemens,at91,kirkwood,spear,omap"
336 BUILDMAN: "at91 -x armv7"
338 BUILDMAN: "at91 -x arm926ejs"
339 boundary_engicam_toradex:
340 BUILDMAN: "boundary engicam toradex"
342 BUILDMAN: "bcm -x mips"
344 BUILDMAN: "freescale -x powerpc,m68k,aarch64,ls101,ls102,ls104,ls108,ls20,lx216"
346 BUILDMAN: "freescale&ls101"
348 BUILDMAN: "freescale&ls102"
350 BUILDMAN: "freescale&ls104"
352 BUILDMAN: "freescale&ls108"
354 BUILDMAN: "freescale&ls20"
356 BUILDMAN: "freescale&lx216"
358 BUILDMAN: "mx6 -x boundary,engicam,freescale,technexion,toradex"
360 BUILDMAN: "mx -x mx6,freescale,technexion,toradex"
364 BUILDMAN: "samsung socfpga"
376 BUILDMAN: "sun8i&armv7"
378 BUILDMAN: "sun8i&aarch64"
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"
386 BUILDMAN: "sandbox x86"
388 BUILDMAN: "technexion"
398 BUILDMAN: "powerpc -x 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*"
402 BUILDMAN: "t208xrdb corenet_ds"
404 BUILDMAN: "t4qds b4860qds mpc83xx&freescale mpc86xx&freescale"
408 BUILDMAN: "p1_p2_rdb_pc"
410 BUILDMAN: "p1010rdb bsc91"
414 BUILDMAN: "tegra -x toradex"
416 BUILDMAN: "am33xx -x siemens"
422 BUILDMAN: "aarch64 -x bcm,k3,tegra,ls1,ls2,lx216,mvebu,uniphier,sunxi,samsung,socfpga,rk,versal,zynq"
426 BUILDMAN: "sh -x arm"
428 BUILDMAN: "zynq&armv7"
430 BUILDMAN: "versal|zynqmp&aarch64"
435 cat << EOF > build.sh
438 # make environment variables available as tests are running inside a container
439 export BUILDMAN="${BUILDMAN}"
441 cat << "EOF" >> build.sh
442 if [[ "${BUILDMAN}" != "" ]]; then
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};
452 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh