summaryrefslogtreecommitdiff
path: root/.azure-pipelines.yml
blob: 171a650dd67b3897675eae3f9388c35b3ed74647 (plain)
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
#***************************************************************************
#                                  _   _ ____  _
#  Project                     ___| | | |  _ \| |
#                             / __| | | | |_) | |
#                            | (__| |_| |  _ <| |___
#                             \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
  branches:
    include:
    - 'master'
    - '*/ci'

pr:
  branches:
    include:
    - 'master'

stages:

##########################################
### Linux jobs first
##########################################

- stage: linux
  dependsOn: []
  jobs:
  - job: ubuntu
    # define defaults to make sure variables are always expanded/replaced
    variables:
      install: ''
      configure: ''
      tests: '!433'
    timeoutInMinutes: 60
    pool:
      vmImage: 'ubuntu-latest'
    strategy:
      matrix:
        default:
          name: default
          install: jsonlint
          configure: --enable-debug --with-openssl
        disable_ipv6:
          name: w/o IPv6
          configure: --disable-ipv6 --with-openssl
        disable_http_smtp_imap:
          name: w/o HTTP/SMTP/IMAP
          configure: --disable-http --disable-smtp --disable-imap --without-ssl
        disable_thredres:
          name: sync resolver
          configure: --disable-threaded-resolver --with-openssl
        https_only:
          name: HTTPS only
          configure: --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap --disable-ldap --disable-pop3 --disable-rtmp --disable-rtsp --disable-scp --disable-sftp --disable-smb --disable-smtp --disable-telnet --disable-tftp --with-openssl
        torture:
          name: torture
          install: libnghttp2-dev
          configure: --enable-debug --disable-shared --disable-threaded-resolver --with-openssl
          tests: -n -t --shallow=40 !FTP
    steps:
    - script: sudo apt-get update && sudo apt-get install -y stunnel4 python3-impacket libzstd-dev libbrotli-dev $(install)
      displayName: 'apt install'
      retryCountOnTaskFailure: 3

    - script: autoreconf -fi && ./configure --enable-warnings --enable-werror $(configure)
      displayName: 'configure $(name)'

    - script: make V=1 && make V=1 examples && cd tests && make V=1
      displayName: 'compile'
      env:
        MAKEFLAGS: "-j 2"

    - script: make V=1 test-ci
      displayName: 'test'
      env:
        AZURE_ACCESS_TOKEN: "$(System.AccessToken)"
        TFLAGS: "-r $(tests)"

- stage: distcheck
  dependsOn: []
  jobs:
  - job: ubuntu
    timeoutInMinutes: 30
    pool:
      vmImage: 'ubuntu-latest'
    steps:
    - script: autoreconf -fi && ./configure --without-ssl
      displayName: 'configure $(name)'

    - script: make && ./maketgz 99.98.97
      displayName: 'make tarball'

    - script: |
        tar xf curl-99.98.97.tar.gz
        cd curl-99.98.97
        ./configure --prefix=$HOME/temp --without-ssl
        make
        make TFLAGS=1 test
        make install
        # basic check of the installed files
        cd ..
        bash scripts/installcheck.sh $HOME/temp
        rm -rf curl-99.98.97

      displayName: 'verify in-tree configure build'

    - script: |
        # verify out-of-tree build
        tar xf curl-99.98.97.tar.gz
        touch curl-99.98.97/docs/{cmdline-opts,libcurl}/Makefile.inc
        mkdir build
        cd build
        ../curl-99.98.97/configure --without-ssl
        make
        make TFLAGS='-p 1 1139' test
        # verify cmake build
        cd ..
        rm -rf curl-99.98.97

      displayName: 'verify out-of-tree configure build'

    - script: |
        tar xf curl-99.98.97.tar.gz
        cd curl-99.98.97
        mkdir build
        cd build
        cmake ..
        make

      displayName: 'verify out-of-tree cmake build'

- stage: scanbuild
  dependsOn: []
  jobs:
  - job: ubuntu
    timeoutInMinutes: 30
    pool:
      vmImage: 'ubuntu-latest'
    steps:
    - script: sudo apt-get update && sudo apt-get install -y clang-tools-10 clang-9 libssl-dev libssh2-1-dev libpsl-dev libbrotli-dev libzstd-dev
      displayName: 'apt install'
      retryCountOnTaskFailure: 3

    - script: autoreconf -fi
      displayName: 'autoreconf'

    - script: scan-build-10 ./configure --enable-debug --enable-werror --with-openssl --with-libssh2
      displayName: 'configure'
      env:
        CC: "clang-9"
        CCX: "clang++-9"

    - script: scan-build-10 --status-bugs make
      displayName: 'make'

    - script: scan-build-10 --status-bugs make examples
      displayName: 'make examples'

##########################################
### Windows jobs below
##########################################

- stage: windows
  dependsOn: []
  variables:
    agent.preferPowerShellOnContainers: true
  jobs:
  - job: msys
    # define defaults to make sure variables are always expanded/replaced
    variables:
      container_img: ''
      container_cmd: ''
      configure: ''
      tests: ''
    timeoutInMinutes: 120
    pool:
      vmImage: 'windows-2019'
    strategy:
      matrix:
        v2_mingw32_openssl:
          name: 32-bit OpenSSL/libssh2
          container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw32:ltsc2019
          container_cmd: C:\msys64\usr\bin\sh
          prepare: pacman -S --needed --noconfirm --noprogressbar libssh2-devel mingw-w64-i686-libssh2 mingw-w64-i686-python-pip mingw-w64-i686-python-wheel mingw-w64-i686-python-pyopenssl && python3 -m pip install --prefer-binary impacket
          configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-debug --enable-werror --with-libssh2 --with-openssl
          tests: "~571"
        v2_mingw64_openssl:
          name: 64-bit OpenSSL/libssh2
          container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw64:ltsc2019
          container_cmd: C:\msys64\usr\bin\sh
          prepare: pacman -S --needed --noconfirm --noprogressbar libssh2-devel mingw-w64-x86_64-libssh2 mingw-w64-x86_64-python-pip mingw-w64-x86_64-python-wheel mingw-w64-x86_64-python-pyopenssl && python3 -m pip install --prefer-binary impacket
          configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-debug --enable-werror --with-libssh2 --with-openssl
          tests: "~571"
        v2_mingw64_libssh:
          name: 64-bit OpenSSL/libssh
          container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw64:ltsc2019
          container_cmd: C:\msys64\usr\bin\sh
          prepare: pacman -S --needed --noconfirm --noprogressbar libssh-devel mingw-w64-x86_64-libssh
          configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-debug --enable-werror --with-libssh --with-openssl
          tests: "~571 ~614"
        v1_mingw:
          name: 32-bit (legacy)
          container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw:ltsc2019
          container_cmd: C:\MinGW\msys\1.0\bin\sh
          configure: --host=i686-pc-mingw32 --build=i686-pc-mingw32 --prefix=/mingw --enable-debug --without-ssl
          tests: "!203 !1143"
        v1_mingw32:
          name: 32-bit w/o zlib
          container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw32:ltsc2019
          container_cmd: C:\MinGW\msys\1.0\bin\sh
          configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-debug --enable-werror --without-zlib --without-ssl
          tests: "!203 !1143"
        v1_mingw64:
          name: 64-bit w/o zlib
          container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw64:ltsc2019
          container_cmd: C:\MinGW\msys\1.0\bin\sh
          configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-debug --enable-werror --without-zlib --without-ssl
          tests: "!203 !1143"
        v2_mingw32_schannel:
          name: 32-bit Schannel/SSPI/WinIDN/libssh2
          container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw32:ltsc2019
          container_cmd: C:\msys64\usr\bin\sh
          prepare: pacman -S --needed --noconfirm --noprogressbar libssh2-devel mingw-w64-i686-libssh2 mingw-w64-i686-python-pip mingw-w64-i686-python-wheel mingw-w64-i686-python-pyopenssl && python3 -m pip install --prefer-binary impacket
          configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-debug --enable-werror --enable-sspi --with-schannel --with-winidn --with-libssh2
          tests: "~571"
        v2_mingw64_schannel:
          name: 64-bit Schannel/SSPI/WinIDN/libssh2
          container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw64:ltsc2019
          container_cmd: C:\msys64\usr\bin\sh
          prepare: pacman -S --needed --noconfirm --noprogressbar libssh2-devel mingw-w64-x86_64-libssh2 mingw-w64-x86_64-python-pip mingw-w64-x86_64-python-wheel mingw-w64-x86_64-python-pyopenssl && python3 -m pip install --prefer-binary impacket
          configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-debug --enable-werror --enable-sspi --with-schannel --with-winidn --with-libssh2
          tests: "~571"
        v1_mingw_schannel:
          name: 32-bit Schannel/SSPI/WinIDN (legacy)
          container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw:ltsc2019
          container_cmd: C:\MinGW\msys\1.0\bin\sh
          configure: --host=i686-pc-mingw32 --build=i686-pc-mingw32 --prefix=/mingw --enable-debug --enable-sspi --with-schannel --with-winidn
          tests: "!203 !305 !311 !312 !313 !404 !1143 !2033 !2035 !2038 !2041 !2042 !2048 !2070 !2079 !2087 !3023 !3024"
        v1_mingw32_schannel:
          name: 32-bit Schannel/SSPI/WinIDN w/o zlib
          container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw32:ltsc2019
          container_cmd: C:\MinGW\msys\1.0\bin\sh
          configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-debug --enable-werror --enable-sspi --with-schannel --with-winidn --without-zlib
          tests: "!203 !1143"
        v1_mingw64_schannel:
          name: 64-bit Schannel/SSPI/WinIDN w/o zlib
          container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw64:ltsc2019
          container_cmd: C:\MinGW\msys\1.0\bin\sh
          configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64  --enable-debug --enable-werror --enable-sspi --with-schannel --with-winidn --without-zlib
          tests: "!203 !1143"
    container:
      image: $(container_img)
      env:
        MSYS2_PATH_TYPE: inherit
    steps:
    - script: $(container_cmd) -l -c "cd $(echo '%cd%') && $(prepare)"
      displayName: 'prepare'
      condition: variables.prepare
      retryCountOnTaskFailure: 3

    - script: $(container_cmd) -l -c "cd $(echo '%cd%') && autoreconf -fi && ./configure $(configure)"
      displayName: 'configure $(name)'

    - script: $(container_cmd) -l -c "cd $(echo '%cd%') && make V=1 && make V=1 examples && cd tests && make V=1"
      displayName: 'compile'
      env:
        MAKEFLAGS: "-j 2"

    - script: $(container_cmd) -l -c "cd $(echo '%cd%') && make V=1 install && PATH=/usr/bin:/bin find . -type f -path '*/.libs/*.exe' -print -execdir mv -t .. {} \;"
      displayName: 'install'

    - script: $(container_cmd) -l -c "cd $(echo '%cd%') && make V=1 test-ci"
      displayName: 'test'
      env:
        AZURE_ACCESS_TOKEN: "$(System.AccessToken)"
        TFLAGS: "!IDN !SCP ~612 ~1056 $(tests)"