2020-07-17 18:42:14 +00:00
|
|
|
##########################################################################
|
|
|
|
# This will allow the job to run whenever code events trigger it.
|
|
|
|
##########################################################################
|
|
|
|
.only_code:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- branches
|
|
|
|
- merge_requests
|
|
|
|
- pushes
|
|
|
|
except:
|
|
|
|
- schedules
|
|
|
|
|
|
|
|
##########################################################################
|
2022-12-17 00:56:43 +00:00
|
|
|
# Define a template for all the unit tests, since each one is run in a separate
|
2020-07-17 18:42:14 +00:00
|
|
|
# job to make the display nicer.
|
|
|
|
##########################################################################
|
|
|
|
.unit_test:
|
|
|
|
stage: test
|
|
|
|
when: on_success
|
|
|
|
# We define this using a before script because GitLab cannot merge variable
|
|
|
|
# definitions across inheritance (so the variables block from this would disappear)
|
|
|
|
before_script:
|
|
|
|
- export BOOST_TEST_LOGGER='JUNIT,all,test_results.${TEST}.xml:HRF,warning'
|
|
|
|
- export CTEST_OUTPUT_ON_FAILURE=1
|
|
|
|
script:
|
|
|
|
- cd build/linux/qa
|
2021-04-09 11:39:11 +00:00
|
|
|
- ctest -R qa_${TEST}
|
2020-07-17 18:42:14 +00:00
|
|
|
# GitLab supports displaying the results in the GUI through JUNIT artifacts
|
|
|
|
# (https://docs.gitlab.com/ee/ci/junit_test_reports.html)
|
|
|
|
# so we upload the JUNIT results. Note that there is a bug with how paths
|
2023-05-17 10:23:00 +00:00
|
|
|
# are processed in the junit report (https://gitlab.com/gitlab-org/gitlab/-/issues/23835)
|
2020-07-17 18:42:14 +00:00
|
|
|
# so we can't use a glob and have to list out each hierarchy separately.
|
|
|
|
artifacts:
|
|
|
|
reports:
|
|
|
|
junit:
|
|
|
|
- build/linux/qa/*/*.xml
|
|
|
|
- build/linux/qa/*/*/*.xml
|