.appveyor.yml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. openssl_path: /c/OpenSSL-Win32
  14. mingw_prefix: mingw-w64-i686
  15. hardening:
  16. - target: x86_64-w64-mingw32
  17. compiler_path: mingw64
  18. openssl_path: /c/OpenSSL-Win64
  19. mingw_prefix: mingw-w64-x86_64
  20. hardening: --disable-gcc-hardening
  21. install:
  22. - ps: >-
  23. Function Execute-Command ($commandPath)
  24. {
  25. & $commandPath $args 2>&1
  26. if ( $LastExitCode -ne 0 ) {
  27. $host.SetShouldExit( $LastExitCode )
  28. }
  29. }
  30. Function Execute-Bash ()
  31. {
  32. Execute-Command 'c:\msys64\usr\bin\bash' '-e' '-c' $args
  33. }
  34. Execute-Command "C:\msys64\usr\bin\pacman" -Sy --needed --noconfirm openssl-devel openssl libevent-devel libevent ${env:mingw_prefix}-libevent ${env:mingw_prefix}-zstd ;
  35. build_script:
  36. - ps: >-
  37. if ($env:compiler -eq "mingw") {
  38. $oldpath = ${env:Path} -split ';'
  39. $buildpath = @("C:\msys64\${env:compiler_path}\bin", "C:\msys64\usr\bin") + $oldpath
  40. $env:Path = @($buildpath) -join ';'
  41. $env:build = @("${env:APPVEYOR_BUILD_FOLDER}", $env:target) -join '\'
  42. Set-Location "${env:APPVEYOR_BUILD_FOLDER}"
  43. Execute-Bash 'autoreconf -i'
  44. mkdir "${env:build}"
  45. Set-Location "${env:build}"
  46. Execute-Bash "which ${env:target}-gcc"
  47. Execute-Bash "${env:target}-gcc --version"
  48. Execute-Bash "../configure --prefix=/${env:compiler_path} --build=${env:target} --host=${env:target} --disable-asciidoc --enable-fatal-warnings --with-openssl-dir=${env:openssl_path} ${env:hardening}"
  49. Execute-Bash "V=1 make -j2"
  50. Execute-Bash "V=1 make -j2 install"
  51. }
  52. test_script:
  53. - ps: >-
  54. if ($env:compiler -eq "mingw") {
  55. $oldpath = ${env:Path} -split ';'
  56. $buildpath = @("C:\msys64\${env:compiler_path}\bin") + $oldpath
  57. $env:Path = $buildpath -join ';'
  58. Set-Location "${env:build}"
  59. Execute-Bash "VERBOSE=1 make -j2 check"
  60. }
  61. on_failure:
  62. - ps: >-
  63. if ($env:compiler -eq "mingw") {
  64. $oldpath = ${env:Path} -split ';'
  65. $buildpath = @("C:\msys64\usr\bin") + $oldpath
  66. $env:Path = @($buildpath) -join ';'
  67. Set-Location "${env:build}"
  68. Execute-Bash "7z a logs.zip config.log || true"
  69. Execute-Bash "7z a logs.zip test-suite.log || true"
  70. Execute-Bash "appveyor PushArtifact logs.zip || true"
  71. Execute-Bash "tail -1000 config.log || true"
  72. Execute-Bash "cat test-suite.log || true"
  73. }
  74. - cmd: C:\Python27\python.exe %APPVEYOR_BUILD_FOLDER%\scripts\test\appveyor-irc-notify.py irc.oftc.net:6697 tor-ci failure