-
Notifications
You must be signed in to change notification settings - Fork 253
335 lines (280 loc) · 9.43 KB
/
build.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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
name: CANdevStudio
on: [push, pull_request]
env:
MAIN_BRANCH: 'refs/heads/master'
jobs:
Linux-Release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: jurplel/install-qt-action@v2
- uses: MarkusJx/install-boost@v1.0.1
id: install-boost
with:
boost_version: 1.73.0
- run: sudo apt install libxcb-xinerama0
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: cmake .. -DCMAKE_BUILD_TYPE=Release
env:
CXX: clang++
CC: clang
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Build
working-directory: ${{github.workspace}}/build
run: make -j3
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure
env:
QT_QPA_PLATFORM: offscreen
- name: Create packages
if: startsWith(github.ref, 'refs/heads/')
working-directory: ${{github.workspace}}/build
run: |
cpack -G DEB
cmake . -DSTANDALONE=ON
cpack -G TXZ
mkdir ../master
mv *.deb *.tar.xz ../master
- name: Get Package Names
if: startsWith(github.ref, 'refs/heads/')
id: package_names
working-directory: ${{github.workspace}}/master
run: |
NORMAL=`ls *.deb`
NORMAL_ZIP=${NORMAL%.deb}
echo "::set-output name=NORMAL::$NORMAL"
echo "::set-output name=NORMAL_ZIP::$NORMAL_ZIP"
STANDALONE=`ls *.tar.xz`
STANDALONE_ZIP=${STANDALONE%.tar.xz}
echo "::set-output name=STANDALONE::$STANDALONE"
echo "::set-output name=STANDALONE_ZIP::$STANDALONE_ZIP"
- name: Upload Normal Package
if: startsWith(github.ref, 'refs/heads/')
uses: actions/upload-artifact@v2
with:
name: ${{steps.package_names.outputs.NORMAL_ZIP}}
path: master/${{steps.package_names.outputs.NORMAL}}
retention-days: 90
- name: Upload Standalone Package
if: startsWith(github.ref, 'refs/heads/')
uses: actions/upload-artifact@v2
with:
name: ${{steps.package_names.outputs.STANDALONE_ZIP}}
path: master/${{steps.package_names.outputs.STANDALONE}}
retention-days: 90
- name: Create RC packages
if: startsWith(github.ref, 'refs/tags/')
working-directory: ${{github.workspace}}/build
run: |
cmake . -DDEV_BUILD=OFF
cpack -G TXZ
cmake . -DSTANDALONE=ON
cpack -G DEB
mkdir ../rc
mv *.deb *.tar.xz ../rc
- name: Upload RC packages
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v2
with:
name: rc
path: rc/*
retention-days: 90
Linux-Debug:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: jurplel/install-qt-action@v2
- uses: MarkusJx/install-boost@v1.0.1
id: install-boost
with:
boost_version: 1.73.0
- run: sudo apt install -y lcov
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DWITH_COVERAGE=ON -DWITH_TOOLS=ON
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Build
working-directory: ${{github.workspace}}/build
run: make -j3
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure
env:
QT_QPA_PLATFORM: offscreen
- name: Generate Doxygen
if: ${{ github.ref == env.MAIN_BRANCH && github.event_name != 'pull_request' }}
uses: mattnotmitt/doxygen-action@v1
with:
doxyfile-path: 'Doxyfile'
- name: Deploy Doxygen
if: ${{ github.ref == env.MAIN_BRANCH && github.event_name != 'pull_request' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./html
- name: Generate and Test Templates
working-directory: ${{github.workspace}}/build
env:
QT_QPA_PLATFORM: offscreen
run: |
./tools/templategen/templategen -n WithGUI -o ../src/components
./tools/templategen/templategen -n NoGUI -o ../src/components -g
cmake .
make -j3
make test
rm -rf ../src/components/NoGUI ../src/components/WithGUI
- name: Code Coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
macOS-Release:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- run: brew install cmake boost qt5
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$(brew --prefix qt5)/lib/cmake"
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Build
working-directory: ${{github.workspace}}/build
run: make -j4
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure
env:
QT_QPA_PLATFORM: offscreen
- name: Create packages
if: startsWith(github.ref, 'refs/heads/')
working-directory: ${{github.workspace}}/build
run: |
cpack -G DragNDrop
mkdir ../master
mv *.dmg ../master
- name: Get Package Names
if: startsWith(github.ref, 'refs/heads/')
id: package_names
working-directory: ${{github.workspace}}/master
run: |
NORMAL=`ls *.dmg`
NORMAL_ZIP=${NORMAL%.dmg}
echo "::set-output name=NORMAL::$NORMAL"
echo "::set-output name=NORMAL_ZIP::$NORMAL_ZIP"
- name: Upload Normal Package
if: startsWith(github.ref, 'refs/heads/')
uses: actions/upload-artifact@v2
with:
name: ${{steps.package_names.outputs.NORMAL_ZIP}}
path: master/${{steps.package_names.outputs.NORMAL}}
retention-days: 90
- name: Create RC packages
if: startsWith(github.ref, 'refs/tags/')
working-directory: ${{github.workspace}}/build
run: |
cmake . -DDEV_BUILD=OFF
cpack -G DragNDrop
mkdir ../rc
mv *.dmg ../rc
- name: Upload RC packages
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v2
with:
name: rc
path: rc/*
retention-days: 90
Windows-Release:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: jurplel/install-qt-action@v2
- uses: MarkusJx/install-boost@v1.0.1
id: install-boost
with:
boost_version: 1.73.0
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: cmake .. -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 16 2019" -A x64
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config Release -- /m
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C Release --output-on-failure
env:
QT_QPA_PLATFORM: offscreen
- name: Create Packages
if: startsWith(github.ref, 'refs/heads/')
working-directory: ${{github.workspace}}/build
run: |
cpack -G 7Z
cmake . -DSTANDALONE=ON
cpack -G 7Z
mkdir ..\master
move *.7z ..\master
- name: Get Package Names
if: startsWith(github.ref, 'refs/heads/')
id: package_names
shell: bash
working-directory: ${{github.workspace}}/master
run: |
NORMAL=`ls *Windows.7z`
NORMAL_ZIP=${NORMAL%.7z}
echo "::set-output name=NORMAL::$NORMAL"
echo "::set-output name=NORMAL_ZIP::$NORMAL_ZIP"
STANDALONE=`ls *Windows-standalone.7z`
STANDALONE_ZIP=${STANDALONE%.7z}
echo "::set-output name=STANDALONE::$STANDALONE"
echo "::set-output name=STANDALONE_ZIP::$STANDALONE_ZIP"
- name: Upload Normal Package
if: startsWith(github.ref, 'refs/heads/')
uses: actions/upload-artifact@v2
with:
name: ${{steps.package_names.outputs.NORMAL_ZIP}}
path: master\${{steps.package_names.outputs.NORMAL}}
retention-days: 90
- name: Upload Standalone Package
if: startsWith(github.ref, 'refs/heads/')
uses: actions/upload-artifact@v2
with:
name: ${{steps.package_names.outputs.STANDALONE_ZIP}}
path: master\${{steps.package_names.outputs.STANDALONE}}
retention-days: 90
- name: Create RC Packages
if: startsWith(github.ref, 'refs/tags/')
working-directory: ${{github.workspace}}/build
run: |
cmake . -DDEV_BUILD=OFF
cpack -G 7Z
cmake . -DSTANDALONE=ON
cpack -G 7Z
mkdir ..\rc
move *.7z ..\rc
- name: Upload RC packages
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v2
with:
name: rc
path: rc\*
retention-days: 90