- !reference [.debian-build-template,before_script]
- printf "\e[0Ksection_end:$(date +%s):before_script\r\e[0K\n"
script:
- # let git-rebase run the build for each commit
+ # let git-rebase run the build for each commit, but not fail with
+ # commit subject starts with "WIP" (gitlab also uses this string
+ # to switch a PR back to draft, mitigating the risk to push a
+ # failing commit)
- git rebase --rebase-merges $CI_MERGE_REQUEST_DIFF_BASE_SHA
--exec 'devscripts/gitlab-ci-runbuild.sh cargo build ${FEATURES} ${CARGO_FLAGS}'
# trace, but not outside of collapsed section
set -x
-"$@"
+IGNORED_ERROR=0
+if ! "$@"; then
+ ret=$?;
+ case "$(git show --summary --format=format:%s)" in
+ WIP*)
+ IGNORED_ERROR=1
+ ;;
+ *)
+ exit $ret
+ ;;
+ esac
+fi
# stop traces before closing collapsed section
set +x
# collapsable footer
printf "\e[0Ksection_end:$(date +%s):${FOOTER_ID}\r\e[0K\n"
+
+# make any ignored error visible outside of collapsed section
+[ $IGNORED_ERROR = 0 ] || printf "\e[1;31mIgnoring failure for WIP commit\e[1;0m\n"