.appveyor.yml 3.9 KB

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