summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-03-07 13:31:09 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-03-24 17:13:58 -0400
commit1756d54763d123cb8eabdc8fb95b3ece8c10a6d4 (patch)
treebf4a8a8be5b32d6bc775897e88a6646f80b38d4e
parenta2937e2b2cadc72b78641c321398cf6b7e7a485c (diff)
downloadhaskell-1756d54763d123cb8eabdc8fb95b3ece8c10a6d4.tar.gz
Add check to ensure we are not building validate jobs for releases
-rwxr-xr-x.gitlab/ci.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh
index 2ba27cba8d..d1a7d75eb1 100755
--- a/.gitlab/ci.sh
+++ b/.gitlab/ci.sh
@@ -427,6 +427,7 @@ function configure() {
}
function build_make() {
+ check_release_build
prepare_build_mk
if [[ -z "$BIN_DIST_PREP_TAR_COMP" ]]; then
fail "BIN_DIST_PREP_TAR_COMP is not set"
@@ -467,12 +468,28 @@ function determine_metric_baseline() {
fi
}
+# If RELEASE_JOB = yes then we skip builds with a validate flavour.
+# This has the effect of
+# (1) Skipping validate jobs when trying to do release builds
+# (2) Ensured we don't accidentally build release builds with validate flavour.
+#
+# We should never try to build a validate build in a release pipeline so this is
+# very defensive in case we have made a mistake somewhere.
+function check_release_build() {
+ if [ -z "${RELEASE_JOB:-}" ] && [["${BUILD_FLAVOUR:-}" == *"validate"* ]]then
+ info "Exiting build because this is a validate build in a release job"
+ exit 0;
+ fi
+}
+
function test_make() {
if [ -n "${CROSS_TARGET:-}" ]; then
info "Can't test cross-compiled build."
return
fi
+ check_release_build
+
run "$MAKE" test_bindist TEST_PREP=YES
(unset $(compgen -v | grep CI_*);
run "$MAKE" V=0 VERBOSE=1 test \
@@ -489,6 +506,8 @@ function build_hadrian() {
fail "BIN_DIST_PREP_TAR_COMP must not be set for hadrian (you mean BIN_DIST_NAME)"
fi
+ check_release_build
+
# N.B. First build Hadrian, unsetting MACOSX_DEPLOYMENT_TARGET which may warn
# if the bootstrap libraries were built with a different version expectation.
MACOSX_DEPLOYMENT_TARGET="" run_hadrian stage1:exe:ghc-bin
@@ -508,6 +527,8 @@ function test_hadrian() {
return
fi
+ check_release_build
+
# Ensure that statically-linked builds are actually static
if [[ "${BUILD_FLAVOUR}" = *static* ]]; then
bad_execs=""