summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Schenker <philippe.schenker@toradex.com>2021-04-08 13:41:29 +0200
committerPhilippe Schenker <philippe.schenker@toradex.com>2021-04-08 15:40:49 +0200
commit77ea21970b40ba6547cbada228904914a1ba2c11 (patch)
tree1ea2761c80de19754c139a9011b35ec4ce704013
parente604d90500a4afbc0cad11dbafa232d3f1450e15 (diff)
gitlab-ci: Build also bsp defconfig and check its size
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
-rw-r--r--.gitlab-ci.yml32
1 files changed, 32 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 90e293e1e693..e79f21ea719d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -66,3 +66,35 @@ build_default_defconfig :
# Defining the path, which we will use to take a config file to build a kernel
KERNEL_FILE_PATH: colibri-imx7/torizon-upstream/torizon-core-docker
stage: build-product
+
+build_bsp_defconfig:
+ stage: build-product
+ variables:
+ DEFCONFIG: "toradex-imx_v6_v7_defconfig"
+ # Choose max kernel size that `ubinfo /dev/ubi0_0` reports
+ MAX_KERNEL_SIZE_B: 8507392
+ GIT_STRATEGY: fetch
+ GIT_DEPTH: "1"
+ script: |
+ #set -o xtrace
+ cd $CI_PROJECT_DIR
+ echo -e "Compiler used to build binaries is"
+ which ${CROSS_COMPILE}gcc
+ ${CROSS_COMPILE}gcc --version
+ echo -e "Arch is \e[36m$ARCH\e[39m"
+ THREADS=$(grep processor /proc/cpuinfo -c)
+ make $DEFCONFIG
+ make -j $THREADS 2>&1 | tee $KERNEL_BUILD_LOG_FILE_NAME
+ KERNEL_SIZE=$(ls -la arch/arm/boot/zImage | awk '{print $5}')
+ echo "Kernel size is ${KERNEL_SIZE} bytes"
+ if [ $KERNEL_SIZE -ge $MAX_KERNEL_SIZE_B ];
+ then
+ echo "❌ Kernel exceeds the max size of ${MAX_KERNEL_SIZE_B}, failing CI pipeline";
+ exit 1
+ fi
+ artifacts:
+ when: always
+ name: "$CI_COMMIT_REF_NAME"
+ paths:
+ - $KERNEL_BUILD_LOG_FILE_NAME
+ - kernel-config