From 68c1a0ff9e01f1b8446b9ff6c322014bc6d1a945 Mon Sep 17 00:00:00 2001 From: Haaris Farooq Date: Tue, 6 Aug 2024 12:00:21 +0100 Subject: [PATCH] ci: Build products in parallel in pipelines Currently, within the deployment and daily pipeline, products are build sequentially instead of in parallel which is slow. This patch adds building all products in parallel within the pipelines. In the deployment pipeline, all products are built with default log level and in the daily pipeline all products are built with all log levels (all in parallel). Signed-off-by: Haaris Farooq --- .gitlab/pipelines/daily-pipeline.yml | 4 ++-- .gitlab/pipelines/deployment-pipeline.yml | 2 +- .gitlab/templates/build-test.yml | 29 ++++++++++++++++------- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.gitlab/pipelines/daily-pipeline.yml b/.gitlab/pipelines/daily-pipeline.yml index 641a0675b..c2ad2fd74 100644 --- a/.gitlab/pipelines/daily-pipeline.yml +++ b/.gitlab/pipelines/daily-pipeline.yml @@ -44,8 +44,8 @@ check-ut: stage: unit-testing allow_failure: true -build-products-all-log-levels: - extends: .build-products-all-log-levels +build-products-all-products-all-log-levels: + extends: .build-products-all-products-all-log-levels stage: build allow_failure: true diff --git a/.gitlab/pipelines/deployment-pipeline.yml b/.gitlab/pipelines/deployment-pipeline.yml index 812f3b63b..87dc8b214 100644 --- a/.gitlab/pipelines/deployment-pipeline.yml +++ b/.gitlab/pipelines/deployment-pipeline.yml @@ -101,7 +101,7 @@ check-ut: build-products: extends: - - .build-products + - .build-products-all-products - .git-strategy-on-mr stage: build dependencies: diff --git a/.gitlab/templates/build-test.yml b/.gitlab/templates/build-test.yml index 60d9a6daf..ad82ba1fb 100644 --- a/.gitlab/templates/build-test.yml +++ b/.gitlab/templates/build-test.yml @@ -17,27 +17,38 @@ else export LOG_LEVEL="--log-level=$BUILD_PRODUCTS_LOG_LEVEL" fi + if [ -z $BUILD-PRODUCT ]; then + export PRODUCT="" + else + export PRODUCT="-p $BUILD_PRODUCT" + fi script: - | python3 tools/check_build.py --build-output-dir ./build \ - ${LOG_LEVEL} + ${LOG_LEVEL} ${PRODUCT} artifacts: when: on_failure expire_in: 2 days paths: - build/*.txt -.build-products-all-log-levels: +.build-products-all-products: + extends: .build-products + parallel: + matrix: + - BUILD_PRODUCT: + [host, juno, morello, n1sdp, rcar, rdfremont, rdv1, rdv1mc, rdn1e1, rdn2, + sgi575, sgm775, sgm776, synquacer, tc2] + +.build-products-all-products-all-log-levels: extends: .build-products parallel: matrix: - - BUILD_PRODUCTS_LOG_LEVEL: - - DEBUG - - INFO - - WARN - - ERROR - - CRIT - - DISABLED + - BUILD_PRODUCT: + [host, juno, morello, n1sdp, rcar, rdfremont, rdv1, rdv1mc, rdn1e1, rdn2, + sgi575, sgm775, sgm776, synquacer, tc2] + BUILD_PRODUCTS_LOG_LEVEL: + [DEBUG, INFO, WARN, ERROR, CRIT, DISABLED] .build-optee: image: ${CI_REGISTRY_IMAGE}/optee-build:latest