-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
90 lines (86 loc) · 3.78 KB
/
.gitlab-ci.yml
File metadata and controls
90 lines (86 loc) · 3.78 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# 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, gcc-14, gcc-15, clang-11.0.1, clang-12, clang-13, clang-14, clang-15, clang-16, clang-17, clang-18, clang-19, clang-20, clang-21]
TYPE: [exe, static, shared]
image: $CI_REGISTRY/idi/dockerfiles/cmake-cpp:$COMPILER
rules:
- if: $CI_PIPELINE_SOURCE != "merge_request_event" && (($COMPILER =~ /(gcc-16|clang-14|clang-21)$/)) # 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: # This is required for pulling dependencies on projects
#- git config --global credential.helper store # done in cmake-cpp image
- 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=../platform-config.$TYPE.cmake
- cmake --build . -j 8
- ctest -C Debug --output-on-failure --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
build-windows:
stage: build
tags: [windows, beefy]
parallel:
matrix:
- TYPE: [exe, static, shared]
image: $CI_REGISTRY/idi/dockerfiles/cmake-cpp
rules:
- if: $CI_PIPELINE_SOURCE != "merge_request_event" # Only on push events (same as 'except: merge_requests')
before_script: # This is required for pulling dependencies on projects
#- git config --system credential.helper manager # done in cmake-cpp image
- cmdkey /generic:git:https://${env:CI_SERVER_HOST} /user:gitlab-ci-token /pass:${env:CI_JOB_TOKEN}
script:
- cmake --version
- mkdir -p build
- cd build
- cmake .. $CMAKE_ARGS -DIDICMAKE_PLATFORM_CONFIG="../platform-config.$TYPE.cmake"
- cmake --build . -j 8
- ctest -C Debug --output-on-failure --output-junit ctest.xml
interruptible: true
artifacts:
when: always
name: "idi-cpp-template-$TYPE-win64-$CI_COMMIT_SHORT_SHA"
paths:
- build/ctest.xml
reports:
junit: build/ctest.xml
.coverage: # Remove '.' to enable
stage: deploy
tags: [general, beefy]
image: $CI_REGISTRY/idi/dockerfiles/cmake-cpp:gcc-14
rules:
- if: $CI_PIPELINE_SOURCE != "merge_request_event" # Only on push events (same as 'except: merge_requests')
when: manual
- if: $CI_PIPELINE_SOURCE = "merge_request_event" # Only on merge requests
- if: $CI_COMMIT_TAG # Only on tag push event
before_script: # This is required for pulling dependencies on projects
#- git config --global credential.helper store # done in cmake-cpp image
- echo "https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}" > ~/.git-credentials
script:
- cmake --version && $CC --version && $CXX --version && lcov --version && gcovr --version
- mkdir -p build && cd build
- cmake .. $CMAKE_ARGS -DCODE_COVERAGE=ON
- cmake --build . --target ccov-all-xml
interruptible: true
artifacts:
name: "idi-cpp-template-coverage-$CI_COMMIT_SHORT_SHA"
paths:
- build/reports/coverage/coverage.xml
reports:
coverage_report:
coverage_format: cobertura
path: build/reports/coverage/coverage.xml