.azure-pipelines.yml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. #
  10. # This software is licensed as described in the file COPYING, which
  11. # you should have received as part of this distribution. The terms
  12. # are also available at https://curl.se/docs/copyright.html.
  13. #
  14. # You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. # copies of the Software, and permit persons to whom the Software is
  16. # furnished to do so, under the terms of the COPYING file.
  17. #
  18. # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. # KIND, either express or implied.
  20. #
  21. # SPDX-License-Identifier: curl
  22. #
  23. ###########################################################################
  24. # Starter pipeline
  25. # Start with a minimal pipeline that you can customize to build and deploy your code.
  26. # Add steps that build, run tests, deploy, and more:
  27. # https://aka.ms/yaml
  28. trigger:
  29. branches:
  30. include:
  31. - 'master'
  32. - '*/ci'
  33. pr:
  34. branches:
  35. include:
  36. - 'master'
  37. stages:
  38. ##########################################
  39. ### Linux jobs first
  40. ##########################################
  41. - stage: linux
  42. dependsOn: []
  43. jobs:
  44. - job: ubuntu
  45. # define defaults to make sure variables are always expanded/replaced
  46. variables:
  47. install: ''
  48. configure: ''
  49. tests: '!433'
  50. timeoutInMinutes: 60
  51. pool:
  52. vmImage: 'ubuntu-latest'
  53. strategy:
  54. matrix:
  55. default:
  56. name: default
  57. install:
  58. configure: --enable-debug --with-openssl
  59. disable_ipv6:
  60. name: w/o IPv6
  61. configure: --disable-ipv6 --with-openssl
  62. disable_http_smtp_imap:
  63. name: w/o HTTP/SMTP/IMAP
  64. configure: --disable-http --disable-smtp --disable-imap --without-ssl
  65. disable_thredres:
  66. name: sync resolver
  67. configure: --disable-threaded-resolver --with-openssl
  68. https_only:
  69. name: HTTPS only
  70. 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
  71. torture:
  72. name: torture
  73. install: libnghttp2-dev
  74. configure: --enable-debug --disable-shared --disable-threaded-resolver --with-openssl
  75. tests: -n -t --shallow=25 !FTP
  76. steps:
  77. - script: sudo apt-get update && sudo apt-get install -y stunnel4 python3-impacket libzstd-dev libbrotli-dev $(install)
  78. displayName: 'apt install'
  79. retryCountOnTaskFailure: 3
  80. - script: autoreconf -fi && ./configure --enable-warnings --enable-werror $(configure)
  81. displayName: 'configure $(name)'
  82. - script: make V=1 && make V=1 examples && cd tests && make V=1
  83. displayName: 'compile'
  84. env:
  85. MAKEFLAGS: "-j 2"
  86. - script: make V=1 test-ci
  87. displayName: 'test'
  88. env:
  89. AZURE_ACCESS_TOKEN: "$(System.AccessToken)"
  90. TFLAGS: "-ac /usr/bin/curl -r $(tests)"
  91. - stage: distcheck
  92. dependsOn: []
  93. jobs:
  94. - job: ubuntu
  95. timeoutInMinutes: 30
  96. pool:
  97. vmImage: 'ubuntu-latest'
  98. steps:
  99. - script: autoreconf -fi && ./configure --without-ssl
  100. displayName: 'configure $(name)'
  101. - script: make && ./maketgz 99.98.97
  102. displayName: 'make tarball'
  103. - script: |
  104. tar xf curl-99.98.97.tar.gz
  105. cd curl-99.98.97
  106. ./configure --prefix=$HOME/temp --without-ssl
  107. make
  108. make TFLAGS=1 test
  109. make install
  110. # basic check of the installed files
  111. cd ..
  112. bash scripts/installcheck.sh $HOME/temp
  113. rm -rf curl-99.98.97
  114. displayName: 'verify in-tree configure build'
  115. - script: |
  116. # verify out-of-tree build
  117. tar xf curl-99.98.97.tar.gz
  118. touch curl-99.98.97/docs/{cmdline-opts,libcurl}/Makefile.inc
  119. mkdir build
  120. cd build
  121. ../curl-99.98.97/configure --without-ssl
  122. make
  123. make TFLAGS='-p 1 1139' test
  124. # verify cmake build
  125. cd ..
  126. rm -rf curl-99.98.97
  127. displayName: 'verify out-of-tree configure build'
  128. - script: |
  129. tar xf curl-99.98.97.tar.gz
  130. cd curl-99.98.97
  131. mkdir build
  132. cd build
  133. cmake ..
  134. make
  135. displayName: 'verify out-of-tree cmake build'
  136. - stage: scanbuild
  137. dependsOn: []
  138. jobs:
  139. - job: ubuntu
  140. timeoutInMinutes: 30
  141. pool:
  142. vmImage: 'ubuntu-latest'
  143. steps:
  144. - 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
  145. displayName: 'apt install'
  146. retryCountOnTaskFailure: 3
  147. - script: autoreconf -fi
  148. displayName: 'autoreconf'
  149. - script: scan-build-10 ./configure --enable-debug --enable-werror --with-openssl --with-libssh2
  150. displayName: 'configure'
  151. env:
  152. CC: "clang-9"
  153. CCX: "clang++-9"
  154. - script: scan-build-10 --status-bugs make
  155. displayName: 'make'
  156. - script: scan-build-10 --status-bugs make examples
  157. displayName: 'make examples'
  158. ##########################################
  159. ### Windows jobs below
  160. ##########################################
  161. - stage: windows
  162. dependsOn: []
  163. variables:
  164. agent.preferPowerShellOnContainers: true
  165. jobs:
  166. - job: msys
  167. # define defaults to make sure variables are always expanded/replaced
  168. variables:
  169. container_img: ''
  170. container_cmd: ''
  171. configure: ''
  172. tests: ''
  173. timeoutInMinutes: 120
  174. pool:
  175. vmImage: 'windows-2019'
  176. strategy:
  177. matrix:
  178. v2_mingw32_openssl:
  179. name: 32-bit OpenSSL/libssh2
  180. container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw32:ltsc2019
  181. container_cmd: C:\msys64\usr\bin\sh
  182. 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
  183. configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-debug --enable-werror --with-libssh2 --with-openssl
  184. tests: "~571"
  185. v2_mingw64_openssl:
  186. name: 64-bit OpenSSL/libssh2
  187. container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw64:ltsc2019
  188. container_cmd: C:\msys64\usr\bin\sh
  189. 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
  190. configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-debug --enable-werror --with-libssh2 --with-openssl
  191. tests: "~571"
  192. v2_mingw64_libssh:
  193. name: 64-bit OpenSSL/libssh
  194. container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw64:ltsc2019
  195. container_cmd: C:\msys64\usr\bin\sh
  196. prepare: pacman -S --needed --noconfirm --noprogressbar libssh-devel mingw-w64-x86_64-libssh
  197. configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-debug --enable-werror --with-libssh --with-openssl
  198. tests: "~571 ~614"
  199. v1_mingw:
  200. name: 32-bit (legacy)
  201. container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw:ltsc2019
  202. container_cmd: C:\MinGW\msys\1.0\bin\sh
  203. configure: --host=i686-pc-mingw32 --build=i686-pc-mingw32 --prefix=/mingw --enable-debug --without-ssl
  204. tests: "!203 !1143"
  205. v1_mingw32:
  206. name: 32-bit w/o zlib
  207. container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw32:ltsc2019
  208. container_cmd: C:\MinGW\msys\1.0\bin\sh
  209. configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-debug --enable-werror --without-zlib --without-ssl
  210. tests: "!203 !1143"
  211. v1_mingw64:
  212. name: 64-bit w/o zlib
  213. container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw64:ltsc2019
  214. container_cmd: C:\MinGW\msys\1.0\bin\sh
  215. configure: --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --prefix=/mingw64 --enable-debug --enable-werror --without-zlib --without-ssl
  216. tests: "!203 !1143"
  217. v2_mingw32_schannel:
  218. name: 32-bit Schannel/SSPI/WinIDN/libssh2
  219. container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw32:ltsc2019
  220. container_cmd: C:\msys64\usr\bin\sh
  221. 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
  222. configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-debug --enable-werror --enable-sspi --with-schannel --with-winidn --with-libssh2
  223. tests: "~571"
  224. v2_mingw64_schannel:
  225. name: 64-bit Schannel/SSPI/WinIDN/libssh2
  226. container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys2-mingw64:ltsc2019
  227. container_cmd: C:\msys64\usr\bin\sh
  228. 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
  229. 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
  230. tests: "~571"
  231. v1_mingw_schannel:
  232. name: 32-bit Schannel/SSPI/WinIDN (legacy)
  233. container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw:ltsc2019
  234. container_cmd: C:\MinGW\msys\1.0\bin\sh
  235. configure: --host=i686-pc-mingw32 --build=i686-pc-mingw32 --prefix=/mingw --enable-debug --enable-sspi --with-schannel --with-winidn
  236. tests: "!203 !305 !311 !312 !313 !404 !1143 !2033 !2035 !2038 !2041 !2042 !2048 !2070 !2079 !2087 !3023 !3024"
  237. v1_mingw32_schannel:
  238. name: 32-bit Schannel/SSPI/WinIDN w/o zlib
  239. container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw32:ltsc2019
  240. container_cmd: C:\MinGW\msys\1.0\bin\sh
  241. configure: --host=i686-w64-mingw32 --build=i686-w64-mingw32 --prefix=/mingw32 --enable-debug --enable-werror --enable-sspi --with-schannel --with-winidn --without-zlib
  242. tests: "!203 !1143"
  243. v1_mingw64_schannel:
  244. name: 64-bit Schannel/SSPI/WinIDN w/o zlib
  245. container_img: ghcr.io/mback2k/curl-docker-winbuildenv/msys1-mingw64:ltsc2019
  246. container_cmd: C:\MinGW\msys\1.0\bin\sh
  247. 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
  248. tests: "!203 !1143"
  249. container:
  250. image: $(container_img)
  251. env:
  252. MSYS2_PATH_TYPE: inherit
  253. steps:
  254. - script: $(container_cmd) -l -c "cd $(echo '%cd%') && $(prepare)"
  255. displayName: 'prepare'
  256. condition: variables.prepare
  257. retryCountOnTaskFailure: 3
  258. - script: $(container_cmd) -l -c "cd $(echo '%cd%') && autoreconf -fi && ./configure $(configure)"
  259. displayName: 'configure $(name)'
  260. - script: $(container_cmd) -l -c "cd $(echo '%cd%') && make V=1 && make V=1 examples && cd tests && make V=1"
  261. displayName: 'compile'
  262. env:
  263. MAKEFLAGS: "-j 2"
  264. - 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 .. {} \;"
  265. displayName: 'install'
  266. - script: $(container_cmd) -l -c "cd $(echo '%cd%') && make V=1 test-ci"
  267. displayName: 'test'
  268. env:
  269. AZURE_ACCESS_TOKEN: "$(System.AccessToken)"
  270. TFLAGS: "-ac /usr/bin/curl.exe !IDN !SCP ~612 ~1056 $(tests)"