-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
38 lines (36 loc) · 1.74 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# This GitLab file is meant to be a test for the template repo itself.
# You should replace it with your own workflow file for your project.
variables:
GIT_SUBMODULE_STRATEGY: recursive
CMAKE_ARGS: -DTEMPLATE_PROJECT_BUILD_DEMOS=1 -DTEMPLATE_PROJECT_BUILD_TESTS=1 -DTEMPLATE_PROJECT_USE_BUILD_TIMESTAMPS=1 -DTEMPLATE_PROJECT_DO_TEMPLATE_COMPONENT_TEST=1 -DTEMPLATE_PROJECT_CI_GIT_BRANCH_NAME="$CI_COMMIT_REF_NAME"
build-linux:
stage: build
parallel:
matrix:
- COMPILER: [gcc-11, gcc-12, gcc-13, clang-11.0.1, clang-12, clang-13, clang-14, clang-15, clang-16, clang-17]
TYPE: [exe, static, shared]
variables:
CONFIGS: '{ "exe": "platform_config.exe.cmake", "static": "platform_config.static.cmake", "shared": "platform_config.shared.cmake" }'
image: $CI_REGISTRY/idi/dockerfiles/cmake-cpp:$COMPILER
rules:
- if: $CI_PIPELINE_SOURCE != "merge_request_event" && (($COMPILER =~ /(gcc-14|clang-14)$/)) # clang-14 image has a bug with libc++13
allow_failure: true
- if: $CI_PIPELINE_SOURCE != "merge_request_event" # Only on push events (same as 'except: merge_requests')
before_script:
- apt-get update && apt-get install -y -qq jq
- git config --global credential.helper store
- echo "https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}" > ~/.git-credentials
script:
- cmake --version && $CC --version && $CXX --version
- mkdir -p build && cd build
- cmake .. $CMAKE_ARGS -DIDICMAKE_PLATFORM_CONFIG=../$(echo $CONFIGS | jq -r .$TYPE)
- cmake --build . -j 8
- ctest -C Debug --output-junit ctest.xml
interruptible: true
artifacts:
when: always
name: "idi-cpp-template-$TYPE-$COMPILER-$CI_COMMIT_SHORT_SHA"
paths:
- build/ctest.xml
reports:
junit: build/ctest.xml