Skip to content

Commit aa86864

Browse files
committed
Refactor the gitlab CI
Compute test path with the `anod info` command instead of hardcoding it and remove unused variables.
1 parent 2d0d920 commit aa86864

File tree

1 file changed

+13
-23
lines changed

1 file changed

+13
-23
lines changed

.gitlab-ci.yml

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -180,23 +180,20 @@ build_and_test_x86_linux:
180180
extends: .job_template
181181
stage: build
182182
script:
183-
- anod vcs --add-repo gnatcoll-core $CI_PROJECT_DIR
184-
- anod build --latest gnatcoll-core $BUILD_ARGS
185-
- anod test --latest gnatcoll-core $TEST_ARGS
186-
- e3-testsuite-report
187-
--failure-exit-code 1
188-
--xunit-output $CI_PROJECT_DIR/test.xml
189-
--xunit-name gnatcoll-core
190-
$ANOD_DEFAULT_SANDBOX_DIR/$HOST/$TEST_DIR/results/new/ || FAILED=true
191-
192-
# We previously prevented the pipeline from halting if a test failed, to make
193-
# sure all tests were run. If a test failed now we exit with a non-zero code
194-
- if [ "$FAILED" = "true" ]; then echo "There was at least one testcase failure" && exit 1; fi
183+
- anod vcs --add-repo gnatcoll-core $CI_PROJECT_DIR
184+
- anod build --latest gnatcoll-core $BUILD_ARGS
185+
- anod test --latest gnatcoll-core $TEST_ARGS
186+
- working_dir=$(anod info test gnatcoll-core --show working_dir $TEST_ARGS)
187+
- results_dir=$working_dir/results/new
188+
- e3-testsuite-report --failure-exit-code 1 --xunit-output $CI_PROJECT_DIR/test.xml --xunit-name gnatcoll-core $results_dir || FAILED=true
189+
190+
# We previously prevented the pipeline from halting if a test failed, to make
191+
# sure all tests were run. If a test failed now we exit with a non-zero code
192+
- if [ "$FAILED" = "true" ]; then echo "There was at least one testcase failure" && exit 1; fi
195193
artifacts:
196-
when:
197-
always
194+
when: always
198195
paths:
199-
- test.xml
196+
- test.xml
200197
reports:
201198
junit: test.xml
202199

@@ -205,26 +202,19 @@ build_and_test_x86_64_linux:
205202
variables:
206203
BUILD_ARGS: ""
207204
TEST_ARGS: -Qexternal
208-
TEST_DIR: gnatcoll-core_external_test
209-
FATAL_ERRORS: true
210205

211206
build_and_test_x86_64_linux_llvm:
212207
extends: .build_and_test_x86_64_linux_template
213-
allow_failure: true
214208
variables:
215209
BUILD_ARGS: -Qcompiler=gnat-llvm
216210
TEST_ARGS: -Qcompiler=gnat-llvm
217-
TEST_DIR: gnatcoll-core_gnat-llvm_test
218-
FATAL_ERRORS: false
219211

220212
build_and_test_x86_64_linux_valgrind:
221213
extends: .build_and_test_x86_64_linux_template
222-
allow_failure: true
214+
allow_failure: true # To remove once all tests pass
223215
variables:
224216
BUILD_ARGS: ""
225217
TEST_ARGS: -Qvalgrind
226-
TEST_DIR: gnatcoll-core_valgrind_test
227-
FATAL_ERRORS: false # TODO: set to True once all the leaks have been fixed
228218

229219
build_and_test_coverage:
230220
extends: .job_template

0 commit comments

Comments
 (0)