Skip to content

Commit

Permalink
build,travis: split builds into smaller parts
Browse files Browse the repository at this point in the history
The checkpatch part generates all builds as red, if at least one format
element is wrong, which really reduces the value of builds.

Isolating the checkpatch and dtb builds into their own container,
highlights compile issues better, and if there are any checkpatch stuff
that's easy to fix, this can be re-spun in less than 10 minutes (which is
what a normal Linux build takes).

Signed-off-by: Alexandru Ardelean <[email protected]>
  • Loading branch information
commodo committed Nov 5, 2018
1 parent e9d9699 commit 6827f3d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ notifications:

env:
matrix:
- BUILD_TYPE=checkpatch
- BUILD_TYPE=dtb_build_test
- DEFCONFIG_NAME=zynq_xcomm_adv7511_defconfig ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
DTS_FILES=arch/arm/boot/dts/zynq-*.dts IMAGE=uImage
- DEFCONFIG_NAME=zynq_pluto_defconfig ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
Expand All @@ -18,8 +20,8 @@ env:
DTS_FILES=arch/arm/boot/dts/zynq-*.dts IMAGE=uImage
- DEFCONFIG_NAME=adi_zynqmp_defconfig ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
DTS_FILES=arch/arm64/boot/dts/xilinx/zynqmp-*.dts DTS_PREFIX=xilinx/ IMAGE=Image
- COMPILE_TEST=y DEFCONFIG_NAME=zynq_xcomm_adv7511_defconfig ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
- COMPILE_TEST=y DEFCONFIG_NAME=adi_zynqmp_defconfig ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
- BUILD_TYPE=compile_test DEFCONFIG_NAME=zynq_xcomm_adv7511_defconfig ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
- BUILD_TYPE=compile_test DEFCONFIG_NAME=adi_zynqmp_defconfig ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-

before_install:
- sudo apt-get update -qq
Expand Down
33 changes: 16 additions & 17 deletions ci/travis/run-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,34 @@
set -xe

build_default() {
if [ -n "$TRAVIS_BRANCH" ]; then
git fetch origin +refs/heads/${TRAVIS_BRANCH}:${TRAVIS_BRANCH}
fi

COMMIT_RANGE=$([ "$TRAVIS_PULL_REQUEST" == "false" ] && echo HEAD || echo ${TRAVIS_BRANCH}..)

make ${DEFCONFIG_NAME}
make -j`getconf _NPROCESSORS_ONLN` $IMAGE UIMAGE_LOADADDR=0x8000
}

for file in $DTS_FILES; do
make ${DTS_PREFIX}`basename $file | sed -e 's\dts\dtb\g'` || exit 1
done
build_compile_test() {
export COMPILE_TEST=y
make ${DEFCONFIG_NAME}
make -j`getconf _NPROCESSORS_ONLN`
}

build_checkpatch() {
if [ -n "$TRAVIS_BRANCH" ]; then
git fetch origin +refs/heads/${TRAVIS_BRANCH}:${TRAVIS_BRANCH}
fi
COMMIT_RANGE=$([ "$TRAVIS_PULL_REQUEST" == "false" ] && echo HEAD || echo ${TRAVIS_BRANCH}..)
scripts/checkpatch.pl --git ${COMMIT_RANGE} \
--ignore FILE_PATH_CHANGES \
--ignore LONG_LINE \
--ignore LONG_LINE_STRING \
--ignore LONG_LINE_COMMENT
}

build_compile_test() {
make ${DEFCONFIG_NAME}
make -j`getconf _NPROCESSORS_ONLN`
build_dtb_build_test() {
for file in $DTS_FILES; do
make ${DTS_PREFIX}`basename $file | sed -e 's\dts\dtb\g'` || exit 1
done
}

BUILD_TYPE=default

if [ "$COMPILE_TEST" == "y" ] ; then
BUILD_TYPE=compile_test
fi
BUILD_TYPE=${BUILD_TYPE:-default}

build_${BUILD_TYPE}

0 comments on commit 6827f3d

Please sign in to comment.