-
Notifications
You must be signed in to change notification settings - Fork 4
341 lines (285 loc) · 10.6 KB
/
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
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
336
337
338
339
340
341
name: CI
on: [push]
jobs:
windows:
runs-on: windows-latest
strategy:
matrix:
qt-version: ["6.5.3"]
compiler: ["msvc2019_64"]
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt-version }}
host: "windows"
arch: "win64_${{ matrix.compiler }}"
tools: "tools_opensslv3_x64"
cache: "true"
modules: "qtimageformats qtmultimedia qtpdf qt5compat"
- name: Install Dependencies with Chocolatey
uses: crazy-max/ghaction-chocolatey@v3
with:
args: "install nasm curl"
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Setup Sentry CLI
uses: mathieu-bour/[email protected]
with:
token: ${{ SECRETS.SENTRY_TOKEN }}
organization: rophil
project: gm-companion
- name: Install cget
run: pip install cget
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Setup build directory
run: mkdir build
- name: Cache cget dependencies
id: cache-cget
uses: actions/cache@v3
with:
path: build/cget
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('requirements.windows.txt') }}-cget-${{ matrix.qt-version }}-${{ matrix.compiler }}
- name: Init cget
run: cd build && cget init --shared
- name: Install dependencies from requirements.txt
if: steps.cache-cget.outputs.cache-hit != 'true'
run: |
cd build
cget install --release -f ../requirements.windows.txt -DCMAKE_BUILD_PARALLEL_LEVEL=2 -DBUILD_TESTING=OFF
- name: Make
run: |
cd build
cmake .. -D CMAKE_INSTALL_PREFIX=install -D CMAKE_BUILD_TYPE=RelWithDebInfo -DIS_RUNNING_IN_CI=ON -DCMAKE_UNITY_BUILD=ON
cmake --build . --config RelWithDebInfo --parallel 2
- name: Tests
run: |
cd build
cp ..\..\Qt\Tools\OpenSSLv3\Win_x64\bin\*.dll .\bin\RelWithDebInfo\
cp .\cget\**\*.dll .\bin\RelWithDebInfo\
ls bin
ls bin\RelWithDebInfo
ctest -C RelWithDebInfo --verbose
- name: Upload debug symbols
run: |
cd build
sentry-cli upload-dif --org rophil --project gm-companion --include-sources ./
- name: Make Install
run: |
cd build
cmake --install . --config RelWithDebInfo
- name: Install CQtDeployer
run: |
curl -L -o .\cqtdeployer-installer.exe https://github.com/QuasarApp/CQtDeployer/releases/download/v1.6.2323/CQtDeployer_1.6.2323.dd027b2_Windows_AMD64.exe
.\cqtdeployer-installer.exe install -c --al -t ${{ github.workspace }}\cqtdeployer
- name: Download librespot
run: curl -L -o .\build\install\bin\librespot.exe https://github.com/PhilInTheGaps/librespot-bin/releases/download/v0.4.2/librespot-x86_64.exe
- name: Copy OpenSSL DLLs to install folder
run: cp ..\Qt\Tools\OpenSSLv3\Win_x64\bin\*.dll .\build\install\bin
- name: Deploy
run: ${{ github.workspace }}\cqtdeployer\1.6\CQtDeployer.exe -bin build\install\bin\gm-companion.exe,build\install\bin\librespot.exe -libDir build\cget\bin,build\cget\lib -qmlDir app\ui -targetDir build\install\bin -enablePlugins multimedia
- name: Remove debug and test info from install folder
run: |
rm .\build\install\gmock*
rm .\build\install\gtest*
rm .\build\install\**\*.pdb
- name: Upload Build
uses: actions/upload-artifact@v3
with:
name: gm-companion_${{ runner.os }}
path: .\build\install\bin
if-no-files-found: error
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
# timeout-minutes: 20
# with:
# limit-access-to-actor: true
ubuntu:
runs-on: ubuntu-22.04
strategy:
matrix:
qt-version: ["6.5.3"]
compiler: ["gcc_64"]
env:
QT_QPA_PLATFORM: "offscreen"
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: "recursive"
- uses: kenchan0130/actions-system-info@master
id: system-info
- name: Install Dependencies
run: |
sudo add-apt-repository universe
sudo apt-get update -q
sudo apt-get upgrade -q
sudo apt install -qq mesa-common-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libjpeg-turbo8-dev libtiff-dev libnss3-dev libopenjp2-7-dev libboost-dev libcairo2-dev libcurl4-openssl-dev python3-setuptools patchelf libasound2-dev libsecret-1-dev gnome-keyring dbus-x11 libxcb-cursor0 libfuse2
- name: Unlock Keyring
uses: t1m0thyj/unlock-keyring@v1
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt-version }}
host: "linux"
arch: "${{ matrix.compiler }}"
target: "desktop"
cache: "true"
modules: "qtimageformats qtmultimedia qtpdf qt5compat"
- name: Setup Sentry CLI
uses: mathieu-bour/[email protected]
with:
token: ${{ SECRETS.SENTRY_TOKEN }}
organization: rophil
project: gm-companion
- name: Install cget
run: sudo pip3 install wheel cget
- name: Setup build directory
run: mkdir build
- name: Cache cget dependencies
id: cache-cget
uses: actions/cache@v3
with:
path: build/cget
key: ${{ runner.os }}-${{ steps.system-info.outputs.release }}-${{ runner.arch }}-${{ hashFiles('requirements.ubuntu.txt') }}-cget-${{ matrix.qt-version }}
- name: Build cget dependencies
if: steps.cache-cget.outputs.cache-hit != 'true'
run: |
cd build
cget init --shared
cget install --release -f ../requirements.ubuntu.txt -DCMAKE_BUILD_PARALLEL_LEVEL=2 -DBUILD_TESTING=OFF
- name: CMake
run: |
cd build
cmake .. -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_INSTALL_PREFIX=AppDir/usr -DIS_RUNNING_IN_CI=ON -DCMAKE_UNITY_BUILD=ON
- name: Linter (QML)
run: |
cd build
cmake --build . --target=all_qmllint -j2
- name: Make
run: |
cd build
cmake --build . -j2
- name: Tests
run: |
cd build
ctest --output-on-failure
- name: Make Install
run: |
cd build
cmake --install .
- name: Strip and upload debug symbols
run: |
cd build
../deploy/debug/generate-debug-info.sh AppDir/usr/bin/gm-companion
sentry-cli upload-dif --org rophil --project gm-companion --include-sources AppDir/usr/bin/.debug/
rm -rf AppDir/usr/bin/.debug
- name: Install rust and build librespot
uses: moonrepo/setup-rust@v1
with:
bins: librespot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build AppImage
run: |
cd build
cp ~/.cargo/bin/librespot AppDir/usr/bin/librespot
bash ../deploy/appimage/build-appimage.sh
ls
- name: Upload Build
uses: actions/upload-artifact@v3
with:
name: gm-companion_x86_64.AppImage
path: build/GM-Companion-x86_64.AppImage
if-no-files-found: error
static-analysis:
runs-on: ubuntu-22.04
strategy:
matrix:
qt-version: ["6.5.3"]
compiler: ["gcc_64"]
env:
QT_QPA_PLATFORM: "offscreen"
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: 0
- uses: kenchan0130/actions-system-info@master
id: system-info
- name: Install Dependencies
run: |
sudo apt-get update -q
sudo apt-get upgrade -q
sudo apt install -qq mesa-common-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libjpeg-turbo8-dev libtiff-dev libnss3-dev libopenjp2-7-dev libboost-dev libcairo2-dev libcurl4-openssl-dev python3-setuptools patchelf libasound2-dev libsecret-1-dev gnome-keyring dbus-x11 libxcb-cursor0
sudo pip3 install gcovr
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- name: Unlock Keyring
uses: t1m0thyj/unlock-keyring@v1
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.qt-version }}
host: "linux"
arch: "${{ matrix.compiler }}"
target: "desktop"
cache: "true"
modules: "qtimageformats qtmultimedia qtpdf qt5compat"
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v1
- name: Install cget
run: sudo pip3 install wheel cget
- name: Setup build directory
run: mkdir build
- name: Cache cget dependencies
id: cache-cget
uses: actions/cache@v3
with:
path: build/cget
key: ${{ runner.os }}-${{ steps.system-info.outputs.release }}-${{ runner.arch }}-${{ hashFiles('requirements.ubuntu.txt') }}-cget-${{ matrix.qt-version }}
- name: Build cget dependencies
if: steps.cache-cget.outputs.cache-hit != 'true'
run: |
cd build
cget init --shared
cget install --release -f ../requirements.ubuntu.txt -DCMAKE_BUILD_PARALLEL_LEVEL=2 -DBUILD_TESTING=OFF
- name: Run build-wrapper
run: |
cd build
cmake .. -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=AppDir/usr -DIS_RUNNING_IN_CI=ON -DENABLE_CODE_COVERAGE=ON
build-wrapper-linux-x86-64 --out-dir bw-output cmake --build . -j2
- name: Tests
run: |
cd build
ctest --output-on-failure
- name: Generate GCOV Report
run: |
cd build
gcovr --keep --print-summary
- name: Cache sonar analysis
id: cache-sonar-analysis
uses: actions/cache@v3
with:
path: sonar-cache
key: ${{ runner.os }}-SonarAnalysis
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: sonar-scanner