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