forked from zeromq/libzmq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
304 lines (289 loc) · 12.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
version: build-{build}
shallow_clone: true
os: Visual Studio 2013
environment:
CMAKE_GENERATOR: "Visual Studio 12 2013"
MSVCVERSION: "v120"
MSVCYEAR: "vs2013"
ENABLE_DRAFTS: ON
matrix:
- platform: Win32
configuration: Release
WITH_LIBSODIUM: OFF # unavailable build files for VS2008
ENABLE_CURVE: ON
CMAKE_GENERATOR: "Visual Studio 9 2008"
MSVCVERSION: "v90"
MSVCYEAR: "vs2008"
ARTIFACT_NAME: v90
- platform: Win32
configuration: Release
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
CMAKE_GENERATOR: "Visual Studio 10 2010"
MSVCVERSION: "v100"
MSVCYEAR: "vs2010"
ARTIFACT_NAME: v100
- platform: Win32
configuration: Release
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
ARTIFACT_NAME: v120
- platform: x64
configuration: Release
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
ARTIFACT_NAME: v120-x64
- platform: Win32
configuration: Release
POLLER: epoll
API_POLLER: poll
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
TEST_OPTIONS: '-E "(test_many_sockets)"'
ARTIFACT_NAME: v120-epoll
- platform: Win32
configuration: Debug
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
TEST_OPTIONS: '-E "(test_many_sockets)"'
ARTIFACT_NAME: v120-gd
- platform: x64
configuration: Debug
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
TEST_OPTIONS: '-E "(test_many_sockets)"'
ARTIFACT_NAME: v120-gd-x64
- platform: Win32
configuration: Release
WITH_LIBSODIUM: OFF
ENABLE_CURVE: OFF
ENABLE_DRAFTS: OFF
ARTIFACT_NAME: v120-nocurve
- platform: Win32
configuration: Release
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
CMAKE_GENERATOR: "Visual Studio 14 2015"
MSVCVERSION: "v140"
MSVCYEAR: "vs2015"
ARTIFACT_NAME: v140
- platform: x64
configuration: Release
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
CMAKE_GENERATOR: "Visual Studio 14 2015"
MSVCVERSION: "v140"
MSVCYEAR: "vs2015"
ARTIFACT_NAME: v140-x64
- platform: Win32
configuration: Release
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CMAKE_GENERATOR: "Visual Studio 15 2017"
MSVCVERSION: "v141"
MSVCYEAR: "vs2017"
TEST_OPTIONS: '-E "(test_many_sockets)"'
ARTIFACT_NAME: v141
- platform: x64
configuration: Release
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CMAKE_GENERATOR: "Visual Studio 15 2017"
MSVCVERSION: "v141"
MSVCYEAR: "vs2017"
TEST_OPTIONS: '-E "(test_many_sockets)"'
ARTIFACT_NAME: v141-x64
- platform: cygwin64
WITH_LIBSODIUM: OFF
ENABLE_CURVE: ON
CMAKE_GENERATOR: "Unix Makefiles"
ARTIFACT_NAME: cygwin64
- platform: mingw64
WITH_LIBSODIUM: OFF
ENABLE_CURVE: ON
CMAKE_GENERATOR: "MSYS Makefiles"
ARTIFACT_NAME: mingw64
matrix:
fast_finish: false
allow_failures:
- platform: cygwin64 # TODO allow failures until tests are fixed
- platform: mingw64 # TODO allow failures until tests are fixed
init:
- cmd: if "%NO_PR%"=="TRUE" (
if "%APPVEYOR_PULL_REQUEST_NUMBER%" NEQ "" (
echo "Build is disabled for PRs, aborting" &&
appveyor exit
)
)
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- cmake --version
- msbuild /version
- cmd: reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication /t REG_DWORD /d 0 /f
cache:
- C:\projects\libsodium
- C:\cygwin64\var\cache\setup
install:
- cmd: if "%Platform%"=="cygwin64" C:\cygwin64\setup-x86_64.exe --quiet-mode --no-shortcuts --upgrade-also --packages cmake,cygwin-devel,gcc-g++,libncurses-devel,make,pkg-config
- cmd: if "%Platform%"=="cygwin64" set PATH=C:\cygwin64\bin;%PATH%
- cmd: if "%Platform%"=="mingw64" C:\msys64\usr\bin\bash -lc "pacman -Qg"
- cmd: if "%Platform%"=="mingw64" set PATH=C:\msys64\usr\bin;%PATH%
- cmd: if "%Platform%"=="x64" set "CMAKE_GENERATOR=%CMAKE_GENERATOR% Win64"
- cmd: echo "Generator='%CMAKE_GENERATOR%'"
- cmd: echo "Platform='%Platform%'"
- cmd: if "%WITH_LIBSODIUM%"=="ON" set LIBSODIUMDIR=C:\projects\libsodium
- cmd: if "%WITH_LIBSODIUM%"=="ON" (
if not exist "%LIBSODIUMDIR%" (
git clone --branch stable --depth 1 --quiet "https://github.com/jedisct1/libsodium.git" %LIBSODIUMDIR%
) else (
git -C "%LIBSODIUMDIR%" pull
)
)
- cmd: if "%WITH_LIBSODIUM%"=="ON" msbuild /v:minimal /maxcpucount:%NUMBER_OF_PROCESSORS% /p:Configuration=%Configuration%DLL %LIBSODIUMDIR%\builds\msvc\%MSVCYEAR%\libsodium\libsodium.vcxproj
- cmd: if "%WITH_LIBSODIUM%"=="ON" set SODIUM_LIBRARY_DIR="%LIBSODIUMDIR%\bin\%Platform%\%Configuration%\%MSVCVERSION%\dynamic"
- cmd: if "%WITH_LIBSODIUM%"=="ON" set SODIUM_INCLUDE_DIR="%LIBSODIUMDIR%\src\libsodium\include"
- ps: if (${env:WITH_LIBSODIUM} -eq "ON") { Copy-Item "C:\projects\libsodium\bin\${env:Platform}\${env:Configuration}\${env:MSVCVERSION}\dynamic\libsodium.lib" -Destination "C:\projects\libsodium\bin\${env:Platform}\${env:Configuration}\${env:MSVCVERSION}\dynamic\sodium.lib" }
clone_folder: C:\projects\libzmq
before_build:
- cmd: set LIBZMQ_SRCDIR=%cd%
- cmd: set LIBZMQ_BUILDDIR=C:\projects\build_libzmq
# TODO this does not work with sonarcloud.io, as it misses the sonar-cxx plugin
# - cmd: curl -L https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.1.0.1141-windows.zip -o sonar-scanner-cli-3.1.0.1141-windows.zip
# - cmd: unzip sonar-scanner-cli-3.1.0.1141-windows.zip
# - cmd: set BUILDLOG="%LIBZMQ_SRCDIR%\build.log"
- cmd: md "%LIBZMQ_BUILDDIR%"
- cd "%LIBZMQ_BUILDDIR%"
- cmd: if "%PLATFORM%" == "cygwin64" set APPVEYOR_BUILD_FOLDER=/cygdrive/C/projects/libzmq
- cmd: if "%ENABLE_ANALYSIS%"=="ON" ( set LIBZMQ_WERROR="OFF" ) else ( set LIBZMQ_WERROR="ON" )
- cmd: cmake -D CMAKE_INCLUDE_PATH="%SODIUM_INCLUDE_DIR%" -D CMAKE_LIBRARY_PATH="%SODIUM_LIBRARY_DIR%" -D WITH_LIBSODIUM="%WITH_LIBSODIUM%" -D ENABLE_DRAFTS="%ENABLE_DRAFTS%" -D ENABLE_ANALYSIS="%ENABLE_ANALYSIS%" -D ENABLE_CURVE="%ENABLE_CURVE%" -D API_POLLER="%API_POLLER%" -D POLLER="%POLLER%" %EXTRA_FLAGS% -D WITH_LIBSODIUM="%WITH_LIBSODIUM%" -D LIBZMQ_WERROR="%LIBZMQ_WERROR%" -G "%CMAKE_GENERATOR%" "%APPVEYOR_BUILD_FOLDER%"
- cmd: cd "%LIBZMQ_SRCDIR%"
- ps: $env:ZMQ_VERSION_MAJOR = (Select-String -Path .\include\zmq.h -Pattern ".*#define ZMQ_VERSION_MAJOR ([0-9]+).*").Matches.Groups[1].Value
- ps: $env:ZMQ_VERSION_MINOR = (Select-String -Path .\include\zmq.h -Pattern ".*#define ZMQ_VERSION_MINOR ([0-9]+).*").Matches.Groups[1].Value
- ps: $env:ZMQ_VERSION_PATCH = (Select-String -Path .\include\zmq.h -Pattern ".*#define ZMQ_VERSION_PATCH ([0-9]+).*").Matches.Groups[1].Value
- ps: $env:ZMQ_VERSION = "${env:ZMQ_VERSION_MAJOR}.${env:ZMQ_VERSION_MINOR}.${env:ZMQ_VERSION_PATCH}"
- cmd: echo "ZMQ_VERSION is %ZMQ_VERSION%"
build_script:
- cmd: set verbosity=Minimal
- cmd: if "%MSVCYEAR%"=="vs2008" set verbosity=Normal
- cmd: if "%MSVCYEAR%"=="vs2008" set path=C:\Windows\Microsoft.NET\Framework\v3.5;%path%
- cmd: cd "%LIBZMQ_BUILDDIR%"
- cmd: if "%PLATFORM%" == "Win32" (
if "%MSVCYEAR%"=="vs2008" (
cmake --build %LIBZMQ_BUILDDIR% --config %configuration% --target install
) else (
cmake --build %LIBZMQ_BUILDDIR% --config %configuration% --target install -- -verbosity:Minimal -maxcpucount -logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
)
)
- cmd: if "%PLATFORM%" == "x64" (
cmake --build %LIBZMQ_BUILDDIR% --config %configuration% --target install -- -verbosity:Minimal -maxcpucount -logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
)
- cmd: if "%PLATFORM%" == "cygwin64" (
cmake --build . -- -j5
)
- cmd: if "%PLATFORM%" == "mingw64" (
cmake --build . -- -j5
)
# TODO this does not work with sonarcloud.io, as it misses the sonar-cxx plugin
# build_script:
# - cmd: msbuild %LIBZMQ_BUILDDIR%\ZeroMQ.sln /verbosity:detailed >%BUILDLOG%
after_build:
# TODO this does not work with sonarcloud.io, as it misses the sonar-cxx plugin
# - cmd: cd "%LIBZMQ_SRCDIR%"
# - cmd: dir
# - cmd: sonar-scanner-3.1.0.1141-windows\bin\sonar-scanner
# -Dsonar.scm.provider=git
# -Dsonar.projectKey=libzmq-msvc
# -Dsonar.organization=sigiesec-github
# -Dsonar.sources=include,src,tests,unittests
# -Dsonar.host.url=https://sonarcloud.io
# -Dsonar.login=%SONARQUBE_TOKEN%
# -Dsonar.cxx.compiler.parser="Visual C++"
# -Dsonar.cxx.compiler.reportPath=build.log
# -Dsonar.cxx.compiler.charset=UTF-8
# -Dsonar.cxx.compiler.regex=^(?<filename>.*)\\((?<line>[0-9]+)\\):\\x20warning\\x20(?<id>C\\d\\d\\d\\d):(?<message>.*)$
# TODO this should be done differently, using the INSTALL cmake target, the current handling depends on the details of the CMakeLists.txt
- cmd: cd %LIBZMQ_BUILDDIR%\bin\%Configuration%"
- cmd: if "%WITH_LIBSODIUM%"=="ON" copy "%SODIUM_LIBRARY_DIR%\libsodium.dll" .
- cmd: copy "%LIBZMQ_SRCDIR%\include\zmq.h" .
- cmd: copy ..\..\lib\%Configuration%\libzmq*.lib .
- cmd: 7z a -y -bd -mx=9 libzmq.zip *.exe *.dll *.pdb *.h *.lib
- ps: Push-AppveyorArtifact "libzmq.zip" -Filename "libzmq-${env:ARTIFACT_NAME}-${env:ZMQ_VERSION_MAJOR}_${env:ZMQ_VERSION_MINOR}_${env:ZMQ_VERSION_PATCH}.zip"
test_script:
- cmd: cd "%LIBZMQ_BUILDDIR%"
# TODO run tests in parallel only on selected platforms, since they fail on others, see https://github.com/zeromq/libzmq/issues/3123
- cmd: if "%CMAKE_GENERATOR%"=="Visual Studio 12 2013" set PARALLELIZE=ON
- cmd: if "%CMAKE_GENERATOR%"=="Visual Studio 14 2015" set PARALLELIZE=ON
- cmd: if "%CMAKE_GENERATOR%"=="Visual Studio 12 2013 Win64" set PARALLELIZE=ON
- cmd: if "%CMAKE_GENERATOR%"=="Visual Studio 14 2015 Win64" set PARALLELIZE=ON
- cmd: if not defined TEST_OPTIONS set "TEST_OPTIONS= "
- cmd: if "%PARALLELIZE%"=="ON" (
echo "Running tests in parallel" &&
set TEST_OPTIONS=%TEST_OPTIONS% -j5
)
- cmd: if "%APPVEYOR_REPO_TAG%"=="false" (ctest -C "%Configuration%" -V %TEST_OPTIONS%)
deploy:
- provider: BinTray
username: somdoron
api_key:
secure: B4TC4GvUMbwX13Skh2Kvyc6SnqLkjNS9W0gtN2yxUC2Y4oQSCK2F4eRgtpMpCasg
subject: zeromq
repo: generic
package: libzmq
publish: true
override: true
version: ${ZMQ_VERSION}
on:
APPVEYOR_REPO_TAG: true
# the analysis build is repeated; apparently appveyor only uses the first section that matches some branch
for:
-
branches:
only:
- master
environment:
matrix:
- platform: Win32
configuration: Release
API_POLLER: poll
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
NO_PR: TRUE
- platform: x64
configuration: Release
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
NO_PR: TRUE
- platform: Win32
configuration: Release
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
NO_PR: TRUE
- platform: Win32
configuration: Release
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
ENABLE_ANALYSIS: ON
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CMAKE_GENERATOR: "Visual Studio 15 2017"
MSVCVERSION: "v141"
MSVCYEAR: "vs2017"
NO_PR: TRUE
-
branches:
only:
- /.*analyze$/
environment:
matrix:
- platform: Win32
configuration: Release
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
ENABLE_ANALYSIS: ON
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CMAKE_GENERATOR: "Visual Studio 15 2017"
MSVCVERSION: "v141"
MSVCYEAR: "vs2017"
NO_PR: TRUE