Skip to content

Commit c7c3fab

Browse files
Jicquellambourg
authored andcommitted
Split build and test in two gitlab runners
Change-Id: Icedc906716a1520b5b363e0643a901005dea889f
1 parent c6360de commit c7c3fab

File tree

1 file changed

+38
-5
lines changed

1 file changed

+38
-5
lines changed

.gitlab-ci.yml

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,60 @@ variables:
88
HOST: x86_64-linux
99

1010
stages:
11+
- build
1112
- test
1213

13-
build_and_test:
14+
build:
1415
services:
1516
- image:sandbox
1617
- cpu:8
1718
- mem:16
18-
stage: test
19+
stage: build
1920
script:
2021
- anod vcs --add-repo gnatcoll-core $CI_PROJECT_DIR
2122
- anod build --latest gnatcoll-core-doc
2223
- anod build --latest gnatcoll-core
23-
- anod test --latest gnatcoll-core -Qexternal
24-
# TODO: replace build space by something computed
24+
25+
- echo "packaging $ANOD_DEFAULT_SANDBOX_DIR/$HOST/gnatcoll-core-current/install/" ;
26+
- tar czf $CI_PROJECT_DIR/$pkg.tar.gz -C $ANOD_DEFAULT_SANDBOX_DIR/$HOST/gnatcoll-core-current/ install/ ;
27+
- cd $CI_PROJECT_DIR
28+
- ls -l *.tar.gz
29+
30+
artifacts:
31+
paths:
32+
- gnatcoll-core-current.tar.gz
33+
34+
test:
35+
services:
36+
- image:sandbox
37+
- cpu:8
38+
- mem:16
39+
stage: test
40+
allow_failure: true
41+
script:
42+
# unpack the packages
43+
- cd $ANOD_DEFAULT_SANDBOX_DIR
44+
- mkdir -p $HOST/gnatcoll-core-current
45+
- tar zxf $CI_PROJECT_DIR/gnatcoll-core-current.tar.gz -C $HOST/gnatcoll-core-current
46+
- rm -f $CI_PROJECT_DIR/*.tar.gz
47+
48+
- anod vcs --add-repo gnatcoll-core $CI_PROJECT_DIR
49+
50+
- anod test --latest gnatcoll-core
2551
- e3-testsuite-report
2652
--failure-exit-code 1
2753
--xunit-output $CI_PROJECT_DIR/test.xml
2854
--xunit-name gnatcoll-core
2955
$ANOD_DEFAULT_SANDBOX_DIR/$HOST/gnatcoll-core-current-test/results/new/ || exit 1
30-
interruptible: true
56+
57+
# We previously prevented the pipeline from halting if a test failed, to make
58+
# sure all tests were run. If a test failed now we exit with a non-zero code
59+
- if [ ! -z ${FAILED+x} ]; then echo "There was at least one testcase failure" && exit 1; fi
60+
needs:
61+
- job: build
3162
artifacts:
63+
when:
64+
always
3265
paths:
3366
- test.xml
3467
reports:

0 commit comments

Comments
 (0)