appveyor.yml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. version: '{build}'
  2. build:
  3. # no automatic build in script mode
  4. skip_commits:
  5. # Builds just testing something on Travis CI don't need to be
  6. # done on AppVeyor
  7. message: /\[Travis\]/
  8. # Dont build, if only documentation was changed
  9. files:
  10. - '**/*.md'
  11. environment:
  12. enable_cxx: NO
  13. enable_ssl_dynamic_loading: YES
  14. enable_lua: NO
  15. enable_lua_shared: NO
  16. c_standard: auto
  17. cxx_standard: auto
  18. matrix:
  19. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  20. CONAN_VISUAL_VERSIONS: 12
  21. PYTHON: "C:\\Python37"
  22. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
  23. CONAN_VISUAL_VERSIONS: 14
  24. PYTHON: "C:\\Python37"
  25. - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  26. CONAN_VISUAL_VERSIONS: 15
  27. PYTHON: "C:\\Python37"
  28. # Use default values
  29. - id: Default-x86
  30. compiler: msvc-19-seh
  31. build_shared: NO
  32. no_files: NO
  33. enable_ipv6: NO
  34. enable_ssl: YES
  35. enable_websockets: NO
  36. no_cgi: NO
  37. no_caching: NO
  38. enable_stats: NO
  39. configuration: Release
  40. platform: x86
  41. - id: Default-x64
  42. compiler: msvc-19-seh
  43. build_shared: NO
  44. no_files: NO
  45. enable_ipv6: NO
  46. enable_ssl: YES
  47. enable_websockets: NO
  48. no_cgi: NO
  49. no_caching: NO
  50. enable_stats: NO
  51. configuration: Release
  52. platform: x64
  53. # Use default values
  54. - id: Full-x86
  55. compiler: msvc-19-seh
  56. build_shared: NO
  57. no_files: NO
  58. enable_ipv6: YES
  59. enable_ssl: YES
  60. enable_websockets: YES
  61. no_cgi: NO
  62. no_caching: NO
  63. enable_stats: YES
  64. configuration: Release
  65. platform: x86
  66. - id: Full-x64
  67. compiler: msvc-19-seh
  68. build_shared: NO
  69. no_files: NO
  70. enable_ipv6: YES
  71. enable_ssl: YES
  72. enable_websockets: YES
  73. no_cgi: NO
  74. no_caching: NO
  75. enable_stats: YES
  76. configuration: Release
  77. platform: x64
  78. # Debug builds
  79. - id: Full-x86-Debug
  80. compiler: msvc-19-seh
  81. build_shared: NO
  82. no_files: NO
  83. enable_ipv6: YES
  84. enable_ssl: YES
  85. enable_websockets: YES
  86. no_cgi: NO
  87. no_caching: NO
  88. enable_stats: YES
  89. configuration: Debug
  90. platform: x86
  91. - id: Full-x64-Debug
  92. compiler: msvc-19-seh
  93. build_shared: NO
  94. no_files: NO
  95. enable_ipv6: YES
  96. enable_ssl: YES
  97. enable_websockets: YES
  98. no_cgi: NO
  99. no_caching: NO
  100. enable_stats: YES
  101. configuration: Debug
  102. platform: x64
  103. # Minimum settings
  104. - id: Minimal-x86
  105. compiler: msvc-19-seh
  106. build_shared: NO
  107. no_files: YES
  108. enable_ipv6: NO
  109. enable_ssl: NO
  110. enable_websockets: NO
  111. no_cgi: YES
  112. no_caching: YES
  113. enable_stats: NO
  114. configuration: Release
  115. platform: x86
  116. - id: Minimal-x64
  117. compiler: msvc-19-seh
  118. build_shared: NO
  119. no_files: YES
  120. enable_ipv6: NO
  121. enable_ssl: NO
  122. enable_websockets: NO
  123. no_cgi: YES
  124. no_caching: YeS
  125. enable_stats: NO
  126. configuration: Release
  127. platform: x64
  128. # Test shared and debug build
  129. - id: Shared-default-x86
  130. compiler: msvc-19-seh
  131. build_shared: YES
  132. no_files: NO
  133. enable_ipv6: NO
  134. enable_ssl: YES
  135. enable_websockets: NO
  136. no_cgi: NO
  137. no_caching: NO
  138. enable_stats: NO
  139. configuration: Release
  140. platform: x86
  141. - id: Shared-default-x64
  142. compiler: msvc-19-seh
  143. build_shared: YES
  144. no_files: NO
  145. enable_ipv6: NO
  146. enable_ssl: YES
  147. enable_websockets: NO
  148. no_cgi: NO
  149. no_caching: NO
  150. enable_stats: NO
  151. configuration: Release
  152. platform: x64
  153. # MinGW
  154. - id: Full-GCC-x64
  155. compiler: gcc-5.1.0-posix
  156. build_shared: NO
  157. no_files: NO
  158. enable_ipv6: YES
  159. enable_ssl: YES
  160. enable_websockets: YES
  161. no_cgi: NO
  162. no_caching: NO
  163. enable_stats: YES
  164. configuration: Release
  165. platform: x64
  166. # Visual Studio 2010
  167. - id: Full-VS2010-x86
  168. compiler: msvc-16-seh
  169. build_shared: NO
  170. no_files: NO
  171. enable_ipv6: YES
  172. enable_ssl: YES
  173. enable_websockets: YES
  174. no_cgi: NO
  175. no_caching: NO
  176. enable_stats: YES
  177. configuration: Release
  178. platform: x86
  179. # Visual Studio 2012
  180. - id: Full-VS2012-x86
  181. compiler: msvc-17-seh
  182. build_shared: NO
  183. no_files: NO
  184. enable_ipv6: YES
  185. enable_ssl: YES
  186. enable_websockets: YES
  187. no_cgi: NO
  188. no_caching: NO
  189. enable_stats: YES
  190. configuration: Release
  191. platform: x86
  192. # Visual Studio 2013
  193. - id: Full-VS2013-x86
  194. compiler: msvc-18-seh
  195. build_shared: NO
  196. no_files: NO
  197. enable_ipv6: YES
  198. enable_ssl: YES
  199. enable_websockets: YES
  200. no_cgi: NO
  201. no_caching: NO
  202. enable_stats: YES
  203. configuration: Release
  204. platform: x86
  205. image: Visual Studio 2013
  206. - id: Full-VS2013-x64
  207. compiler: msvc-18-seh
  208. build_shared: NO
  209. no_files: NO
  210. enable_ipv6: YES
  211. enable_ssl: YES
  212. enable_websockets: YES
  213. no_cgi: NO
  214. no_caching: NO
  215. enable_stats: YES
  216. configuration: Release
  217. platform: x64
  218. image: Visual Studio 2013
  219. # Visual Studio 2015 is default
  220. # Visual Studio 2017 is not yet default
  221. - id: Full-VS2017-x86
  222. compiler: msvc-20-seh
  223. build_shared: NO
  224. no_files: NO
  225. enable_ipv6: YES
  226. enable_ssl: YES
  227. enable_websockets: YES
  228. no_cgi: NO
  229. no_caching: NO
  230. enable_stats: YES
  231. configuration: Release
  232. platform: x86
  233. APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  234. - id: Full-VS2017-x64
  235. compiler: msvc-20-seh
  236. build_shared: NO
  237. no_files: NO
  238. enable_ipv6: YES
  239. enable_ssl: YES
  240. enable_websockets: YES
  241. no_cgi: NO
  242. no_caching: NO
  243. enable_stats: YES
  244. configuration: Release
  245. platform: x64
  246. APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  247. # Experimental Ubuntu
  248. - id: Ubuntu1604-GCC-x64
  249. compiler: gcc-5.1.0-posix
  250. build_shared: NO
  251. no_files: NO
  252. enable_ipv6: YES
  253. enable_ssl: YES
  254. enable_websockets: YES
  255. no_cgi: NO
  256. no_caching: NO
  257. enable_stats: YES
  258. configuration: Release
  259. platform: x64
  260. image: Ubuntu1604
  261. - id: Ubuntu1804-GCC-x64
  262. compiler: gcc-5.1.0-posix
  263. build_shared: NO
  264. no_files: NO
  265. enable_ipv6: YES
  266. enable_ssl: YES
  267. enable_websockets: YES
  268. no_cgi: NO
  269. no_caching: NO
  270. enable_stats: YES
  271. configuration: Release
  272. platform: x64
  273. image: Ubuntu1804
  274. install:
  275. # Derive some extra information
  276. - set build_type=%configuration%
  277. - for /f "tokens=1-3 delims=-" %%a in ("%compiler%") do (@set "compiler_name=%%a")
  278. - for /f "tokens=1-3 delims=-" %%a in ("%compiler%") do (@set "compiler_version=%%b")
  279. - for /f "tokens=1-3 delims=-" %%a in ("%compiler%") do (@set "compiler_threading=%%c")
  280. - if "%platform%"=="x64" (set arch=x86_64)
  281. - if "%platform%"=="x86" (set arch=i686)
  282. # Download the specific version of MinGW
  283. - if "%compiler_name%"=="gcc" (@set "mingw_output_folder=C:\mingw-builds")
  284. - if "%compiler_name%"=="gcc" (
  285. @for /f %%a in (
  286. 'call mingw.cmd
  287. /version "%compiler_version%"
  288. /arch "%arch%"
  289. /threading "%compiler_threading%"
  290. "%mingw_output_folder%"'
  291. ) do @set "compiler_path=%%a"
  292. )
  293. - if "%compiler_name%"=="gcc" (@set "mingw_log_folder=%mingw_output_folder%\logs")
  294. - if exist "%mingw_log_folder%" @for /f %%f in ('dir /b /oD /tc "%mingw_log_folder%"') do @set "mingw_log_file=%mingw_log_folder%\%%f"
  295. - if exist "%mingw_log_file%" powershell Push-AppveyorArtifact "%mingw_log_file%" -FileName mingw-download.log
  296. # Get OpenSSL
  297. #
  298. # OpenSSL should already be installed, according to
  299. # - http://help.appveyor.com/discussions/questions/1132-openssl-installation-issues
  300. # - https://github.com/appveyor/ci/issues/576
  301. #
  302. - cmd: set PATH=%PATH%;C:\OpenSSL-Win32;C:\OpenSSL-Win64
  303. - dir C:\OpenSSL-Win32
  304. - dir C:\OpenSSL-Win64
  305. - path
  306. before_build:
  307. # Remove sh.exe from the path otherwise CMake will complain:
  308. # "sh.exe was found in your PATH, here: C:/Program Files/Git/usr/bin/sh.exe"
  309. # and the MinGW build will not work (the Visual Studio build does not care).
  310. # See http://help.appveyor.com/discussions/problems/3193-cmake-building-for-mingw-issue-with-git-shexe
  311. # The entire directory containing sh.exe could be removed from the PATH environment:
  312. # - set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
  313. # However, this will also remove all other programs in this directory from the PATH.
  314. # In particular "patch" is still required.
  315. # So, just rename sh.exe:
  316. - ren "C:\Program Files\Git\usr\bin\sh.exe" _sh.exe
  317. # Set up mingw commands
  318. - if "%compiler_name%"=="gcc" (set "generator=MinGW Makefiles")
  319. - if "%compiler_name%"=="gcc" (set "build=mingw32-make -j4")
  320. - if "%compiler_name%"=="gcc" (set "test=mingw32-make test")
  321. # MSVC specific commands
  322. # Note: The minimum version officially supported for CivetWeb is VS2010. Older ones might work or not.
  323. - if "%compiler_version%"=="14" (set "vs_version=8" & set "vs_year=2005")
  324. - if "%compiler_version%"=="15" (set "vs_version=9" & set "vs_year=2008")
  325. - if "%compiler_version%"=="16" (set "vs_version=10" & set "vs_year=2010")
  326. - if "%compiler_version%"=="17" (set "vs_version=11" & set "vs_year=2012")
  327. - if "%compiler_version%"=="18" (set "vs_version=12" & set "vs_year=2013")
  328. - if "%compiler_version%"=="19" (set "vs_version=14" & set "vs_year=2015")
  329. - if "%compiler_version%"=="20" (set "vs_version=15" & set "vs_year=2017")
  330. - if "%compiler_name%"=="msvc" (set "generator=Visual Studio %vs_version% %vs_year%")
  331. - if "%compiler_name%"=="msvc" (
  332. if "%platform%"=="x64" (
  333. set "generator=%generator% Win64"
  334. )
  335. )
  336. - if %compiler_version% gtr 9 (set platform=%platform:x86=Win32%)
  337. - if "%compiler_name%"=="msvc" (set "msbuild_opts=/clp:OnlyErrors;OnlyWarnings /nologo /m /v:m")
  338. - if "%compiler_name%"=="msvc" (set "build=msbuild %msbuild_opts% /p:Configuration=%configuration% /p:Platform=%platform% civetweb.sln")
  339. - if "%compiler_name%"=="msvc" (set "test=msbuild %msbuild_opts% RUN_TESTS.vcxproj")
  340. # Add the compiler path if needed
  341. - if not "%compiler_path%"=="" (set "PATH=%PATH%;%compiler_path%")
  342. # git bash conflicts with MinGW makefiles
  343. - if "%generator%"=="MinGW Makefiles" (set "PATH=%PATH:C:\Program Files (x86)\Git\bin=%")
  344. # Useful locations
  345. - set "source_path=%cd%"
  346. - set "output_path=%source_path%\output"
  347. - set "build_path=%output_path%\build"
  348. - set "install_path=%output_path%\install"
  349. - set "third_party_dir=C:\third-party"
  350. # Check some settings of the build server
  351. - ver
  352. - cd
  353. - dir
  354. - ipconfig /all
  355. # Generate the build scripts with CMake
  356. - mkdir "%build_path%"
  357. - cd "%build_path%"
  358. - cmake --version
  359. - appveyor AddMessage -Category Information "Generating '%generator%'"
  360. - cmake
  361. -G "%generator%"
  362. -DCMAKE_BUILD_TYPE=%build_type%
  363. -DBUILD_SHARED_LIBS=%build_shared%
  364. -DCIVETWEB_SERVE_NO_FILES=%no_files%
  365. "-DCIVETWEB_THIRD_PARTY_DIR=%third_party_dir:\=\\%"
  366. -DCIVETWEB_ENABLE_THIRD_PARTY_OUTPUT=YES
  367. -DCIVETWEB_ENABLE_SSL=%enable_ssl%
  368. -DCIVETWEB_DISABLE_CGI=%no_cgi%
  369. -DCIVETWEB_ENABLE_SSL_DYNAMIC_LOADING=%enable_ssl_dynamic_loading%
  370. -DCIVETWEB_ENABLE_WEBSOCKETS=%enable_websockets%
  371. -DCIVETWEB_ENABLE_CXX=%enable_cxx%
  372. -DCIVETWEB_ENABLE_LUA=%enable_lua%
  373. -DCIVETWEB_ENABLE_LUA_SHARED=%enable_lua_shared%
  374. -DCIVETWEB_ENABLE_SERVER_STATS=%enable_stats%
  375. -DCIVETWEB_DISABLE_CACHING=%no_caching%
  376. -DCIVETWEB_C_STANDARD=%c_standard%
  377. -DCIVETWEB_CXX_STANDARD=%cxx_standard%
  378. "%source_path%"
  379. - powershell Push-AppveyorArtifact CMakeCache.txt
  380. - cd "%source_path%"
  381. build_script:
  382. - cd
  383. - cd "%build_path%"
  384. - appveyor AddMessage -Category Information "Build command '%build%'"
  385. - cmd /c "%build%"
  386. - cd "%source_path%"
  387. test_script:
  388. - cd "%build_path%"
  389. - appveyor AddMessage -Category Information "Test command '%build%'"
  390. - set CTEST_OUTPUT_ON_FAILURE=1
  391. - cmd /c "%test%" & set "test_ret=%ERRORLEVEL%"
  392. - echo "Test returned %test_ret%"
  393. - dir "%source_path%\output\build\unittest\"
  394. - echo "Show all test logs:"
  395. - for /r %%i in ("%source_path%\output\build\unittest\test-*.log") do (
  396. echo %%i
  397. type %%i
  398. )
  399. - for /r %%i in ("%source_path%\output\build\unittest\test-*.xml") do (
  400. echo %%i
  401. type %%i
  402. )
  403. - cd "%source_path%"
  404. - set "output_path=%source_path%\output"
  405. - set "build_path=%output_path%\build"
  406. - set "install_path=%output_path%\install"
  407. - set "third_party_dir=C:\third-party"
  408. - exit /B %ERRORLEVEL%
  409. - echo "Test script DONE"
  410. after_test:
  411. - echo "Current directory:"
  412. - cd
  413. - dir
  414. - md dist
  415. - if "%build_type%"=="Release" (cmake "-DCMAKE_INSTALL_PREFIX=%install_path%" -P "%build_path%/cmake_install.cmake")
  416. - dir dist\
  417. - echo "Output directory:"
  418. - dir %output_path%
  419. - echo "Build directory:"
  420. - dir %build_path%
  421. - if "%build_type%"=="Release" (echo "Install directory:")
  422. - if "%build_type%"=="Release" (dir %install_path%)
  423. - if "%build_type%"=="Release" (dir %install_path%\bin)
  424. - if "%build_type%"=="Release" (dir %install_path%\include)
  425. - if "%build_type%"=="Release" (dir %install_path%\lib)
  426. - if "%build_type%"=="Release" (copy "%install_path%"\include dist\)
  427. - if "%build_type%"=="Release" (copy "%install_path%"\bin\*.exe dist\)
  428. - echo "Dist directory:"
  429. - dir dist\
  430. cache:
  431. - C:\mingw-builds -> mingw.cmd
  432. - C:\third-party -> **\CMakeLists.txt
  433. - C:\ssl
  434. artifacts:
  435. - path: dist\*
  436. for:
  437. -
  438. matrix:
  439. only:
  440. - configuration: Release
  441. fast_finish: false
  442. allow_failures:
  443. # Experimental Ubuntu
  444. - id: Ubuntu1604-GCC-x64
  445. compiler: gcc-5.1.0-posix
  446. build_shared: NO
  447. no_files: NO
  448. enable_ipv6: YES
  449. enable_ssl: YES
  450. enable_websockets: YES
  451. no_cgi: NO
  452. no_caching: NO
  453. enable_stats: YES
  454. configuration: Release
  455. platform: x64
  456. image: Ubuntu1604
  457. - id: Ubuntu1804-GCC-x64
  458. compiler: gcc-5.1.0-posix
  459. build_shared: NO
  460. no_files: NO
  461. enable_ipv6: YES
  462. enable_ssl: YES
  463. enable_websockets: YES
  464. no_cgi: NO
  465. no_caching: NO
  466. enable_stats: YES
  467. configuration: Release
  468. platform: x64
  469. image: Ubuntu1804
  470. -
  471. matrix:
  472. only:
  473. - PYTHON: "C:\\Python37"
  474. install:
  475. - set PATH=%PATH%;%PYTHON%/Scripts/
  476. - pip.exe install conan conan_package_tools
  477. build: false
  478. test_script:
  479. - python build.py
  480. after_test: false