Skip to content

Commit 2c5f2e7

Browse files
committed
Make CI use edge for every commit into something/edge branch.
This should fix CI builds for additional commits into `edge` MR. GitLab considers only the very first pipeline for MR as "merge request pipelines". Any other commits doesn't have "merge request pipelines" variables such as `CI_MERGE_REQUEST_TARGET_BRANCH_NAME`, so CI uses master branch for getting dependencies.
1 parent e5071da commit 2c5f2e7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.gitlab-ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ build_and_test:
1919
- . ~/.aws_container_credentials
2020
- export PATH=/it/e3/bin:$PATH
2121

22-
# Check whether we're in an MR targeting 'edge' and setup some
23-
# variables if so.
22+
# Check whether we're in an MR targeting 'edge' or commiting to
23+
# `something/edge` branch then setup some variables.
2424
- TARGET_BRANCH="master"
25-
- if [ "x$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" = "xedge" ]; then
25+
- if [[ "x$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" = "xedge" ||
26+
"$CI_COMMIT_BRANCH" =~ .*/edge ]];
27+
then
2628
echo "Targeting the edge branch." ;
2729
REPO_SUFFIX="-edge" ;
2830
BUILD_SPACE_SUFFIX="_edge" ;
@@ -83,7 +85,8 @@ build_and_test:
8385
export GPR_PROJECT_PATH=/it/wave/x86_64-linux/als/src/subprojects/gnatdoc/gnat:$GPR_PROJECT_PATH;
8486
export GPR_PROJECT_PATH=/it/wave/x86_64-linux/als/src/subprojects/VSS/gnat:$GPR_PROJECT_PATH;
8587
cd /it/wave/x86_64-linux/als/src;
86-
lsif-ada gnat/lsp_server.gpr > $CI_PROJECT_DIR/dump.lsif )
88+
lsif-ada gnat/lsp_server.gpr > $CI_PROJECT_DIR/dump.lsif ||
89+
touch $CI_PROJECT_DIR/dump.lsif )
8790

8891
- if [ ! -z ${FAILED+x} ]; then echo "There was at least one testcase failure" && exit 1; fi
8992

0 commit comments

Comments
 (0)