2 windows_vm: vs2017-win2016
3 ubuntu_vm: ubuntu-18.04
5 ci_runner_image: trini/u-boot-gitlab-ci-runner:bionic-20200713-05Aug2020
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 (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")
20 displayName: 'Install MSYS2'
22 sfx.exe -y -o%CD:~0,2%\
23 %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Syyuu"
24 displayName: 'Update MSYS2'
26 %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm --needed -S make gcc bison flex diffutils openssl-devel"
27 displayName: 'Install Toolchain'
29 echo make tools-only_defconfig tools-only NO_SDL=1 > build-tools.sh
30 %CD:~0,2%\msys64\usr\bin\bash -lc "bash build-tools.sh"
31 displayName: 'Build Host Tools'
33 # Tell MSYS2 we need a POSIX emulation layer
35 # Tell MSYS2 not to ‘cd’ our startup directory to HOME
38 - job: tools_only_macOS
39 displayName: 'Ensure host tools build for macOS X'
43 - script: brew install make
44 displayName: Brew install dependencies
46 gmake tools-only_config tools-only NO_SDL=1 \
47 HOSTCFLAGS="-I/usr/local/opt/openssl@1.1/include" \
48 HOSTLDFLAGS="-L/usr/local/opt/openssl@1.1/lib" \
49 -j$(sysctl -n hw.logicalcpu)
50 displayName: 'Perform tools-only build'
53 displayName: 'Static code analysis with cppcheck'
57 image: $(ci_runner_image)
58 options: $(container_option)
60 - script: cppcheck -j$(nproc) --force --quiet --inline-suppr .
63 displayName: 'Build HTML documentation'
67 image: $(ci_runner_image)
68 options: $(container_option)
70 - script: make htmldocs
73 displayName: 'Search for TODO within source tree'
77 image: $(ci_runner_image)
78 options: $(container_option)
80 - script: grep -r TODO .
81 - script: grep -r FIXME .
82 - script: grep -r HACK . | grep -v HACKKIT
85 displayName: 'Some statistics about the code base'
89 image: $(ci_runner_image)
90 options: $(container_option)
95 displayName: 'Ensure all configs have MAINTAINERS entries'
99 image: $(ci_runner_image)
100 options: $(container_option)
103 if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
106 displayName: 'Ensure host tools build'
108 vmImage: $(ubuntu_vm)
110 image: $(ci_runner_image)
111 options: $(container_option)
114 make tools-only_config tools-only -j$(nproc)
117 displayName: 'Ensure env tools build'
119 vmImage: $(ubuntu_vm)
121 image: $(ci_runner_image)
122 options: $(container_option)
125 make tools-only_config envtools -j$(nproc)
128 displayName: 'Run binman, buildman, dtoc, Kconfig and patman testsuites'
130 vmImage: $(ubuntu_vm)
133 cat << EOF > build.sh
137 cat << "EOF" >> build.sh
138 git config --global user.name "Azure Pipelines"
139 git config --global user.email bmeng.cn@gmail.com
141 virtualenv -p /usr/bin/python3 /tmp/venv
142 . /tmp/venv/bin/activate
143 pip install pyelftools pytest
144 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl
145 export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt
146 export PATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}
147 ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl
148 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test
149 ./tools/buildman/buildman -t
151 ./tools/patman/patman test
152 make O=${UBOOT_TRAVIS_BUILD_DIR} testconfig
155 # We cannot use "container" like other jobs above, as buildman
156 # seems to hang forever with pre-configured "container" environment
157 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh
159 - job: nokia_rx51_test
160 displayName: 'Run tests for Nokia RX-51 (aka N900)'
162 vmImage: $(ubuntu_vm)
164 image: $(ci_runner_image)
165 options: $(container_option)
168 ./tools/buildman/buildman --fetch-arch arm
169 export PATH=~/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/:$PATH
170 test/nokia_rx51_test.sh
173 displayName: 'test.py'
175 vmImage: $(ubuntu_vm)
179 TEST_PY_BD: "sandbox"
181 TEST_PY_BD: "sandbox"
182 OVERRIDE: "-O clang-10"
184 TEST_PY_BD: "sandbox_spl"
185 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff"
187 TEST_PY_BD: "sandbox_flattree"
189 TEST_PY_BD: "evb-ast2500"
190 TEST_PY_ID: "--id qemu"
192 TEST_PY_BD: "vexpress_ca15_tc2"
193 TEST_PY_ID: "--id qemu"
195 TEST_PY_BD: "vexpress_ca9x4"
196 TEST_PY_ID: "--id qemu"
197 integratorcp_cm926ejs:
198 TEST_PY_BD: "integratorcp_cm926ejs"
199 TEST_PY_ID: "--id qemu"
200 TEST_PY_TEST_SPEC: "not sleep"
202 TEST_PY_BD: "qemu_arm"
203 TEST_PY_TEST_SPEC: "not sleep"
205 TEST_PY_BD: "qemu_arm64"
206 TEST_PY_TEST_SPEC: "not sleep"
208 TEST_PY_BD: "qemu_mips"
209 TEST_PY_TEST_SPEC: "not sleep"
211 TEST_PY_BD: "qemu_mipsel"
212 TEST_PY_TEST_SPEC: "not sleep"
214 TEST_PY_BD: "qemu_mips64"
215 TEST_PY_TEST_SPEC: "not sleep"
217 TEST_PY_BD: "qemu_mips64el"
218 TEST_PY_TEST_SPEC: "not sleep"
221 TEST_PY_ID: "--id qemu"
222 TEST_PY_TEST_SPEC: "not sleep and not efi"
224 TEST_PY_BD: "maltael"
225 TEST_PY_ID: "--id qemu"
226 TEST_PY_TEST_SPEC: "not sleep and not efi"
228 TEST_PY_BD: "malta64"
229 TEST_PY_ID: "--id qemu"
230 TEST_PY_TEST_SPEC: "not sleep and not efi"
232 TEST_PY_BD: "malta64el"
233 TEST_PY_ID: "--id qemu"
234 TEST_PY_TEST_SPEC: "not sleep and not efi"
236 TEST_PY_BD: "qemu-ppce500"
237 TEST_PY_TEST_SPEC: "not sleep"
239 TEST_PY_BD: "qemu-riscv32"
240 TEST_PY_TEST_SPEC: "not sleep"
242 TEST_PY_BD: "qemu-riscv64"
243 TEST_PY_TEST_SPEC: "not sleep"
245 TEST_PY_BD: "qemu-riscv32_spl"
246 TEST_PY_TEST_SPEC: "not sleep"
248 TEST_PY_BD: "qemu-riscv64_spl"
249 TEST_PY_TEST_SPEC: "not sleep"
251 TEST_PY_BD: "qemu-x86"
252 TEST_PY_TEST_SPEC: "not sleep"
254 TEST_PY_BD: "qemu-x86_64"
255 TEST_PY_TEST_SPEC: "not sleep"
257 TEST_PY_BD: "xilinx_zynq_virt"
258 TEST_PY_ID: "--id qemu"
259 TEST_PY_TEST_SPEC: "not sleep"
261 TEST_PY_BD: "xilinx_versal_virt"
262 TEST_PY_ID: "--id qemu"
263 TEST_PY_TEST_SPEC: "not sleep"
266 TEST_PY_ID: "--id qemu"
267 TEST_PY_TEST_SPEC: "not sleep"
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}"
279 cat << "EOF" >> test.sh
280 # the below corresponds to .gitlab-ci.yml "before_script"
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;
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;
295 # the below corresponds to .gitlab-ci.yml "script"
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
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)
320 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/test.sh
322 - job: build_the_world
323 displayName: 'Build the World'
325 vmImage: $(ubuntu_vm)
327 # Use almost the same target division in .travis.yml, only merged
328 # 4 small build jobs (arc/microblaze/nds32/xtensa) into one.
330 arc_microblaze_nds32_xtensa:
331 BUILDMAN: "arc microblaze nds32 xtensa"
332 arm11_arm7_arm920t_arm946es:
333 BUILDMAN: "arm11 arm7 arm920t arm946es"
335 BUILDMAN: "arm926ejs -x freescale,siemens,at91,kirkwood,spear,omap"
337 BUILDMAN: "at91 -x armv7"
339 BUILDMAN: "at91 -x arm926ejs"
340 boundary_engicam_toradex:
341 BUILDMAN: "boundary engicam toradex"
343 BUILDMAN: "bcm -x mips"
345 BUILDMAN: "freescale -x powerpc,m68k,aarch64,ls101,ls102,ls104,ls108,ls20,lx216"
347 BUILDMAN: "freescale&ls101"
349 BUILDMAN: "freescale&ls102"
351 BUILDMAN: "freescale&ls104"
353 BUILDMAN: "freescale&ls108"
355 BUILDMAN: "freescale&ls20"
357 BUILDMAN: "freescale&lx216"
359 BUILDMAN: "mx6 -x boundary,engicam,freescale,technexion,toradex"
361 BUILDMAN: "mx -x mx6,freescale,technexion,toradex"
365 BUILDMAN: "samsung socfpga"
377 BUILDMAN: "sun8i&armv7"
379 BUILDMAN: "sun8i&aarch64"
385 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"
387 BUILDMAN: "sandbox x86"
389 BUILDMAN: "technexion"
399 BUILDMAN: "powerpc -x freescale"
401 BUILDMAN: "mpc85xx&freescale -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x bsc91*"
403 BUILDMAN: "t208xrdb corenet_ds"
405 BUILDMAN: "t4qds b4860qds mpc83xx&freescale mpc86xx&freescale"
409 BUILDMAN: "p1_p2_rdb_pc"
411 BUILDMAN: "p1010rdb bsc91"
415 BUILDMAN: "tegra -x toradex"
417 BUILDMAN: "am33xx -x siemens"
423 BUILDMAN: "aarch64 -x bcm,k3,tegra,ls1,ls2,lx216,mvebu,uniphier,sunxi,samsung,socfpga,rk,versal,zynq"
427 BUILDMAN: "sh -x arm"
429 BUILDMAN: "zynq&armv7"
431 BUILDMAN: "versal|zynqmp&aarch64"
436 cat << EOF > build.sh
439 # make environment variables available as tests are running inside a container
440 export BUILDMAN="${BUILDMAN}"
442 cat << "EOF" >> build.sh
443 if [[ "${BUILDMAN}" != "" ]]; then
445 tools/buildman/buildman -o /tmp -P -W ${BUILDMAN} ${OVERRIDE} || ret=$?;
446 if [[ $ret -ne 0 ]]; then
447 tools/buildman/buildman -o /tmp -seP ${BUILDMAN};
453 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh