From: Simon Glass Date: Wed, 18 Mar 2020 15:42:49 +0000 (-0600) Subject: travis: Split the building into two parts X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=e7c05b1fda999e5676289386a956dc56df03eec2;p=u-boot.git travis: Split the building into two parts Buildman is used in two ways: - to build a selection of boards (with no testing) - to build a single board (and run pytest) The gitlab and azure scrips do this in separate places, but travis does not. To aid the refactoring process and keep the following patches in sync across all three environments, split the code out in travis as well. Use the buildman -w option for the single board. It is easier to understand since it specifies the output directory directly. Also it avoids needing to look at the internal .bm-work directory. This initially creates some duplicate code, but by the end of the series we have two completely different build paths with different arguments. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- diff --git a/.travis.yml b/.travis.yml index 601a50d202..23f92095af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -206,7 +206,8 @@ script: # # From buildman, exit code 129 means warnings only. If we've been asked to # use clang only do one configuration. - - if [[ "${BUILDMAN}" != "" ]]; then + # Build a selection of boards if TEST_PY_BD is empty + - if [[ "${BUILDMAN}" != "" ]] && [[ "${TEST_PY_BD}" == "" ]]; then ret=0; tools/buildman/buildman -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?; if [[ $ret -ne 0 && $ret -ne 129 ]]; then @@ -218,8 +219,9 @@ script: # never prevent any test from running. That way, we can always pass # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom # value. + # Build just the one board needed for testing, if TEST_PY_BD is non-empty - if [[ "${TEST_PY_BD}" != "" ]]; then - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD}; + export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/${TEST_PY_BD}; cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/; cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/; if [[ -e ~/grub_arm.efi ]]; then @@ -234,6 +236,13 @@ script: if [[ -e ~/grub_riscv64.efi ]]; then cp ~/grub_riscv64.efi $UBOOT_TRAVIS_BUILD_DIR/; fi; + ret=0; + tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E ${BUILDMAN} + ${OVERRIDE}|| ret=$?; + if [[ $ret -ne 0 && $ret -ne 129 ]]; then + tools/buildman/buildman -sde -o ${UBOOT_TRAVIS_BUILD_DIR} -w ${BUILDMAN}; + exit $ret; + fi; virtualenv -p /usr/bin/python3 /tmp/venv; . /tmp/venv/bin/activate; pip install -r test/py/requirements.txt;