@@ -9,18 +9,34 @@ stages:
9
9
# Build and test with ANOD
10
10
# TODO: add a build and test based on Alire in parallel to this.
11
11
build_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'
12
16
services :
13
17
- image:sandbox
14
18
- cpu:8
15
19
- mem:16
16
20
stage : build_and_test
21
+ interruptible : true
17
22
script :
18
23
- . ~/.aws_container_credentials
19
24
- export PATH=/it/e3/bin:$PATH
20
25
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
+
21
37
# Setup the 'anod vcs' for this repo
22
38
- 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
24
40
25
41
# Figure out if we're on a sync branch
26
42
- BRANCH=master
@@ -32,29 +48,32 @@ build_and_test:
32
48
33
49
# Setup the 'anod vcs' for the other repos, if we're on
34
50
# 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 ..." ;
37
53
cd /tmp ;
38
54
git clone $GIT_CLONE_BASE/eng/ide/$subproject ;
39
55
cd $subproject ;
40
56
if `git show-ref $BRANCH > /dev/null` ; then
57
+ echo "... checking out $BRANCH"
41
58
git checkout $BRANCH ;
42
59
cd /it/wave ;
43
60
anod vcs --add-repo $subproject /tmp/$subproject ;
61
+ else
62
+ echo "... checking out $TARGET_BRANCH"
63
+ git checkout $TARGET_BRANCH ;
44
64
fi ;
45
65
done ;
46
- fi
47
66
48
67
# Build & test using anod
49
68
- 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
52
71
53
72
# Process the report
54
73
- e3-testsuite-report
55
74
--failure-exit-code 1
56
75
--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
58
77
59
78
- if [ ! -z ${FAILED+x} ]; then echo "There was at least one testcase failure" && exit 1; fi
60
79
0 commit comments