libssh2

Форк
0
/
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

32
environment:
33
  CONFIGURATION: 'Release'
34
  FIXTURE_XFER_COUNT: 35020
35
  matrix:
36
    - job_name: 'VS2022, OpenSSL 3, x64, Server 2019'
37
      APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
38
      GENERATOR: 'Visual Studio 17 2022'
39
      PLATFORM: 'x64'
40
      CRYPTO_BACKEND: 'OpenSSL'
41

42
    - job_name: 'VS2015, OpenSSL 1.1, x86, Server 2016'
43
      APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017'
44
      GENERATOR: 'Visual Studio 14 2015'
45
      PLATFORM: 'x86'
46
      CRYPTO_BACKEND: 'OpenSSL'
47

48
    - job_name: 'VS2015, OpenSSL 1.1, x64, Server 2012 R2, Logging'
49
      APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
50
      GENERATOR: 'Visual Studio 14 2015'
51
      PLATFORM: 'x64'
52
      CRYPTO_BACKEND: 'OpenSSL'
53
      ENABLE_DEBUG_LOGGING: 'ON'
54

55
    - job_name: 'VS2013, OpenSSL 1.1, x64, Server 2012 R2'
56
      APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
57
      GENERATOR: 'Visual Studio 12 2013'
58
      PLATFORM: 'x64'
59
      CRYPTO_BACKEND: 'OpenSSL'
60

61
    - job_name: 'VS2013, OpenSSL 1.1, x86, Server 2012 R2, Shared-only'
62
      APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
63
      GENERATOR: 'Visual Studio 12 2013'
64
      PLATFORM: 'x86'
65
      BUILD_STATIC_LIBS: 'OFF'
66
      CRYPTO_BACKEND: 'OpenSSL'
67

68
    - job_name: 'VS2013, OpenSSL 1.0.2, x64, Build-only, Static-only'
69
      APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
70
      GENERATOR: 'Visual Studio 12 2013'
71
      PLATFORM: 'x64'
72
      BUILD_SHARED_LIBS: 'OFF'
73
      CRYPTO_BACKEND: 'OpenSSL'
74
      SKIP_CTEST: 'yes'
75

76
    - job_name: 'VS2008, WinCNG, x86, Build-only'
77
      APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
78
      GENERATOR: 'Visual Studio 9 2008'
79
      PLATFORM: 'x86'
80
      CRYPTO_BACKEND: 'WinCNG'
81
      ENABLE_ECDSA_WINCNG: 'ON'
82
      SKIP_CTEST: 'yes'
83

84
    - job_name: 'VS2010, WinCNG, x64, Build-only, non-unity'
85
      APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
86
      GENERATOR: 'Visual Studio 10 2010'
87
      PLATFORM: 'x64'
88
      CRYPTO_BACKEND: 'WinCNG'
89
      ENABLE_ECDSA_WINCNG: 'ON'
90
      UNITY: 'OFF'
91
      SKIP_CTEST: 'yes'
92

93
    - job_name: 'VS2022, WinCNG, x64, Server 2019, Logging'
94
      APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
95
      GENERATOR: 'Visual Studio 17 2022'
96
      PLATFORM: 'x64'
97
      CRYPTO_BACKEND: 'WinCNG'
98
      ENABLE_ECDSA_WINCNG: 'ON'
99
      ENABLE_DEBUG_LOGGING: 'ON'
100

101
    - job_name: 'VS2022, WinCNG, ARM64, Build-only'
102
      APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
103
      GENERATOR: 'Visual Studio 17 2022'
104
      PLATFORM: 'ARM64'
105
      CRYPTO_BACKEND: 'WinCNG'
106
      ENABLE_ECDSA_WINCNG: 'ON'
107

108
    - job_name: 'VS2015, WinCNG, x86, Server 2016'
109
      APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017'
110
      GENERATOR: 'Visual Studio 14 2015'
111
      PLATFORM: 'x86'
112
      CRYPTO_BACKEND: 'WinCNG'
113
      ENABLE_ECDSA_WINCNG: 'ON'
114

115
    - job_name: 'VS2015, WinCNG, x64, Server 2012 R2'
116
      APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015'
117
      GENERATOR: 'Visual Studio 14 2015'
118
      PLATFORM: 'x64'
119
      CRYPTO_BACKEND: 'WinCNG'
120
      ENABLE_ECDSA_WINCNG: 'OFF'
121

122
matrix:
123
  fast_finish: true
124

125
install:
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

132
build_script:
133
  - ps: |
134
      $options = @('-DENABLE_WERROR=ON')
135

136
      if($env:GENERATOR -eq 'Visual Studio 17 2022') {
137
        if($env:PLATFORM -eq 'x86') {
138
          $options += '-A Win32'
139
        }
140
        else {
141
          $options += "-A $env:PLATFORM"
142
        }
143
      }
144
      elseif($env:PLATFORM -eq 'x64') {
145
        $env:GENERATOR += ' Win64'
146
      }
147
      $options += "-G$env:GENERATOR"
148

149
      $options += "-DCRYPTO_BACKEND=$env:CRYPTO_BACKEND"
150
      if($env:SKIP_CTEST -ne 'yes' -and $env:CRYPTO_BACKEND -eq 'OpenSSL') {
151
        if($env:APPVEYOR_BUILD_WORKER_IMAGE -eq 'Visual Studio 2022') {
152
          if($env:PLATFORM -eq 'x64') {
153
            $options += '-DOPENSSL_ROOT_DIR=C:/OpenSSL-v32-Win64'
154
          }
155
        }
156
        else {
157
          if($env:PLATFORM -eq 'x64') {
158
            $options += '-DOPENSSL_ROOT_DIR=C:/OpenSSL-v111-Win64'
159
          }
160
          elseif($env:PLATFORM -eq 'x86') {
161
            $options += '-DOPENSSL_ROOT_DIR=C:/OpenSSL-v111-Win32'
162
          }
163
        }
164
      }
165

166
      if($env:ENABLE_DEBUG_LOGGING -eq 'ON') {
167
        $options += '-DENABLE_DEBUG_LOGGING=ON'
168
      }
169
      if($env:UNITY -ne 'OFF') {
170
        $options += '-DCMAKE_UNITY_BUILD=ON'
171
      }
172
      if($env:ENABLE_ECDSA_WINCNG -eq 'ON') {
173
        $options += '-DENABLE_ECDSA_WINCNG=ON'
174
      }
175
      if($env:BUILD_STATIC_LIBS -eq 'OFF') {
176
        $options += '-DBUILD_STATIC_LIBS=OFF'
177
      }
178
      if($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

186
      Write-Host 'CMake options:' $options
187
      cmake -B _builds $options
188
      cmake --build _builds --config "$env:CONFIGURATION" --parallel 2
189

190
test_script:
191
  - ps: |
192
      if($env:SKIP_CTEST -ne 'yes' -and $env:PLATFORM -ne 'ARM64') {
193
        appveyor-retry choco install --yes --no-progress --limit-output --timeout 180 docker-cli
194
        Write-Host 'Waiting for SSH connection from GitHub Actions' -NoNewline
195
        $endDate = (Get-Date).AddMinutes(3)
196
        while((Get-Process -Name 'sshd' -ErrorAction SilentlyContinue).Count -eq 1 -and (Get-Date) -lt $endDate) {
197
          Write-Host '.' -NoNewline
198
          Start-Sleep -Seconds 1
199
        }
200
        if((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)
203
          Write-Host '... ready.'
204
        }
205
        else {
206
          Write-Host '... failed.'
207
        }
208
        if($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)")
212
        cd _builds; ctest -VV -C $($env:CONFIGURATION) --output-on-failure --timeout 900
213
      }
214

215
on_failure:
216
  - ps: |
217
      if(Test-Path _builds/CMakeFiles/CMakeConfigureLog.yaml) { cat _builds/CMakeFiles/CMakeConfigureLog.yaml }
218
      if(Test-Path _builds/CMakeFiles/CMakeOutput.log) { cat _builds/CMakeFiles/CMakeOutput.log }
219
      if(Test-Path _builds/CMakeFiles/CMakeError.log) { cat _builds/CMakeFiles/CMakeError.log }
220

221
on_finish:
222
  - ps: |
223
      Get-Process -Name 'sleep' -ErrorAction SilentlyContinue | Stop-Process
224
      Start-Sleep -Seconds 3
225
      Get-Process -Name 'sshd' -ErrorAction SilentlyContinue | Stop-Process
226

227
skip_commits:
228
  files:
229
    - '.github/**/*'
230

231
clone_depth: 10
232

233
# Limit branches to avoid testing feature branches twice (as branch and as pull request)
234
branches:
235
  only:
236
    - master
237

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.