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 set PATH=%CD:~0,2%\$(MSYS_DIR)\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
31 %CD:~0,2%\$(MSYS_DIR)\usr\bin\pacman --noconfirm -Syyuu
32 displayName: 'Update MSYS2'
34 set PATH=%CD:~0,2%\$(MSYS_DIR)\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
35 %CD:~0,2%\$(MSYS_DIR)\usr\bin\pacman --noconfirm --needed -S make gcc bison diffutils openssl-devel
36 displayName: 'Install Toolchain'
38 set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
39 echo make tools-only_defconfig tools-only NO_SDL=1 > build-tools.sh
40 %CD:~0,2%\$(MSYS_DIR)\usr\bin\bash -lc "bash build-tools.sh"
41 displayName: 'Build Host Tools'
43 # Tell MSYS2 we need a POSIX emulation layer
45 # Tell MSYS2 not to ‘cd’ our startup directory to HOME
48 - job: tools_only_macOS
49 displayName: 'Ensure host tools build for macOS X'
53 - script: brew install make
54 displayName: Brew install dependencies
56 gmake tools-only_config tools-only NO_SDL=1 \
57 HOSTCFLAGS="-I/usr/local/opt/openssl@1.1/include" \
58 HOSTLDFLAGS="-L/usr/local/opt/openssl@1.1/lib" \
59 -j$(sysctl -n hw.logicalcpu)
60 displayName: 'Perform tools-only build'
63 displayName: 'Static code analysis with cppcheck'
67 image: $(ci_runner_image)
68 options: $(container_option)
70 - script: cppcheck -j$(nproc) --force --quiet --inline-suppr .
73 displayName: 'Build HTML documentation'
77 image: $(ci_runner_image)
78 options: $(container_option)
80 - script: make htmldocs
83 displayName: 'Search for TODO within source tree'
87 image: $(ci_runner_image)
88 options: $(container_option)
90 - script: grep -r TODO .
91 - script: grep -r FIXME .
92 - script: grep -r HACK . | grep -v HACKKIT
95 displayName: 'Some statistics about the code base'
99 image: $(ci_runner_image)
100 options: $(container_option)
102 - script: sloccount .
105 displayName: 'Ensure all configs have MAINTAINERS entries'
107 vmImage: $(ubuntu_vm)
109 image: $(ci_runner_image)
110 options: $(container_option)
113 if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
116 displayName: 'Ensure host tools build'
118 vmImage: $(ubuntu_vm)
120 image: $(ci_runner_image)
121 options: $(container_option)
124 make tools-only_config tools-only -j$(nproc)
127 displayName: 'Ensure env tools build'
129 vmImage: $(ubuntu_vm)
131 image: $(ci_runner_image)
132 options: $(container_option)
135 make tools-only_config envtools -j$(nproc)
138 displayName: 'Run binman, buildman, dtoc, Kconfig and patman testsuites'
140 vmImage: $(ubuntu_vm)
143 cat << EOF > build.sh
147 cat << "EOF" >> build.sh
148 git config --global user.name "Azure Pipelines"
149 git config --global user.email bmeng.cn@gmail.com
151 virtualenv -p /usr/bin/python3 /tmp/venv
152 . /tmp/venv/bin/activate
153 pip install pyelftools pytest
154 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl
155 export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt
156 export PATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}
157 ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl
158 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test
159 ./tools/buildman/buildman -t
161 ./tools/patman/patman --test
162 make O=${UBOOT_TRAVIS_BUILD_DIR} testconfig
165 # We cannot use "container" like other jobs above, as buildman
166 # seems to hang forever with pre-configured "container" environment
167 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh
169 - job: nokia_rx51_test
170 displayName: 'Run tests for Nokia RX-51 (aka N900)'
172 vmImage: $(ubuntu_vm)
174 image: $(ci_runner_image)
175 options: $(container_option)
178 ./tools/buildman/buildman --fetch-arch arm
179 export PATH=~/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/:$PATH
180 test/nokia_rx51_test.sh
183 displayName: 'test.py'
185 vmImage: $(ubuntu_vm)
189 TEST_PY_BD: "sandbox"
191 TEST_PY_BD: "sandbox"
192 OVERRIDE: "-O clang-10"
194 TEST_PY_BD: "sandbox_spl"
195 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff"
197 TEST_PY_BD: "sandbox_flattree"
199 TEST_PY_BD: "evb-ast2500"
200 TEST_PY_ID: "--id qemu"
202 TEST_PY_BD: "vexpress_ca15_tc2"
203 TEST_PY_ID: "--id qemu"
205 TEST_PY_BD: "vexpress_ca9x4"
206 TEST_PY_ID: "--id qemu"
207 integratorcp_cm926ejs:
208 TEST_PY_BD: "integratorcp_cm926ejs"
209 TEST_PY_ID: "--id qemu"
210 TEST_PY_TEST_SPEC: "not sleep"
212 TEST_PY_BD: "qemu_arm"
213 TEST_PY_TEST_SPEC: "not sleep"
215 TEST_PY_BD: "qemu_arm64"
216 TEST_PY_TEST_SPEC: "not sleep"
218 TEST_PY_BD: "qemu_mips"
219 TEST_PY_TEST_SPEC: "not sleep"
221 TEST_PY_BD: "qemu_mipsel"
222 TEST_PY_TEST_SPEC: "not sleep"
224 TEST_PY_BD: "qemu_mips64"
225 TEST_PY_TEST_SPEC: "not sleep"
227 TEST_PY_BD: "qemu_mips64el"
228 TEST_PY_TEST_SPEC: "not sleep"
231 TEST_PY_ID: "--id qemu"
232 TEST_PY_TEST_SPEC: "not sleep and not efi"
234 TEST_PY_BD: "maltael"
235 TEST_PY_ID: "--id qemu"
236 TEST_PY_TEST_SPEC: "not sleep and not efi"
238 TEST_PY_BD: "malta64"
239 TEST_PY_ID: "--id qemu"
240 TEST_PY_TEST_SPEC: "not sleep and not efi"
242 TEST_PY_BD: "malta64el"
243 TEST_PY_ID: "--id qemu"
244 TEST_PY_TEST_SPEC: "not sleep and not efi"
246 TEST_PY_BD: "qemu-ppce500"
247 TEST_PY_TEST_SPEC: "not sleep"
249 TEST_PY_BD: "qemu-riscv32"
250 TEST_PY_TEST_SPEC: "not sleep"
252 TEST_PY_BD: "qemu-riscv64"
253 TEST_PY_TEST_SPEC: "not sleep"
255 TEST_PY_BD: "qemu-riscv32_spl"
256 TEST_PY_TEST_SPEC: "not sleep"
258 TEST_PY_BD: "qemu-riscv64_spl"
259 TEST_PY_TEST_SPEC: "not sleep"
261 TEST_PY_BD: "qemu-x86"
262 TEST_PY_TEST_SPEC: "not sleep"
264 TEST_PY_BD: "qemu-x86_64"
265 TEST_PY_TEST_SPEC: "not sleep"
267 TEST_PY_BD: "xilinx_zynq_virt"
268 TEST_PY_ID: "--id qemu"
269 TEST_PY_TEST_SPEC: "not sleep"
271 TEST_PY_BD: "xilinx_versal_virt"
272 TEST_PY_ID: "--id qemu"
273 TEST_PY_TEST_SPEC: "not sleep"
276 TEST_PY_ID: "--id qemu"
277 TEST_PY_TEST_SPEC: "not sleep"
282 # make environment variables available as tests are running inside a container
283 export WORK_DIR="${WORK_DIR}"
284 export TEST_PY_BD="${TEST_PY_BD}"
285 export TEST_PY_ID="${TEST_PY_ID}"
286 export TEST_PY_TEST_SPEC="${TEST_PY_TEST_SPEC}"
287 export OVERRIDE="${OVERRIDE}"
289 cat << "EOF" >> test.sh
290 # the below corresponds to .gitlab-ci.yml "before_script"
292 git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
293 ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
294 ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
295 grub-mkimage --prefix=\"\" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
296 grub-mkimage --prefix=\"\" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
297 cp /opt/grub/grubriscv64.efi ~/grub_riscv64.efi
298 cp /opt/grub/grubriscv32.efi ~/grub_riscv32.efi
299 cp /opt/grub/grubaa64.efi ~/grub_arm64.efi
300 cp /opt/grub/grubarm.efi ~/grub_arm.efi
301 if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
302 wget -O - https://github.com/riscv/opensbi/releases/download/v0.6/opensbi-0.6-rv32-bin.tar.xz | tar -C /tmp -xJ;
303 export OPENSBI=/tmp/opensbi-0.6-rv32-bin/platform/qemu/virt/firmware/fw_dynamic.bin;
305 if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
306 wget -O - https://github.com/riscv/opensbi/releases/download/v0.6/opensbi-0.6-rv64-bin.tar.xz | tar -C /tmp -xJ;
307 export OPENSBI=/tmp/opensbi-0.6-rv64-bin/platform/qemu/virt/firmware/fw_dynamic.bin;
309 # the below corresponds to .gitlab-ci.yml "script"
311 export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD};
312 tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e --board ${TEST_PY_BD} ${OVERRIDE}
313 virtualenv -p /usr/bin/python3 /tmp/venv
314 . /tmp/venv/bin/activate
315 pip install -r test/py/requirements.txt
316 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
317 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
318 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
319 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID} ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"} --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
320 # the below corresponds to .gitlab-ci.yml "after_script"
321 rm -rf /tmp/uboot-test-hooks /tmp/venv
324 # make current directory writeable to uboot user inside the container
325 # as sandbox testing need create files like spi flash images, etc.
326 # (TODO: clean up this in the future)
328 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/test.sh
330 - job: build_the_world
331 displayName: 'Build the World'
333 vmImage: $(ubuntu_vm)
335 # Use almost the same target division in .travis.yml, only merged
336 # 4 small build jobs (arc/microblaze/nds32/xtensa) into one.
338 arc_microblaze_nds32_xtensa:
339 BUILDMAN: "arc microblaze nds32 xtensa"
340 arm11_arm7_arm920t_arm946es:
341 BUILDMAN: "arm11 arm7 arm920t arm946es"
343 BUILDMAN: "arm926ejs -x freescale,siemens,at91,kirkwood,spear,omap"
345 BUILDMAN: "at91 -x armv7"
347 BUILDMAN: "at91 -x arm926ejs"
348 boundary_engicam_toradex:
349 BUILDMAN: "boundary engicam toradex"
351 BUILDMAN: "bcm -x mips"
353 BUILDMAN: "freescale -x powerpc,m68k,aarch64,ls101,ls102,ls104,ls108,ls20,lx216"
355 BUILDMAN: "freescale&ls101"
357 BUILDMAN: "freescale&ls102"
359 BUILDMAN: "freescale&ls104"
361 BUILDMAN: "freescale&ls108"
363 BUILDMAN: "freescale&ls20"
365 BUILDMAN: "freescale&lx216"
367 BUILDMAN: "mx6 -x boundary,engicam,freescale,technexion,toradex"
369 BUILDMAN: "mx -x mx6,freescale,technexion,toradex"
373 BUILDMAN: "samsung socfpga"
385 BUILDMAN: "sun8i&armv7"
387 BUILDMAN: "sun8i&aarch64"
393 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"
395 BUILDMAN: "sandbox x86"
397 BUILDMAN: "technexion"
407 BUILDMAN: "powerpc -x freescale"
409 BUILDMAN: "mpc85xx&freescale -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x bsc91*"
411 BUILDMAN: "t208xrdb corenet_ds"
413 BUILDMAN: "t4qds b4860qds mpc83xx&freescale mpc86xx&freescale"
417 BUILDMAN: "p1_p2_rdb_pc"
419 BUILDMAN: "p1010rdb bsc91"
423 BUILDMAN: "tegra -x toradex"
425 BUILDMAN: "am33xx -x siemens"
431 BUILDMAN: "aarch64 -x bcm,k3,tegra,ls1,ls2,lx216,mvebu,uniphier,sunxi,samsung,socfpga,rk,versal,zynq"
435 BUILDMAN: "sh -x arm"
437 BUILDMAN: "zynq&armv7"
439 BUILDMAN: "versal|zynqmp&aarch64"
444 cat << EOF > build.sh
447 # make environment variables available as tests are running inside a container
448 export BUILDMAN="${BUILDMAN}"
450 cat << "EOF" >> build.sh
451 if [[ "${BUILDMAN}" != "" ]]; then
453 tools/buildman/buildman -o /tmp -P -W ${BUILDMAN} ${OVERRIDE} || ret=$?;
454 if [[ $ret -ne 0 ]]; then
455 tools/buildman/buildman -o /tmp -seP ${BUILDMAN};
461 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh