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