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