libssh2
/
appveyor.yml
236 строк · 8.5 Кб
1# Copyright (C) Ruslan Baratov
2# Copyright (C) Alexander Lamaison
3# Copyright (C) Marc Hoersken
4# Copyright (C) Viktor Szakats
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions are met:
9#
10# * Redistributions of source code must retain the above copyright notice, this
11# list of conditions and the following disclaimer.
12#
13# * Redistributions in binary form must reproduce the above copyright notice,
14# this list of conditions and the following disclaimer in the documentation
15# and/or other materials provided with the distribution.
16#
17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27#
28# SPDX-License-Identifier: BSD-3-Clause
29
30# https://www.appveyor.com/docs/windows-images-software/
31
32environment:
33CONFIGURATION: 'Release'
34FIXTURE_XFER_COUNT: 35020
35matrix:
36- job_name: 'VS2022, OpenSSL 3, x64, Server 2019'
37APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
38GENERATOR: 'Visual Studio 17 2022'
39PLATFORM: 'x64'
40CRYPTO_BACKEND: 'OpenSSL'
41
42- job_name: 'VS2015, OpenSSL 1.1, x86, Server 2016'
43APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017'
44GENERATOR: 'Visual Studio 14 2015'
45PLATFORM: 'x86'
46CRYPTO_BACKEND: 'OpenSSL'
47
48- job_name: 'VS2015, OpenSSL 1.1, x64, Server 2012 R2, Logging'
49APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
50GENERATOR: 'Visual Studio 14 2015'
51PLATFORM: 'x64'
52CRYPTO_BACKEND: 'OpenSSL'
53ENABLE_DEBUG_LOGGING: 'ON'
54
55- job_name: 'VS2013, OpenSSL 1.1, x64, Server 2012 R2'
56APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
57GENERATOR: 'Visual Studio 12 2013'
58PLATFORM: 'x64'
59CRYPTO_BACKEND: 'OpenSSL'
60
61- job_name: 'VS2013, OpenSSL 1.1, x86, Server 2012 R2, Shared-only'
62APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
63GENERATOR: 'Visual Studio 12 2013'
64PLATFORM: 'x86'
65BUILD_STATIC_LIBS: 'OFF'
66CRYPTO_BACKEND: 'OpenSSL'
67
68- job_name: 'VS2013, OpenSSL 1.0.2, x64, Build-only, Static-only'
69APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
70GENERATOR: 'Visual Studio 12 2013'
71PLATFORM: 'x64'
72BUILD_SHARED_LIBS: 'OFF'
73CRYPTO_BACKEND: 'OpenSSL'
74SKIP_CTEST: 'yes'
75
76- job_name: 'VS2008, WinCNG, x86, Build-only'
77APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
78GENERATOR: 'Visual Studio 9 2008'
79PLATFORM: 'x86'
80CRYPTO_BACKEND: 'WinCNG'
81ENABLE_ECDSA_WINCNG: 'ON'
82SKIP_CTEST: 'yes'
83
84- job_name: 'VS2010, WinCNG, x64, Build-only, non-unity'
85APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
86GENERATOR: 'Visual Studio 10 2010'
87PLATFORM: 'x64'
88CRYPTO_BACKEND: 'WinCNG'
89ENABLE_ECDSA_WINCNG: 'ON'
90UNITY: 'OFF'
91SKIP_CTEST: 'yes'
92
93- job_name: 'VS2022, WinCNG, x64, Server 2019, Logging'
94APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
95GENERATOR: 'Visual Studio 17 2022'
96PLATFORM: 'x64'
97CRYPTO_BACKEND: 'WinCNG'
98ENABLE_ECDSA_WINCNG: 'ON'
99ENABLE_DEBUG_LOGGING: 'ON'
100
101- job_name: 'VS2022, WinCNG, ARM64, Build-only'
102APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
103GENERATOR: 'Visual Studio 17 2022'
104PLATFORM: 'ARM64'
105CRYPTO_BACKEND: 'WinCNG'
106ENABLE_ECDSA_WINCNG: 'ON'
107
108- job_name: 'VS2015, WinCNG, x86, Server 2016'
109APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017'
110GENERATOR: 'Visual Studio 14 2015'
111PLATFORM: 'x86'
112CRYPTO_BACKEND: 'WinCNG'
113ENABLE_ECDSA_WINCNG: 'ON'
114
115- job_name: 'VS2015, WinCNG, x64, Server 2012 R2'
116APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
117GENERATOR: 'Visual Studio 14 2015'
118PLATFORM: 'x64'
119CRYPTO_BACKEND: 'WinCNG'
120ENABLE_ECDSA_WINCNG: 'OFF'
121
122matrix:
123fast_finish: true
124
125install:
126# prepare local SSH server for reverse tunneling from GitHub Actions hosting our docker container
127- ps: |
128$env:OPENSSH_SERVER_PORT = Get-Random -Minimum 2000 -Maximum 2300
129[System.Environment]::SetEnvironmentVariable('OPENSSH_SERVER_PORT', $env:OPENSSH_SERVER_PORT)
130.\ci\appveyor\docker-bridge.ps1
131
132build_script:
133- ps: |
134$options = @('-DENABLE_WERROR=ON')
135
136if($env:GENERATOR -eq 'Visual Studio 17 2022') {
137if($env:PLATFORM -eq 'x86') {
138$options += '-A Win32'
139}
140else {
141$options += "-A $env:PLATFORM"
142}
143}
144elseif($env:PLATFORM -eq 'x64') {
145$env:GENERATOR += ' Win64'
146}
147$options += "-G$env:GENERATOR"
148
149$options += "-DCRYPTO_BACKEND=$env:CRYPTO_BACKEND"
150if($env:SKIP_CTEST -ne 'yes' -and $env:CRYPTO_BACKEND -eq 'OpenSSL') {
151if($env:APPVEYOR_BUILD_WORKER_IMAGE -eq 'Visual Studio 2022') {
152if($env:PLATFORM -eq 'x64') {
153$options += '-DOPENSSL_ROOT_DIR=C:/OpenSSL-v32-Win64'
154}
155}
156else {
157if($env:PLATFORM -eq 'x64') {
158$options += '-DOPENSSL_ROOT_DIR=C:/OpenSSL-v111-Win64'
159}
160elseif($env:PLATFORM -eq 'x86') {
161$options += '-DOPENSSL_ROOT_DIR=C:/OpenSSL-v111-Win32'
162}
163}
164}
165
166if($env:ENABLE_DEBUG_LOGGING -eq 'ON') {
167$options += '-DENABLE_DEBUG_LOGGING=ON'
168}
169if($env:UNITY -ne 'OFF') {
170$options += '-DCMAKE_UNITY_BUILD=ON'
171}
172if($env:ENABLE_ECDSA_WINCNG -eq 'ON') {
173$options += '-DENABLE_ECDSA_WINCNG=ON'
174}
175if($env:BUILD_STATIC_LIBS -eq 'OFF') {
176$options += '-DBUILD_STATIC_LIBS=OFF'
177}
178if($env:BUILD_SHARED_LIBS -eq 'OFF') {
179$options += '-DBUILD_SHARED_LIBS=OFF'
180}
181$options += '-DCMAKE_VS_GLOBALS=TrackFileAccess=false'
182# FIXME: First sshd test sometimes timeouts, subsequent ones almost always fail:
183# 'libssh2_session_handshake failed (-43): Failed getting banner'
184$options += '-DRUN_SSHD_TESTS=OFF'
185
186Write-Host 'CMake options:' $options
187cmake -B _builds $options
188cmake --build _builds --config "$env:CONFIGURATION" --parallel 2
189
190test_script:
191- ps: |
192if($env:SKIP_CTEST -ne 'yes' -and $env:PLATFORM -ne 'ARM64') {
193appveyor-retry choco install --yes --no-progress --limit-output --timeout 180 docker-cli
194Write-Host 'Waiting for SSH connection from GitHub Actions' -NoNewline
195$endDate = (Get-Date).AddMinutes(3)
196while((Get-Process -Name 'sshd' -ErrorAction SilentlyContinue).Count -eq 1 -and (Get-Date) -lt $endDate) {
197Write-Host '.' -NoNewline
198Start-Sleep -Seconds 1
199}
200if((Get-Process -Name 'sshd' -ErrorAction SilentlyContinue).Count -gt 1) {
201$env:DOCKER_HOST = 'tcp://127.0.0.1:2375'
202[System.Environment]::SetEnvironmentVariable('DOCKER_HOST', $env:DOCKER_HOST)
203Write-Host '... ready.'
204}
205else {
206Write-Host '... failed.'
207}
208if($env:CRYPTO_BACKEND -eq 'WinCNG') {
209$env:FIXTURE_TRACE_ALL_CONNECT = '1'
210}
211$env:OPENSSH_SERVER_IMAGE=[string] (& bash -c "echo ghcr.io/libssh2/ci_tests_openssh_server:$(git rev-parse --short=20 HEAD:tests/openssh_server)")
212cd _builds; ctest -VV -C $($env:CONFIGURATION) --output-on-failure --timeout 900
213}
214
215on_failure:
216- ps: |
217if(Test-Path _builds/CMakeFiles/CMakeConfigureLog.yaml) { cat _builds/CMakeFiles/CMakeConfigureLog.yaml }
218if(Test-Path _builds/CMakeFiles/CMakeOutput.log) { cat _builds/CMakeFiles/CMakeOutput.log }
219if(Test-Path _builds/CMakeFiles/CMakeError.log) { cat _builds/CMakeFiles/CMakeError.log }
220
221on_finish:
222- ps: |
223Get-Process -Name 'sleep' -ErrorAction SilentlyContinue | Stop-Process
224Start-Sleep -Seconds 3
225Get-Process -Name 'sshd' -ErrorAction SilentlyContinue | Stop-Process
226
227skip_commits:
228files:
229- '.github/**/*'
230
231clone_depth: 10
232
233# Limit branches to avoid testing feature branches twice (as branch and as pull request)
234branches:
235only:
236- master
237