@@ -9,18 +9,34 @@ stages:
99# Build and test with ANOD
1010# TODO: add a build and test based on Alire in parallel to this.
1111build_and_test :
12+ rules :
13+ # Let's do the job only for merge request events: that's
14+ # when we know whether the target branch is 'edge'.
15+ - if : $CI_PIPELINE_SOURCE == 'merge_request_event'
1216 services :
1317 - image:sandbox
1418 - cpu:8
1519 - mem:16
1620 stage : build_and_test
21+ interruptible : true
1722 script :
1823 - . ~/.aws_container_credentials
1924 - export PATH=/it/e3/bin:$PATH
2025
26+ # Check whether we're in an MR targeting 'edge' and setup some
27+ # variables if so.
28+ - TARGET_BRANCH="master"
29+ - if [ "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" = "edge" ]; then
30+ echo "Targeting the edge branch." ;
31+ REPO_SUFFIX="-edge" ;
32+ BUILD_SPACE_SUFFIX="_edge" ;
33+ QUALIFIER="edge" ;
34+ TARGET_BRANCH="edge" ;
35+ fi
36+
2137 # Setup the 'anod vcs' for this repo
2238 - cd /it/wave
23- - anod vcs --add-repo ada_language_server $CI_PROJECT_DIR
39+ - anod vcs --add-repo ada_language_server${REPO_SUFFIX} $CI_PROJECT_DIR
2440
2541 # Figure out if we're on a sync branch
2642 - BRANCH=master
@@ -32,29 +48,32 @@ build_and_test:
3248
3349 # Setup the 'anod vcs' for the other repos, if we're on
3450 # a "sync" branch.
35- - if [ $BRANCH != master ]; then
36- for subproject in vss spawn gnatdoc ; do
51+ - for subproject in vss spawn gnatdoc ; do
52+ echo "for subproject $subproject ..." ;
3753 cd /tmp ;
3854 git clone $GIT_CLONE_BASE/eng/ide/$subproject ;
3955 cd $subproject ;
4056 if `git show-ref $BRANCH > /dev/null` ; then
57+ echo "... checking out $BRANCH"
4158 git checkout $BRANCH ;
4259 cd /it/wave ;
4360 anod vcs --add-repo $subproject /tmp/$subproject ;
61+ else
62+ echo "... checking out $TARGET_BRANCH"
63+ git checkout $TARGET_BRANCH ;
4464 fi ;
4565 done ;
46- fi
4766
4867 # Build & test using anod
4968 - cd /it/wave
50- - anod build als --minimal
51- - anod test als --minimal
69+ - anod build als --qualifier=$QUALIFIER -- minimal
70+ - anod test als --qualifier=$QUALIFIER --minimal
5271
5372 # Process the report
5473 - e3-testsuite-report
5574 --failure-exit-code 1
5675 --xunit-output $CI_PROJECT_DIR/xunit_output.xml
57- x86_64-linux/als-test/results/new/ || FAILED=true
76+ x86_64-linux/als${BUILD_SPACE_SUFFIX} -test/results/new/ || FAILED=true
5877
5978 - if [ ! -z ${FAILED+x} ]; then echo "There was at least one testcase failure" && exit 1; fi
6079
0 commit comments