-
Notifications
You must be signed in to change notification settings - Fork 26
/
.appveyor.yml
375 lines (315 loc) · 15.4 KB
/
.appveyor.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
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
version: 1.0.{build}
branches:
only:
- master
environment:
global:
APPVEYOR_SAVE_CACHE_ON_ERROR: true
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma -mx=4
APPVEYOR_RDP_PASSWORD: PL4YMUM3!
matrix:
- ARCH: x64
COMPILER: GCC
- ARCH: arm64
COMPILER: GCC
- ARCH: x64
COMPILER: MinGW
QTDIR: C:\Qt\5.15\mingw81_64
- ARCH: x64
COMPILER: MSVC
QTDIR: C:\Qt\5.15\msvc2019_64
- ARCH: x64
COMPILER: Clang
image:
# AppVeyor builds are ordered by the image list:
- Visual Studio 2019
- macos-monterey
- Ubuntu1804
- Ubuntu2004
- Previous Ubuntu2004
- Visual Studio 2022
matrix:
exclude:
# Exclude invalid options
- image: Visual Studio 2022
COMPILER: Clang
- image: Visual Studio 2022
COMPILER: GCC
- image: Visual Studio 2022
COMPILER: MinGW
- image: Visual Studio 2019
COMPILER: Clang
- image: Visual Studio 2019
COMPILER: GCC
- image: Visual Studio 2019
COMPILER: MSVC
- image: Ubuntu1804
COMPILER: MinGW
- image: Ubuntu1804
COMPILER: MSVC
- image: Ubuntu2004
COMPILER: MinGW
- image: Ubuntu2004
COMPILER: MSVC
- image: Previous Ubuntu2004
COMPILER: MinGW
- image: Previous Ubuntu2004
COMPILER: MSVC
- image: macos-monterey
COMPILER: GCC
- image: macos-monterey
COMPILER: MinGW
- image: macos-monterey
COMPILER: MSVC
# Following builds are disabled to prevent build timeouts
- image: Ubuntu1804
COMPILER: Clang
- image: Ubuntu2004
COMPILER: Clang
- image: Previous Ubuntu2004
COMPILER: Clang
- image: Ubuntu2004
ARCH: arm64
- image: Previous Ubuntu2004
ARCH: arm64
- image: Visual Studio 2022
COMPILER: MSVC
# x64 .deb is either Ubuntu or Debian stable
- image: Ubuntu2004
ARCH: x64
# Following builds are not supported by AppImage
- image: Ubuntu1804
ARCH: arm64
for:
# Ubuntu (AppImage)
-
matrix:
only:
- image: Ubuntu1804
clone_folder: ~/mmapper
init:
- sh: echo _NPROCESSORS_ONLN=$(getconf _NPROCESSORS_ONLN)
install:
- ps: $env:package_version = ("$(git describe --tags --always --long)").trim()
- ps: Update-AppveyorBuild -Version "$env:package_version-$env:APPVEYOR_BUILD_NUMBER"
build_script:
# Build MMapper within a Docker container using the current working path as a volume
- sh: sudo docker run --rm -v "$(pwd)":/root/mmapper --cap-add SYS_ADMIN --cap-add MKNOD --device /dev/fuse:mrw --security-opt apparmor:unconfined ubuntu:18.04 bash -c 'apt update -qq && apt install -y wget software-properties-common && add-apt-repository ppa:ecal/cmake-3.25 && add-apt-repository ppa:beineri/opt-qt-5.15.2-bionic -y && apt install -y qt515base libgl1-mesa-dev build-essential git zlib1g-dev libssl-dev wget zsync fuse cmake libminiupnpc-dev && source /opt/qt*/bin/qt*-env.sh && cd /root/mmapper && mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_UNITY_BUILD=ON -DCMAKE_INSTALL_PREFIX=/usr && make -j$(getconf _NPROCESSORS_ONLN) DESTDIR=appdir install && QT_QPA_PLATFORM=offscreen ctest -V --no-compress-output -T test && export VERSION=$(grep -i "SET(CPACK_PACKAGE_VERSION " CPackConfig.cmake | cut -d\" -f 2) && wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage && chmod a+x linuxdeployqt-continuous-x86_64.AppImage && ./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/org.mume.MMapper.desktop -updateinformation="gh-releases-zsync|MUME|MMapper|latest|MMapper-*-x86_64.AppImage.zsync" -appimage'
- sh: sudo mv build/*.AppImage* .
- sh: export FILE=$(find . -type f -name MMapper*.AppImage | sed 's#./##')
- sh: sha256sum $FILE > $FILE.sha256
test_script:
# Transform test results from ctest to junit format
- ps: $XSLInputElement = New-Object System.Xml.Xsl.XslCompiledTransform
- ps: $XSLInputElement.Load("https://raw.githubusercontent.com/rpavlik/jenkins-ctest-plugin/master/ctest-to-junit.xsl")
- ps: $XSLInputElement.Transform((Resolve-Path .\build\Testing\*\Test.xml), (Join-Path (Resolve-Path .) "ctest-to-junit-results.xml"))
- ps: $wc = New-Object 'System.Net.WebClient'
- ps: $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\ctest-to-junit-results.xml))
artifacts:
- path: MMapper-*.AppImage
name: MMapper AppImage Package
- path: MMapper-*.AppImage.sha256
name: MMapper Checksums
- path: MMapper-*.AppImage.zsync
name: MMapper AppImage Updateable
# Ubuntu
-
matrix:
only:
- image: Ubuntu2004
clone_folder: ~/mmapper
init:
- sh: echo _NPROCESSORS_ONLN=$(getconf _NPROCESSORS_ONLN)
- sh: if [[ $ARCH == x64 ]]; then export TARGET_ARCHITECTURE=amd64 ; fi
- sh: if [[ $ARCH == arm64 ]]; then export TARGET_ARCHITECTURE=arm64 ; fi
- sh: echo TARGET_ARCHITECTURE=$TARGET_ARCHITECTURE
install:
- ps: $env:package_version = ("$(git describe --tags --always --long)").trim()
- ps: Update-AppveyorBuild -Version "$env:package_version-$env:APPVEYOR_BUILD_NUMBER"
- sh: sudo apt update -qq
- sh: sudo apt install -y build-essential git qt5-qmake libqt5opengl5-dev zlib1g-dev libssl-dev cmake ninja-build libminiupnpc-dev
build_script:
- sh: mkdir build
- sh: cd build
- sh: cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTARGET_ARCHITECTURE=$TARGET_ARCHITECTURE -DUSE_UNITY_BUILD=ON
- sh: cmake --build . -j$(getconf _NPROCESSORS_ONLN)
- sh: cpack
- sh: mv *.deb* ../
test_script:
- sh: QT_QPA_PLATFORM=offscreen ctest -V --no-compress-output -T test
# Transform test results from ctest to junit format
- ps: $XSLInputElement = New-Object System.Xml.Xsl.XslCompiledTransform
- ps: $XSLInputElement.Load("https://raw.githubusercontent.com/rpavlik/jenkins-ctest-plugin/master/ctest-to-junit.xsl")
- ps: $XSLInputElement.Transform((Resolve-Path .\Testing\*\Test.xml), (Join-Path (Resolve-Path .) "ctest-to-junit-results.xml"))
- ps: $wc = New-Object 'System.Net.WebClient'
- ps: $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\ctest-to-junit-results.xml))
artifacts:
- path: mmapper-*-Linux-*.deb
name: MMapper Debian Package
- path: mmapper-*-Linux-*.*.sha256
name: MMapper Checksums
# Ubuntu (Debian)
-
matrix:
only:
- image: Previous Ubuntu2004
clone_folder: ~/mmapper
services:
- docker
init:
- sh: echo _NPROCESSORS_ONLN=$(getconf _NPROCESSORS_ONLN)
- sh: if [[ $ARCH == x64 ]]; then export DOCKER_IMAGE=multiarch/debian-debootstrap:amd64-bullseye ; fi
- sh: if [[ $ARCH == x64 ]]; then export TARGET_ARCHITECTURE=amd64 ; fi
- sh: if [[ $ARCH == arm64 ]]; then export DOCKER_IMAGE=multiarch/debian-debootstrap:arm64-bullseye ; fi
- sh: if [[ $ARCH == arm64 ]]; then export TARGET_ARCHITECTURE=arm64 ; fi
- sh: echo TARGET_ARCHITECTURE=$TARGET_ARCHITECTURE
- sh: echo DOCKER_IMAGE=$DOCKER_IMAGE
install:
- ps: $env:package_version = ("$(git describe --tags --always --long)").trim()
- ps: Update-AppveyorBuild -Version "$env:package_version-$env:APPVEYOR_BUILD_NUMBER"
# Enable an execution of different multi-architecture containers by QEMU
# https://hub.docker.com/r/multiarch/qemu-user-static/
- sh: docker run --rm --privileged multiarch/qemu-user-static:register --reset
build_script:
# Build MMapper within a Docker container using the current working path as a volume
- sh: docker run --rm -v "$(pwd)":/root/mmapper $DOCKER_IMAGE bash -c "apt update -qq && apt install -y build-essential git qt5-qmake libqt5opengl5-dev zlib1g-dev libssl-dev cmake ninja-build libminiupnpc-dev && cd /root/mmapper && mkdir -p build && cd build && cmake .. -G \"Ninja\" -DTARGET_ARCHITECTURE=$TARGET_ARCHITECTURE && cmake --build . && QT_QPA_PLATFORM=offscreen ctest -V --no-compress-output -T test && cpack"
- sh: sudo mv build/*.deb* .
test_script:
# Transform test results from ctest to junit format
- ps: $XSLInputElement = New-Object System.Xml.Xsl.XslCompiledTransform
- ps: $XSLInputElement.Load("https://raw.githubusercontent.com/rpavlik/jenkins-ctest-plugin/master/ctest-to-junit.xsl")
- ps: $XSLInputElement.Transform((Resolve-Path .\build\Testing\*\Test.xml), (Join-Path (Resolve-Path .) "ctest-to-junit-results.xml"))
- ps: $wc = New-Object 'System.Net.WebClient'
- ps: $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\ctest-to-junit-results.xml))
artifacts:
- path: mmapper-*-Linux-*.deb
name: MMapper Debian Package
- path: mmapper-*-Linux-*.*.sha256
name: MMapper Checksums
# Windows (MSVC)
-
matrix:
only:
- image: Visual Studio 2022
clone_folder: c:\Build\MMapper
init:
- cmd: if %COMPILER%==MSVC if %ARCH%==x64 call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
- cmd: if %COMPILER%==MSVC set CMAKE_GENERATOR="NMake Makefiles"
- cmd: if %ARCH%==x64 set OPENSSLDIR=C:\OpenSSL-v111-Win64
- cmd: git config --global core.autocrlf input
- cmd: echo NUMBER_OF_PROCESSORS=%NUMBER_OF_PROCESSORS%
- cmd: echo PROCESSOR_IDENTIFIER=%PROCESSOR_IDENTIFIER%
- cmd: echo QTDIR=%QTDIR%
- cmd: echo CMAKE_GENERATOR=%CMAKE_GENERATOR%
# Rename the OpenSSL 1.02 directory so CMake can't find it
- cmd: if exist "C:\OpenSSL-Win32" move C:\OpenSSL-Win32 C:\OpenSSL-v102-Win32
- cmd: if exist "C:\OpenSSL-Win64" move C:\OpenSSL-Win64 C:\OpenSSL-v102-Win64
install:
- ps: $env:package_version = ("$(git describe --tags --always --long)").trim()
- ps: Update-AppveyorBuild -Version "$env:package_version-$env:APPVEYOR_BUILD_NUMBER"
before_build:
- cmd: set PATH=%QTDIR%\bin;%PATH%;C:\Qt\Tools\QtCreator\bin
- cmd: echo PATH=%PATH%
build_script:
- cmd: cd c:\Build\MMapper
- cmd: md winbuild
- cmd: cd winbuild
- cmd: cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -G %CMAKE_GENERATOR% "-DCMAKE_PREFIX_PATH=%QTDIR%" "-DOPENSSL_ROOT_DIR=%OPENSSLDIR%" -DUSE_UNITY_BUILD=ON
- cmd: cmake --build . -j %NUMBER_OF_PROCESSORS%
- cmd: cpack
- ps: move *.exe* ../
test_script:
- cmd: ctest -V --no-compress-output -T Test
# Transform test results from ctest to junit format
- ps: $XSLInputElement = New-Object System.Xml.Xsl.XslCompiledTransform
- ps: $XSLInputElement.Load("https://raw.githubusercontent.com/rpavlik/jenkins-ctest-plugin/master/ctest-to-junit.xsl")
- ps: $XSLInputElement.Transform((Resolve-Path .\Testing\*\Test.xml), (Join-Path (Resolve-Path .) "ctest-to-junit-results.xml"))
- ps: $wc = New-Object 'System.Net.WebClient'
- ps: $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\ctest-to-junit-results.xml))
artifacts:
- path: mmapper-*-Windows-*.exe
name: MMapper Installer
- path: mmapper-*-Windows-*.*.sha256
name: MMapper Checksums
# Windows (MinGW)
-
matrix:
only:
- image: Visual Studio 2019
clone_folder: c:\Build\MMapper
init:
- cmd: if %COMPILER%==MinGW set CMAKE_GENERATOR="MinGW Makefiles"
- cmd: if %ARCH%==x64 set OPENSSLDIR=C:\OpenSSL-v111-Win64
- cmd: git config --global core.autocrlf input
- cmd: echo NUMBER_OF_PROCESSORS=%NUMBER_OF_PROCESSORS%
- cmd: echo PROCESSOR_IDENTIFIER=%PROCESSOR_IDENTIFIER%
- cmd: echo QTDIR=%QTDIR%
- cmd: echo CMAKE_GENERATOR=%CMAKE_GENERATOR%
# Rename the OpenSSL 1.02 directory so CMake can't find it
- cmd: if exist "C:\OpenSSL-Win32" move C:\OpenSSL-Win32 C:\OpenSSL-v102-Win32
- cmd: if exist "C:\OpenSSL-Win64" move C:\OpenSSL-Win64 C:\OpenSSL-v102-Win64
install:
- ps: $env:package_version = ("$(git describe --tags --always --long)").trim()
- ps: Update-AppveyorBuild -Version "$env:package_version-$env:APPVEYOR_BUILD_NUMBER"
before_build:
- cmd: if %COMPILER%==MinGW if %ARCH%==x64 set PATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH%
- cmd: set PATH=%QTDIR%\bin;%PATH%;C:\Qt\Tools\QtCreator\bin
- cmd: if %COMPILER%==MinGW set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
- cmd: echo PATH=%PATH%
build_script:
- cmd: cd c:\Build\MMapper
- cmd: md winbuild
- cmd: cd winbuild
- cmd: cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -G %CMAKE_GENERATOR% "-DCMAKE_PREFIX_PATH=%QTDIR%" "-DOPENSSL_ROOT_DIR=%OPENSSLDIR%" -DUSE_UNITY_BUILD=ON
- cmd: cmake --build . -j %NUMBER_OF_PROCESSORS%
- cmd: cpack
- ps: move *.exe* ../
test_script:
- cmd: ctest -V --no-compress-output -T test
# Transform test results from ctest to junit format
- ps: $XSLInputElement = New-Object System.Xml.Xsl.XslCompiledTransform
- ps: $XSLInputElement.Load("https://raw.githubusercontent.com/rpavlik/jenkins-ctest-plugin/master/ctest-to-junit.xsl")
- ps: $XSLInputElement.Transform((Resolve-Path .\Testing\*\Test.xml), (Join-Path (Resolve-Path .) "ctest-to-junit-results.xml"))
- ps: $wc = New-Object 'System.Net.WebClient'
- ps: $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\ctest-to-junit-results.xml))
artifacts:
- path: mmapper-*-Windows-*.exe
name: MMapper Installer
- path: mmapper-*-Windows-*.*.sha256
name: MMapper Checksums
on_failure:
# Change false to true to block build and investigate build failures
- ps: $blockRdp = $false; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# Mac
-
matrix:
only:
- image: macos-monterey
clone_folder: ~/mmapper
init:
- sh: echo _NPROCESSORS_ONLN=$(getconf _NPROCESSORS_ONLN)
install:
- ps: $env:package_version = ("$(git describe --tags --always --long)").trim()
- ps: Update-AppveyorBuild -Version "$env:package_version-$env:APPVEYOR_BUILD_NUMBER"
- brew install [email protected] qt5 miniupnpc
- export PATH=/usr/local/opt/qt@5/bin:$PATH
build_script:
- mkdir build
- cd build
- cmake .. -DCMAKE_PREFIX_PATH=/usr/local/opt/qt@5/bin -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl\@1.1 -DCPACK_PACKAGE_DIRECTORY=~/package
- make -j$(getconf _NPROCESSORS_ONLN)
- cpack
- mv ~/package/*.dmg* ../
test_script:
- ctest -V --no-compress-output -T test
# Transform test results from ctest to junit format
- ps: $XSLInputElement = New-Object System.Xml.Xsl.XslCompiledTransform
- ps: $XSLInputElement.Load("https://raw.githubusercontent.com/rpavlik/jenkins-ctest-plugin/master/ctest-to-junit.xsl")
- ps: $XSLInputElement.Transform((Resolve-Path .\Testing\*\Test.xml), (Join-Path (Resolve-Path .) "ctest-to-junit-results.xml"))
- ps: $wc = New-Object 'System.Net.WebClient'
- ps: $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\ctest-to-junit-results.xml))
artifacts:
- path: mmapper-*-Mac-*.dmg
name: MMapper Mac Package
- path: mmapper-*-Mac-*.*.sha256
name: MMapper Checksums