summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-03-07 13:31:09 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2022-04-06 12:02:17 +0100
commit354e174f63d5ebfddff84cb17096da4bb9a15ec1 (patch)
tree5aff9a6390e91e7f0ee16838a387bcbd77bd1fbc
parentfbaee70d380973f71fa6e9e15be746532e5a4fc5 (diff)
downloadhaskell-354e174f63d5ebfddff84cb17096da4bb9a15ec1.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 f255d675b5..fed71764a1 100755
--- a/.gitlab/ci.sh
+++ b/.gitlab/ci.sh
@@ -406,6 +406,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"
@@ -444,12 +445,28 @@ function determine_metric_baseline() {
info "Using $PERF_BASELINE_COMMIT for performance metric baseline..."
}
+# 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
run "$MAKE" V=0 VERBOSE=1 test \
THREADS="$cores" \
@@ -462,6 +479,8 @@ function build_hadrian() {
fail "BIN_DIST_NAME not set"
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
@@ -476,6 +495,8 @@ function test_hadrian() {
return
fi
+ check_release_build
+
# Ensure that statically-linked builds are actually static
if [[ "${BUILD_FLAVOUR}" = *static* ]]; then
bad_execs=""