Cache control file
[tor/appveyor.git] / .appveyor.yml
bloba33f13d48113633033625e59f99ae61ad32b92b4
1 version: 1.0.{build}\r
2 \r
3 clone_depth: 50\r
4 \r
5 environment:\r
6   compiler: mingw\r
7 \r
8   matrix:\r
9   - target: i686-w64-mingw32\r
10     compiler_path: mingw32\r
11     openssl_path: /c/OpenSSL-Win32\r
12   - target: x86_64-w64-mingw32\r
13     compiler_path: mingw64\r
14     openssl_path: /c/OpenSSL-Win64\r
16 install:\r
17 - ps: >-\r
18     Function Execute-Command ($commandPath)\r
19     {\r
20         & $commandPath $args 2>&1\r
21         if ( $LastExitCode -ne 0 ) {\r
22             $host.SetShouldExit( $LastExitCode )\r
23         }\r
24     }\r
25     Function Execute-Bash ()\r
26     {\r
27         Execute-Command 'c:\msys64\usr\bin\bash' '-e' '-c' $args\r
28     }\r
29     if ($env:compiler -eq "mingw") {\r
30             $oldpath = ${env:Path} -split ';'\r
31             $buildpath = @("C:\msys64\${env:compiler_path}\bin", "C:\msys64\usr\bin") + $oldpath\r
32             $env:Path = @($buildpath) -join ';'\r
33             $env:libeventversionfile = @("${env:APPVEYOR_BUILD_FOLDER}", ".appveyor-libevent-version") -join '\'\r
34             $env:libeventversion = Get-Content "${env:libeventversionfile}" | Out-String\r
35             Set-Location ".."\r
36             Execute-Bash "git clone https://github.com/libevent/libevent"\r
37             Set-Location "libevent"\r
38             $env:buildlibevent = (Get-Item -Path ".\").FullName\r
39             Execute-Bash "git checkout -q ${env:libeventversion}"\r
40             Execute-Bash "./autogen.sh"\r
41             Execute-Bash "./configure --prefix=/${env:compiler_path} --host=${env:target} --disable-libevent-regress --disable-samples --disable-openssl"\r
42             Execute-Bash "make -j2 install"\r
43     }\r
45 build_script:\r
46 - ps: >-\r
47     if ($env:compiler -eq "mingw") {\r
48             $oldpath = ${env:Path} -split ';'\r
49             $buildpath = @("C:\msys64\${env:compiler_path}\bin", "C:\msys64\usr\bin") + $oldpath\r
50             $env:Path = @($buildpath) -join ';'\r
51             $env:build = @("${env:APPVEYOR_BUILD_FOLDER}", $env:target) -join '\'\r
52             Set-Location "${env:APPVEYOR_BUILD_FOLDER}"\r
53             Execute-Bash 'autoreconf -i'\r
54             mkdir "${env:build}"\r
55             Set-Location "${env:build}"\r
56             Execute-Bash "../configure --prefix=/${env:compiler_path} --build=${env:target} --host=${env:target} --disable-asciidoc --enable-fatal-warnings --with-libevent-dir=${env:APPVEYOR_BUILD_FOLDER}/libevent --with-openssl-dir=${env:openssl_path}"\r
57             Execute-Bash "V=1 make -j2"\r
58             Execute-Bash "V=1 make -j2 install"\r
59      }\r
61 test_script:\r
62 - ps: >-\r
63     if ($env:compiler -eq "mingw") {\r
64             $oldpath = ${env:Path} -split ';'\r
65             $buildpath = @("C:\msys64\${env:compiler_path}\bin") + $oldpath\r
66             $env:Path = $buildpath -join ';'\r
67             Set-Location "${env:build}"\r
68             Execute-Bash "VERBOSE=1 make -j2 check"\r
69     }\r
71 on_success:\r
72 - cmd: C:\Python27\python.exe %APPVEYOR_BUILD_FOLDER%\scripts\test\appveyor-irc-notify.py irc.oftc.net:6697 tor-ci success\r
74 on_failure:\r
75 - cmd: C:\Python27\python.exe %APPVEYOR_BUILD_FOLDER%\scripts\test\appveyor-irc-notify.py irc.oftc.net:6697 tor-ci failure\r
77 ## Uncomment to print Remote Desktop Connection details for the build worker:\r
78 # on_finish:\r
79 # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))\r
81 # Cache our libevent build so that we don't have to rebuild it every time.\r
82 # Re-builds will happen whenever the powershell portion of the "install"\r
83 # section of this file changes.\r
84 cache:\r
85 - C:\projects\libevent -> "${env:APPVEYOR_BUILD_FOLDER}\.appveyor-libevent-version"\r