bootstrap: Add --fetch-url-command option
[xapian.git] / .appveyor.yml
blob02bc16514b1f5cd1382fdba9a8754f65d6001034
1 skip_tags: true
2 # A full clone takes 30 seconds, depth 20 takes 5 seconds.
4 # Using "shallow_clone: true" downloads the commit as a ZIP file so you might
5 # think that would be quicker still, but actually it seems to take ~15 seconds,
6 # and then bootstrap fails due to there not being a ".git" directory.
7 clone_depth: 20
8 # Specify clone_folder so we can hard-code the Unix path equivalent below.
9 clone_folder: c:\projects\xapian
10 environment:
11   global:
12     AUTOMATED_TESTING: 1
13     FETCH_URL_TOOL: curl -L
14   matrix:
15   - TOOLCHAIN: mingw
16     platform: x86
17   - TOOLCHAIN: mingw64
18     platform: x86
19   - TOOLCHAIN: mingw64
20     platform: x64
21 # Fails trying to run apitest.exe etc for unknown reasons.
22 #  - TOOLCHAIN: cygwin
23 #   platform: x86
24   - TOOLCHAIN: cygwin
25     platform: x64
26   - TOOLCHAIN: msvc
27     platform: x86
28     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
29     VCVARS_BAT: "\"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat\" x86"
30 # We get exit code 127 trying to run apitest.exe but no error message.
31 # Other test programs which link to libxapian fail too.  unittest.exe OK.
32 #  - TOOLCHAIN: msvc
33 #    platform: x64
34 #    APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
35 #    VCVARS_BAT: "\"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat\" x64"
36   - TOOLCHAIN: msvc
37     platform: x86
38     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
39     VCVARS_BAT: "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvars32.bat\""
40   - TOOLCHAIN: msvc
41     platform: x64
42     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
43     VCVARS_BAT: "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\""
44 install:
45   - ps: >-
46       $env:CONFIGOPTS="--disable-documentation"
47   - ps: >-
48       if ($env:TOOLCHAIN -eq "mingw") {
49         $env:PATH="C:\Mingw\bin;C:\Mingw\MSYS\1.0\bin;$env:PATH"
50       } elseif ($env:TOOLCHAIN -eq "mingw64") {
51         if ($env:Platform -eq "x86") {
52           $env:PATH="C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin;C:\msys64\usr\bin;$env:PATH"
53           $env:CONFIGOPTS+=" --host=i686-pc-mingw32"
54         } else {
55           $env:PATH="C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;C:\msys64\usr\bin;$env:PATH"
56           $env:CONFIGOPTS+=" --host=x86_64-w64-mingw32"
57         }
58       } elseif ($env:TOOLCHAIN -eq "cygwin") {
59         # Use 64-bit cygwin install for 32 bit build too to avoid DLL mapping issues.
60         $env:PATH="C:\cygwin64\bin;$env:PATH"
61         if ($env:Platform -eq "x86") {
62           $env:CONFIGOPTS+=" --host=i686-pc-cygwin"
63         } else {
64           $env:CONFIGOPTS+=" --host=x86_64-pc-cygwin"
65         }
66       } elseif ($env:TOOLCHAIN -eq "llvm") {
67         $env:PATH="C:\Program Files\LLVM\bin;c:\msys64\usr\bin;$env:PATH"
68       } else {
69         $env:PATH="c:\msys64\usr\bin;$env:PATH"
70       }
71   - ps: >-
72       if ($env:TOOLCHAIN -ne "cygwin") {
73         $env:CONFIGOPTS+=" --disable-backend-honey"
74       }
75   - if "%TOOLCHAIN%"=="mingw" bash -c "echo 'c:/mingw /mingw' >> /etc/fstab"
76   - if "%TOOLCHAIN%"=="mingw" bash -c 'mingw-get install libz-dev'
77   - if "%TOOLCHAIN%"=="mingw64" bash -c 'pacman -Sy --noconfirm zlib-devel'
78   - if "%TOOLCHAIN%-%Platform%"=="cygwin-x64" C:\cygwin64\setup-x86_64.exe -qnNdO -R C:/cygwin64 -s http://cygwin.mirror.constant.com -l C:/cygwin64/var/cache/setup -P zlib-devel
79   - if "%TOOLCHAIN%-%Platform%"=="cygwin-x86" C:\cygwin64\setup-x86_64.exe -qnNdO -R C:/cygwin64 -s http://cygwin.mirror.constant.com -l C:/cygwin64/var/cache/setup -P cygwin32-zlib -P cygwin32-gcc-core -P cygwin32-gcc-g++
80   - bash -c 'time ./bootstrap xapian-core'
81   - if "%TOOLCHAIN%"=="msvc" call %VCVARS_BAT%
82   - if "%TOOLCHAIN%"=="msvc" bash -c 'wget https://zlib.net/zlib-1.2.11.tar.gz && tar -xf zlib-1.2.11.tar.gz && mv zlib-1.2.11 zlib'
83   - if "%TOOLCHAIN%"=="msvc" cd zlib
84   - if "%TOOLCHAIN%"=="msvc" nmake -nologo -f win32\Makefile.msc
85   - if "%TOOLCHAIN%"=="msvc" cd ..
86   # Fetch pre-built unicode-data.cc to avoid having to get working tclsh.
87   - curl https://oligarchy.co.uk/xapian/patches/unicode-data.cc > xapian-core\unicode\unicode-data.cc
88   - ps: >-
89       if ($env:TOOLCHAIN -eq "msvc") {
90         $env:CC="cl -nologo"
91         $env:CXX="c:/projects/xapian/INST/share/automake-1.15/compile cl -nologo"
92         $env:CXXFLAGS="-EHsc"
93         $env:CPPFLAGS="-Ic:/projects/xapian/zlib"
94         $env:AR="lib"
95         $env:LDFLAGS="-Lc:/projects/xapian/zlib"
96       }
97 build_script:
98   - bash -c 'time ./configure $CONFIGOPTS'
99   - bash -c 'time make -j2' < nul
100 test_script:
101   - bash -c 'time make check VERBOSE=1' < nul