summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-04-10 10:38:55 +1200
committerCommit Bot <commit-bot@chromium.org>2021-04-16 22:58:51 +0000
commitd441a4f976cccb12a17c812cc19aac15a6e41aa8 (patch)
tree09706c35e0c940e330afcfa4490b18810c824910
parenta2b75b36ebfeaf5f344e03e1c0ee0b77c11e82de (diff)
downloadchrome-ec-d441a4f976cccb12a17c812cc19aac15a6e41aa8.tar.gz
gitlab: Use a template to make it easier to add more boards
It is a pain to repeat the build steps, so use a template instead. BUG=b:178731498 BRANCH=none TEST=try on gitlab Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I2515627af230182e0e663f5d2ab6d7b3a77d3d2c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2817960 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r--.gitlab-ci.yml33
1 files changed, 19 insertions, 14 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2462b1bc4f..f52bb4d529 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -41,24 +41,29 @@ before_script:
- export ZEPHYR_DIR=/zephyr
- export PATH="$PATH:$HOME/.local/bin"
-volteer:
+# Users of this template must set:
+# $PROJECT to the project to build in zephyr/projects. E.g. "lazor")
+# $PROJECT_SUBDIR if it is in a subdirectory. E.g. "trogdor/"
+.build_template: &build_template
+ stage: build
script:
- zmake --zephyr-base "${ZEPHYR_BASE}" --modules-dir "${MODULES_DIR}"
- -l DEBUG configure -b -B "${BUILD_DIR}/volteer" -t zephyr
- zephyr/projects/volteer/volteer
- - ls "${BUILD_DIR}/volteer" "${BUILD_DIR}/volteer/output"
+ -l DEBUG configure -b -B "${BUILD_DIR}/${PROJECT}" -t zephyr
+ zephyr/projects/${PROJECT_SUBDIR}${PROJECT}
+ - ls "${BUILD_DIR}/${PROJECT}" "${BUILD_DIR}/${PROJECT}/output"
artifacts:
paths:
- - build/volteer/output/*
+ - build/${PROJECT}/output/*
expire_in: 1 week
lazor:
- script:
- - zmake --zephyr-base "${ZEPHYR_BASE}" --modules-dir "${MODULES_DIR}"
- -l DEBUG configure -b -B "${BUILD_DIR}/lazor" -t zephyr
- zephyr/projects/trogdor/lazor
- - ls "${BUILD_DIR}/lazor" "${BUILD_DIR}/lazor/output"
- artifacts:
- paths:
- - build/lazor/output/*
- expire_in: 1 week
+ variables:
+ PROJECT: "lazor"
+ PROJECT_SUBDIR: "trogdor/"
+ <<: *build_template
+
+volteer:
+ variables:
+ PROJECT: "volteer"
+ PROJECT_SUBDIR: "volteer/"
+ <<: *build_template