-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
111 lines (100 loc) · 2.36 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
image: mfila/open62541:1.1.1-fat
stages:
- format
- build
- deploy
- release
- lint
cmake-check:
stage: format
allow_failure: true
script:
- cmake-format --version
- cmake-format -i $(find . -name "*.cmake")
- cmake-format -i $(find . -name "CMakeLists.txt")
- git diff --exit-code
clang-check:
stage: format
allow_failure: true
script:
- clang-format --version
- clang-format -i $(find COREdcs -name "*.cpp")
- clang-format -i $(find COREdcs -name "*.h")
- clang-format -i $(find ELITPCdcs -name "*.cpp")
- clang-format -i $(find ELITPCdcs -name "*.h")
- git diff --exit-code
build_debug:
stage: build
script:
- cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-coverage" -DCMAKE_EXE_LINKER_FLAGS="-coverage"
- cmake --build build
except:
- tags
export_commands:
stage: build
script:
- rm -rf build
- cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_CXX_COMPILER=clang++
artifacts:
paths:
- build
staging_ssh:
stage: deploy
tags:
- ssh
environment: daq-$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME
script:
- bash scripts/gitlab/deploy-staging.sh
dependencies: []
package:
stage: build
tags:
- ssh
script:
- cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/opt/soft/$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME-install
- cmake --build build --target package
dependencies: []
artifacts:
name: $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME-package
paths:
- build/*.deb
only:
- tags
release:
stage: release
before_script:
- apt-get -qq update && apt-get -qq install -y curl
- cmake -S . -Bbuild
script:
- bash scripts/gitlab/make-release.sh
- bash scripts/gitlab/release-assets.sh
dependencies: []
only:
- /^v[0-9]+(?:.[0-9]+)+$/
lint_clang_tidy:
stage: lint
allow_failure: true
dependencies:
- export_commands
script:
- cd build
- run-clang-tidy
when: manual
lint_iwyu:
stage: lint
allow_failure: true
dependencies:
- export_commands
script:
- cd build
- iwyu_tool.py -p .
when: manual
lint_cppcheck:
allow_failure: true
stage: lint
dependencies:
- export_commands
script:
- cd build
- cppcheck --error-exitcode=1 -i $PWD/../deps -i $PWD/../test ..
when: manual