Bump to 0.3.4.11
[tor.git] / .appveyor.yml
blob34e1c8b846b9c89b7ddf781ba7ab73c037c14722
1 version: 1.0.{build}
3 clone_depth: 50
5 environment:
6   compiler: mingw
8   matrix:
9   - target: i686-w64-mingw32
10     compiler_path: mingw32
11     mingw_prefix: mingw-w64-i686
12     hardening:
13   - target: x86_64-w64-mingw32
14     compiler_path: mingw64
15     mingw_prefix: mingw-w64-x86_64
16     # hardening doesn't work with mingw-w64-x86_64-gcc, because it's gcc 8
17     hardening: --disable-gcc-hardening
19 install:
20 - ps: >-
21     Function Execute-Command ($commandPath)
22     {
23         & $commandPath $args 2>&1
24         if ( $LastExitCode -ne 0 ) {
25             $host.SetShouldExit( $LastExitCode )
26         }
27     }
28     Function Execute-Bash ()
29     {
30         Execute-Command 'c:\msys64\usr\bin\bash' '-e' '-c' $args
31     }
32     <# mingw packages start with ${env:mingw_prefix}
33      # unprefixed packages are from MSYS2, which is like Cygwin. Avoid them.
34      #
35      # Use pacman --debug to show package downloads and install locations
36      #>
37     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 ;
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} --with-openssl-dir=/${env:compiler_path} --disable-asciidoc --enable-fatal-warnings ${env:hardening}"
58             Execute-Bash "V=1 make -j2"
59             Execute-Bash "V=1 make -j2 install"
60      }
62 test_script:
63 - ps: >-
64     if ($env:compiler -eq "mingw") {
65             <# use the MSYS2 compiler binaries to make check #>
66             $oldpath = ${env:Path} -split ';'
67             $buildpath = @("C:\msys64\${env:compiler_path}\bin") + $oldpath
68             $env:Path = $buildpath -join ';'
69             Set-Location "${env:build}"
70             Execute-Bash "VERBOSE=1 make -j2 check"
71     }
73 on_finish:
74 - ps: >-
75     if ($env:compiler -eq "mingw") {
76             <# use the MSYS2 user binaries to archive failures #>
77             $oldpath = ${env:Path} -split ';'
78             $buildpath = @("C:\msys64\usr\bin") + $oldpath
79             $env:Path = @($buildpath) -join ';'
80             Set-Location "${env:build}"
81             <# store logs as appveyor artifacts: see the artifacts tab #>
82             Execute-Bash "7z a logs.zip config.log || true"
83             Execute-Bash "7z a logs.zip test-suite.log || true"
84             Execute-Bash "appveyor PushArtifact logs.zip || true"
85             Execute-Bash "tail -1000 config.log || true"
86             Execute-Bash "cat test-suite.log || true"
87     }
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