.appveyor.yml 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. version: 1.0.{build}
  2. clone_depth: 50
  3. image:
  4. # Windows Server 2012 R2
  5. - Visual Studio 2015
  6. # Windows Server 2016
  7. - Visual Studio 2017
  8. environment:
  9. compiler: mingw
  10. matrix:
  11. - target: i686-w64-mingw32
  12. compiler_path: mingw32
  13. mingw_prefix: mingw-w64-i686
  14. hardening:
  15. - target: x86_64-w64-mingw32
  16. compiler_path: mingw64
  17. mingw_prefix: mingw-w64-x86_64
  18. # hardening doesn't work with mingw-w64-x86_64-gcc, because it's gcc 8
  19. hardening: --disable-gcc-hardening
  20. install:
  21. - ps: >-
  22. Function Execute-Command ($commandPath)
  23. {
  24. & $commandPath $args 2>&1
  25. if ( $LastExitCode -ne 0 ) {
  26. $host.SetShouldExit( $LastExitCode )
  27. }
  28. }
  29. Function Execute-Bash ()
  30. {
  31. Execute-Command 'c:\msys64\usr\bin\bash' '-e' '-c' $args
  32. }
  33. <# mingw packages start with ${env:mingw_prefix}
  34. # unprefixed packages are from MSYS2, which is like Cygwin. Avoid them.
  35. #
  36. # Use pacman --debug to show package downloads and install locations
  37. #>
  38. Execute-Command "C:\msys64\usr\bin\pacman" -Sy --verbose --needed --noconfirm ${env:mingw_prefix}-libevent ${env:mingw_prefix}-openssl ${env:mingw_prefix}-pkg-config ${env:mingw_prefix}-xz ${env:mingw_prefix}-zstd ;
  39. build_script:
  40. - ps: >-
  41. if ($env:compiler -eq "mingw") {
  42. <# use the MSYS2 compiler and user binaries to build and install #>
  43. $oldpath = ${env:Path} -split ';'
  44. $buildpath = @("C:\msys64\${env:compiler_path}\bin", "C:\msys64\usr\bin") + $oldpath
  45. $env:Path = @($buildpath) -join ';'
  46. $env:build = @("${env:APPVEYOR_BUILD_FOLDER}", $env:target) -join '\'
  47. Set-Location "${env:APPVEYOR_BUILD_FOLDER}"
  48. Execute-Bash 'autoreconf -i'
  49. mkdir "${env:build}"
  50. Set-Location "${env:build}"
  51. Execute-Bash "which ${env:target}-gcc"
  52. Execute-Bash "${env:target}-gcc --version"
  53. <# compile for mingw
  54. # mingw zstd doesn't come with a pkg-config file, so we manually
  55. # configure its flags. liblzma just works.
  56. #>
  57. Execute-Bash "ZSTD_CFLAGS='-L/${env:compiler_path}/include' ZSTD_LIBS='-L/${env:compiler_path}/lib -lzstd' ../configure --prefix=/${env:compiler_path} --build=${env:target} --host=${env:target} --disable-asciidoc --enable-fatal-warnings ${env:hardening}"
  58. Execute-Bash "V=1 make -j2"
  59. Execute-Bash "V=1 make -j2 install"
  60. }
  61. test_script:
  62. - ps: >-
  63. if ($env:compiler -eq "mingw") {
  64. <# use the MSYS2 compiler binaries to make check #>
  65. $oldpath = ${env:Path} -split ';'
  66. $buildpath = @("C:\msys64\${env:compiler_path}\bin") + $oldpath
  67. $env:Path = $buildpath -join ';'
  68. Set-Location "${env:build}"
  69. Execute-Bash "VERBOSE=1 make -j2 check"
  70. }
  71. on_finish:
  72. - ps: >-
  73. if ($env:compiler -eq "mingw") {
  74. <# use the MSYS2 user binaries to archive failures #>
  75. $oldpath = ${env:Path} -split ';'
  76. $buildpath = @("C:\msys64\usr\bin") + $oldpath
  77. $env:Path = @($buildpath) -join ';'
  78. Set-Location "${env:build}"
  79. <# store logs as appveyor artifacts: see the artifacts tab #>
  80. Execute-Bash "7z a logs.zip config.log || true"
  81. Execute-Bash "7z a logs.zip test-suite.log || true"
  82. Execute-Bash "appveyor PushArtifact logs.zip || true"
  83. Execute-Bash "tail -1000 config.log || true"
  84. Execute-Bash "cat test-suite.log || true"
  85. }
  86. # notify the IRC channel of any failures
  87. on_failure:
  88. - cmd: C:\Python27\python.exe %APPVEYOR_BUILD_FOLDER%\scripts\test\appveyor-irc-notify.py irc.oftc.net:6697 tor-ci failure