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)
21 BASE_REPO: msys2-ci-base-i686
24 BASE_REPO: msys2-ci-base
27 git clone https://github.com/msys2/$(BASE_REPO).git %CD:~0,2%\$(MSYS_DIR)
28 displayName: 'Install MSYS2'
30 %CD:~0,2%\$(MSYS_DIR)\usr\bin\bash -lc "pacman --noconfirm -Syyuu"
31 displayName: 'Update MSYS2'
33 %CD:~0,2%\$(MSYS_DIR)\usr\bin\bash -lc "pacman --noconfirm --needed -S make gcc bison diffutils openssl-devel"
34 displayName: 'Install Toolchain'
36 echo make tools-only_defconfig tools-only NO_SDL=1 > build-tools.sh
37 %CD:~0,2%\$(MSYS_DIR)\usr\bin\bash -lc "bash build-tools.sh"
38 displayName: 'Build Host Tools'
40 # Tell MSYS2 we need a POSIX emulation layer
42 # Tell MSYS2 not to ‘cd’ our startup directory to HOME
45 - job: tools_only_macOS
46 displayName: 'Ensure host tools build for macOS X'
50 - script: brew install make
51 displayName: Brew install dependencies
53 gmake tools-only_config tools-only NO_SDL=1 \
54 HOSTCFLAGS="-I/usr/local/opt/openssl@1.1/include" \
55 HOSTLDFLAGS="-L/usr/local/opt/openssl@1.1/lib" \
56 -j$(sysctl -n hw.logicalcpu)
57 displayName: 'Perform tools-only build'
60 displayName: 'Static code analysis with cppcheck'
64 image: $(ci_runner_image)
65 options: $(container_option)
67 - script: cppcheck -j$(nproc) --force --quiet --inline-suppr .
70 displayName: 'Build HTML documentation'
74 image: $(ci_runner_image)
75 options: $(container_option)
77 - script: make htmldocs
80 displayName: 'Search for TODO within source tree'
84 image: $(ci_runner_image)
85 options: $(container_option)
87 - script: grep -r TODO .
88 - script: grep -r FIXME .
89 - script: grep -r HACK . | grep -v HACKKIT
92 displayName: 'Some statistics about the code base'
96 image: $(ci_runner_image)
97 options: $(container_option)
102 displayName: 'Ensure all configs have MAINTAINERS entries'
104 vmImage: $(ubuntu_vm)
106 image: $(ci_runner_image)
107 options: $(container_option)
110 if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
113 displayName: 'Ensure host tools build'
115 vmImage: $(ubuntu_vm)
117 image: $(ci_runner_image)
118 options: $(container_option)
121 make tools-only_config tools-only -j$(nproc)
124 displayName: 'Ensure env tools build'
126 vmImage: $(ubuntu_vm)
128 image: $(ci_runner_image)
129 options: $(container_option)
132 make tools-only_config envtools -j$(nproc)
135 displayName: 'Run binman, buildman, dtoc, Kconfig and patman testsuites'
137 vmImage: $(ubuntu_vm)
140 cat << EOF > build.sh
144 cat << "EOF" >> build.sh
145 git config --global user.name "Azure Pipelines"
146 git config --global user.email bmeng.cn@gmail.com
148 virtualenv -p /usr/bin/python3 /tmp/venv
149 . /tmp/venv/bin/activate
150 pip install pyelftools pytest
151 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl
152 export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt
153 export PATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}
154 ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl
155 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test
156 ./tools/buildman/buildman -t
158 ./tools/patman/patman test
159 make O=${UBOOT_TRAVIS_BUILD_DIR} testconfig
162 # We cannot use "container" like other jobs above, as buildman
163 # seems to hang forever with pre-configured "container" environment
164 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh
166 - job: nokia_rx51_test
167 displayName: 'Run tests for Nokia RX-51 (aka N900)'
169 vmImage: $(ubuntu_vm)
171 image: $(ci_runner_image)
172 options: $(container_option)
175 ./tools/buildman/buildman --fetch-arch arm
176 export PATH=~/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/:$PATH
177 test/nokia_rx51_test.sh
180 displayName: 'test.py'
182 vmImage: $(ubuntu_vm)
186 TEST_PY_BD: "sandbox"
188 TEST_PY_BD: "sandbox"
189 OVERRIDE: "-O clang-10"
191 TEST_PY_BD: "sandbox_spl"
192 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff"
194 TEST_PY_BD: "sandbox_flattree"
196 TEST_PY_BD: "evb-ast2500"
197 TEST_PY_ID: "--id qemu"
199 TEST_PY_BD: "vexpress_ca15_tc2"
200 TEST_PY_ID: "--id qemu"
202 TEST_PY_BD: "vexpress_ca9x4"
203 TEST_PY_ID: "--id qemu"
204 integratorcp_cm926ejs:
205 TEST_PY_BD: "integratorcp_cm926ejs"
206 TEST_PY_ID: "--id qemu"
207 TEST_PY_TEST_SPEC: "not sleep"
209 TEST_PY_BD: "qemu_arm"
210 TEST_PY_TEST_SPEC: "not sleep"
212 TEST_PY_BD: "qemu_arm64"
213 TEST_PY_TEST_SPEC: "not sleep"
215 TEST_PY_BD: "qemu_mips"
216 TEST_PY_TEST_SPEC: "not sleep"
218 TEST_PY_BD: "qemu_mipsel"
219 TEST_PY_TEST_SPEC: "not sleep"
221 TEST_PY_BD: "qemu_mips64"
222 TEST_PY_TEST_SPEC: "not sleep"
224 TEST_PY_BD: "qemu_mips64el"
225 TEST_PY_TEST_SPEC: "not sleep"
228 TEST_PY_ID: "--id qemu"
229 TEST_PY_TEST_SPEC: "not sleep and not efi"
231 TEST_PY_BD: "maltael"
232 TEST_PY_ID: "--id qemu"
233 TEST_PY_TEST_SPEC: "not sleep and not efi"
235 TEST_PY_BD: "malta64"
236 TEST_PY_ID: "--id qemu"
237 TEST_PY_TEST_SPEC: "not sleep and not efi"
239 TEST_PY_BD: "malta64el"
240 TEST_PY_ID: "--id qemu"
241 TEST_PY_TEST_SPEC: "not sleep and not efi"
243 TEST_PY_BD: "qemu-ppce500"
244 TEST_PY_TEST_SPEC: "not sleep"
246 TEST_PY_BD: "qemu-riscv32"
247 TEST_PY_TEST_SPEC: "not sleep"
249 TEST_PY_BD: "qemu-riscv64"
250 TEST_PY_TEST_SPEC: "not sleep"
252 TEST_PY_BD: "qemu-riscv32_spl"
253 TEST_PY_TEST_SPEC: "not sleep"
255 TEST_PY_BD: "qemu-riscv64_spl"
256 TEST_PY_TEST_SPEC: "not sleep"
258 TEST_PY_BD: "qemu-x86"
259 TEST_PY_TEST_SPEC: "not sleep"
261 TEST_PY_BD: "qemu-x86_64"
262 TEST_PY_TEST_SPEC: "not sleep"
264 TEST_PY_BD: "xilinx_zynq_virt"
265 TEST_PY_ID: "--id qemu"
266 TEST_PY_TEST_SPEC: "not sleep"
268 TEST_PY_BD: "xilinx_versal_virt"
269 TEST_PY_ID: "--id qemu"
270 TEST_PY_TEST_SPEC: "not sleep"
273 TEST_PY_ID: "--id qemu"
274 TEST_PY_TEST_SPEC: "not sleep"
279 # make environment variables available as tests are running inside a container
280 export WORK_DIR="${WORK_DIR}"
281 export TEST_PY_BD="${TEST_PY_BD}"
282 export TEST_PY_ID="${TEST_PY_ID}"
283 export TEST_PY_TEST_SPEC="${TEST_PY_TEST_SPEC}"
284 export OVERRIDE="${OVERRIDE}"
286 cat << "EOF" >> test.sh
287 # the below corresponds to .gitlab-ci.yml "before_script"
289 git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
290 ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
291 ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
292 grub-mkimage --prefix=\"\" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
293 grub-mkimage --prefix=\"\" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
294 if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
295 wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
296 export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
298 if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
299 wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
300 export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
302 # the below corresponds to .gitlab-ci.yml "script"
304 export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD};
305 tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e --board ${TEST_PY_BD} ${OVERRIDE}
306 cp ~/grub_x86.efi ${UBOOT_TRAVIS_BUILD_DIR}/
307 cp ~/grub_x64.efi ${UBOOT_TRAVIS_BUILD_DIR}/
308 cp /opt/grub/grubriscv64.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_riscv64.efi
309 cp /opt/grub/grubriscv32.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_riscv32.efi
310 cp /opt/grub/grubaa64.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_arm64.efi
311 cp /opt/grub/grubarm.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_arm.efi
312 virtualenv -p /usr/bin/python3 /tmp/venv
313 . /tmp/venv/bin/activate
314 pip install -r test/py/requirements.txt
315 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
316 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
317 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
318 ./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";
319 # the below corresponds to .gitlab-ci.yml "after_script"
320 rm -rf /tmp/uboot-test-hooks /tmp/venv
323 # make current directory writeable to uboot user inside the container
324 # as sandbox testing need create files like spi flash images, etc.
325 # (TODO: clean up this in the future)
327 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/test.sh
329 - job: build_the_world
330 displayName: 'Build the World'
332 vmImage: $(ubuntu_vm)
334 # Use almost the same target division in .travis.yml, only merged
335 # 4 small build jobs (arc/microblaze/nds32/xtensa) into one.
337 arc_microblaze_nds32_xtensa:
338 BUILDMAN: "arc microblaze nds32 xtensa"
339 arm11_arm7_arm920t_arm946es:
340 BUILDMAN: "arm11 arm7 arm920t arm946es"
342 BUILDMAN: "arm926ejs -x freescale,siemens,at91,kirkwood,spear,omap"
344 BUILDMAN: "at91 -x armv7"
346 BUILDMAN: "at91 -x arm926ejs"
347 boundary_engicam_toradex:
348 BUILDMAN: "boundary engicam toradex"
350 BUILDMAN: "bcm -x mips"
352 BUILDMAN: "freescale -x powerpc,m68k,aarch64,ls101,ls102,ls104,ls108,ls20,lx216"
354 BUILDMAN: "freescale&ls101"
356 BUILDMAN: "freescale&ls102"
358 BUILDMAN: "freescale&ls104"
360 BUILDMAN: "freescale&ls108"
362 BUILDMAN: "freescale&ls20"
364 BUILDMAN: "freescale&lx216"
366 BUILDMAN: "mx6 -x boundary,engicam,freescale,technexion,toradex"
368 BUILDMAN: "mx -x mx6,freescale,technexion,toradex"
372 BUILDMAN: "samsung socfpga"
384 BUILDMAN: "sun8i&armv7"
386 BUILDMAN: "sun8i&aarch64"
392 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"
394 BUILDMAN: "sandbox x86"
396 BUILDMAN: "technexion"
406 BUILDMAN: "powerpc -x freescale"
408 BUILDMAN: "mpc85xx&freescale -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x bsc91*"
410 BUILDMAN: "t208xrdb corenet_ds"
412 BUILDMAN: "t4qds b4860qds mpc83xx&freescale mpc86xx&freescale"
416 BUILDMAN: "p1_p2_rdb_pc"
418 BUILDMAN: "p1010rdb bsc91"
422 BUILDMAN: "tegra -x toradex"
424 BUILDMAN: "am33xx -x siemens"
430 BUILDMAN: "aarch64 -x bcm,k3,tegra,ls1,ls2,lx216,mvebu,uniphier,sunxi,samsung,socfpga,rk,versal,zynq"
434 BUILDMAN: "sh -x arm"
436 BUILDMAN: "zynq&armv7"
438 BUILDMAN: "versal|zynqmp&aarch64"
443 cat << EOF > build.sh
446 # make environment variables available as tests are running inside a container
447 export BUILDMAN="${BUILDMAN}"
449 cat << "EOF" >> build.sh
450 if [[ "${BUILDMAN}" != "" ]]; then
452 tools/buildman/buildman -o /tmp -P -W ${BUILDMAN} ${OVERRIDE} || ret=$?;
453 if [[ $ret -ne 0 ]]; then
454 tools/buildman/buildman -o /tmp -seP ${BUILDMAN};
460 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh