-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
198 lines (184 loc) · 5.1 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# use the official gcc image, based on debian
image: gcc
stages:
- build
- test
- coverage
- analyze
- deploy
build-mac:
stage: build
tags:
- mac
script:
- echo "Building CADventory on Mac `hostname` at `pwd`"
- echo "PATH=$PATH"
- mkdir .build
- cd .build
- rm -rf *
- echo "compilation artifact from project:$CI_PROJECT_PATH, branch:$CI_COMMIT_BRANCH, job_url:$CI_JOB_URL" > artifact.txt
- /opt/homebrew/bin/cmake -DCMAKE_PREFIX_PATH=/opt/homebrew/Cellar/qt/6.6.2_1 -DCMAKE_INSTALL_PREFIX=install -DCMAKE_OSX_ARCHITECTURES=arm64 ..
- make -j3 VERBOSE=1
- make install
- find .
artifacts:
paths:
- .build/artifact.txt
- .build/install
build-linux:
stage: build
tags:
- linux
script:
- echo "Building CADventory on Linux `hostname` at `pwd`"
- echo "PATH=$PATH"
- apt update && apt -y install cmake
- apt -y install qt6-base-dev sqlite3
- mkdir .build
- cd .build
- rm -rf *
- echo "compilation artifact from project:$CI_PROJECT_PATH, branch:$CI_COMMIT_BRANCH, job_url:$CI_JOB_URL" > artifact.txt
- find ..
- cmake -DCMAKE_INSTALL_PREFIX=install ..
- make -j3 VERBOSE=1
- make install
- find .
artifacts:
paths:
- .build # save the whole shebang so we can run ctest and more later
expire_in: 24 hours
build-windows:
stage: build
tags:
- windows
script:
- echo "Building CADventory on Windows $Env:COMPUTERNAME at $Env:PWD"
- echo "PATH=$Env:PATH"
- New-Item -ItemType Directory -Force -Path .build
- Remove-Item -Recurse -Path .build
- New-Item -ItemType Directory -Force -Path .build
- cd .build
- echo "compilation artifact from project:$CI_PROJECT_PATH, branch:$CI_COMMIT_BRANCH, job_url:$CI_JOB_URL" > artifact.txt
- '& "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools\\VsDevCmd.bat"'
- cmake -DCMAKE_PREFIX_PATH=C:\\Qt\\6.8.0\\msvc2019_arm64\\lib\\cmake -G "Visual Studio 17 2022" -DCMAKE_INSTALL_PREFIX=install -A arm64 ..
- cmake --build . --config Release -- /m:3
- cmake --build . --config Release --target install
artifacts:
paths:
- .build\\install
expire_in: 1 hour
test-mac:
stage: test
tags:
- mac
dependencies:
- build-mac
script:
- echo "Testing CADventory on Mac `hostname` at `pwd`"
- ls -la
- find .
- file .build/install/bin/cadventory
- .build/install/bin/cadventory --no-gui
- cd .build && /opt/homebrew/bin/ctest --verbose
artifacts:
paths:
- .build/install
test-linux:
stage: test
tags:
- linux
dependencies:
- build-linux
script:
- echo "Testing CADventory on Linux `hostname` at `pwd`"
- apt update && apt -y install qt6-base-dev sqlite3 cmake
- ls -la
- find .
- find / -name libQt6Widgets.so.6
- file .build/cadventory
- export QT_QPA_PLATFORM=offscreen
- .build/install/bin/cadventory --no-gui
- cd .build && ctest --verbose
artifacts:
paths:
- .build # needs full tree for coverage and analysis
test-windows:
stage: test
tags:
- windows
dependencies:
- build-windows
script:
- echo "Testing CADventory on Windows $Env:COMPUTERNAME at $Env:PWD"
- dir
- cd .build
- $Env:QT_QPA_PLATFORM = "offscreen"
- .\\install\\bin\\cadventory.exe --no-gui
artifacts:
paths:
- .build\\install\\cadventory.exe
coverage-linux:
stage: coverage
tags:
- linux
dependencies:
- test-linux
script:
- echo "Coverage testing CADventory on Linux `hostname` at `pwd`"
- apt-get update && apt-get install -y qt6-base-dev sqlite3 cmake lcov
- cd .build
- cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="--coverage" ..
- make clean && make -j2
- export QT_QPA_PLATFORM=offscreen
- ./cadventory --no-gui
- ctest
- lcov --directory . --capture --output-file coverage.info
- lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system libraries
- lcov --remove coverage.info '*catch*' --output-file coverage.info # filter out Catch2
- lcov --list coverage.info | tee coverage.txt # display and save a copy
- lcov --summary coverage.info
artifacts:
paths:
- .build/coverage.txt
- .build/coverage.info
expire_in: 1 week
allow_failure: true
analyze-linux:
stage: analyze
tags:
- linux
dependencies:
- test-linux
script:
- apt-get update && apt-get install -y qt6-base-dev sqlite3 cmake clang-tools
- cd .build
- cmake --build . --target clean
- scan-build make
allow_failure: true
deploy-mac:
stage: deploy
tags:
- mac
dependencies:
- test-mac
script:
- echo "Deploying CADventory on Mac `hostname` at `pwd`"
environment: production
deploy-linux:
stage: deploy
tags:
- linux
dependencies:
- test-linux
script:
- echo "Deploying CADventory on Linux `hostname` at `pwd`"
environment: production
deploy-windows:
stage: deploy
tags:
- windows
dependencies:
- test-windows
script:
- echo "Deploying CADventory on Windows $Env:COMPUTERNAME at $Env:PWD"
environment: production