Sync common code between configure.ac files
[xapian.git] / .appveyor.yml
blob78285b65b83501ab8897e7461311017dca9bb823
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   matrix:
14   - TOOLCHAIN: mingw
15     platform: x86
16     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
17 # - TOOLCHAIN: mingw64
18 #   platform: x86
19 #   APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
20 # - TOOLCHAIN: mingw64
21 #   platform: x64
22 #   APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
23 # Fails trying to run apitest.exe etc for unknown reasons.
24 #  - TOOLCHAIN: cygwin
25 #    APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
26 #    platform: x86
27 # - TOOLCHAIN: cygwin
28 #   platform: x64
29 #   APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
30   - TOOLCHAIN: msvc
31     platform: x86
32     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
33     VCVARS_BAT: "\"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat\" x86"
34   - TOOLCHAIN: msvc
35     platform: x64
36     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
37     VCVARS_BAT: "\"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat\" x64"
38   - TOOLCHAIN: msvc
39     platform: x86
40     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
41     VCVARS_BAT: "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvars32.bat\""
42   - TOOLCHAIN: msvc
43     platform: x64
44     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
45     VCVARS_BAT: "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\""
46   - TOOLCHAIN: msvc
47     platform: x86
48     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
49     VCVARS_BAT: "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvars32.bat\""
50   - TOOLCHAIN: msvc
51     platform: x64
52     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
53     VCVARS_BAT: "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\""
54   - TOOLCHAIN: msvc
55     platform: x86
56     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
57     VCVARS_BAT: "\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvars32.bat\""
58   - TOOLCHAIN: msvc
59     platform: x64
60     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
61     VCVARS_BAT: "\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\""
62 matrix:
63   allow_failures:
64   # mingw build currently sometimes fails due to trying to delete open files.
65   # It's unclear what the problem is, so until we manage to debug this allow
66   # this build to fail without flagging CI as having failed.
67   - TOOLCHAIN: mingw
68     platform: x86
69 install:
70   - ps: >-
71       $env:CONFIGOPTS="--disable-documentation"
72   - ps: >-
73       if ($env:TOOLCHAIN -eq "mingw") {
74         $env:PATH="C:\Mingw\bin;C:\Mingw\MSYS\1.0\bin;$env:PATH"
75       } elseif ($env:TOOLCHAIN -eq "mingw64") {
76         if ($env:Platform -eq "x86") {
77           $env:PATH="C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin;C:\msys64\usr\bin;$env:PATH"
78           $env:CONFIGOPTS+=" --host=i686-pc-mingw32"
79         } else {
80           $env:PATH="C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;C:\msys64\usr\bin;$env:PATH"
81           $env:CONFIGOPTS+=" --host=x86_64-w64-mingw32"
82         }
83       } elseif ($env:TOOLCHAIN -eq "cygwin") {
84         # Use 64-bit cygwin install for 32 bit build too to avoid DLL mapping issues.
85         $env:PATH="C:\cygwin64\bin;$env:PATH"
86         if ($env:Platform -eq "x86") {
87           $env:CONFIGOPTS+=" --host=i686-pc-cygwin"
88         } else {
89           $env:CONFIGOPTS+=" --host=x86_64-pc-cygwin"
90         }
91       } elseif ($env:TOOLCHAIN -eq "llvm") {
92         $env:PATH="C:\Program Files\LLVM\bin;c:\msys64\usr\bin;$env:PATH"
93       } else {
94         $env:PATH="c:\msys64\usr\bin;$env:PATH"
95       }
96   - ps: >-
97       if ($env:TOOLCHAIN -ne "cygwin") {
98         $env:CONFIGOPTS+=" --disable-backend-honey"
99       }
100   - if "%TOOLCHAIN%"=="mingw" bash -c "echo 'c:/mingw /mingw' >> /etc/fstab"
101   - if "%TOOLCHAIN%"=="mingw" appveyor-retry bash -c 'mingw-get install libz-dev'
102   # Workaround appveyor's container having old maintainer keys:
103   - if "%TOOLCHAIN%"=="mingw64" appveyor-retry bash -c 'curl -O https://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz'
104   - if "%TOOLCHAIN%"=="mingw64" appveyor-retry bash -c 'curl -O https://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig'
105   - if "%TOOLCHAIN%"=="mingw64" appveyor-retry bash -c 'pacman-key --verify msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig'
106   - if "%TOOLCHAIN%"=="mingw64" appveyor-retry bash -c 'pacman -U --noconfirm msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz'
107   - if "%TOOLCHAIN%"=="mingw64" appveyor-retry bash -c 'pacman -Sy --noconfirm zlib-devel'
108   # Install cygwin git and patch packages since those installed in the image
109   # want the 32-bit cygwin1.dll which means they fail to work if the 64-bit
110   # cygwin1.dll is first on PATH.
111   - if "%TOOLCHAIN%-%Platform%"=="cygwin-x64" appveyor-retry 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 -P git -P patch
112   - if "%TOOLCHAIN%-%Platform%"=="cygwin-x86" appveyor-retry 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++ -P git -P patch
113   - bash -c 'time ./bootstrap --fetch-url-command="curl --retry 5 --retry-connrefused -L" xapian-core'
114   - if defined VCVARS_BAT call %VCVARS_BAT%
115   - if "%TOOLCHAIN%"=="msvc" mkdir zlib
116   - if "%TOOLCHAIN%"=="msvc" cd zlib
117   - if "%TOOLCHAIN%"=="msvc" bash -c 'curl --retry 5 --retry-connrefused -L https://github.com/xapian/xapian-dev-deps/releases/download/current/zlib-1.2.11.tar.gz|tar --strip-components=1 -zxf -'
118   # Don't build zlib with -MD as it seems this flag needs to be used
119   # consistently across the build.
120   - if "%TOOLCHAIN%"=="msvc" sed -i 's/\(^CFLAGS  *= *-nologo \)-MD /\1/' win32/Makefile.msc
121   # Don't build zlib with a fixed base address on x64 as that gives linker
122   # warning LNK4281.
123   - if "%TOOLCHAIN%-%Platform%"=="msvc-x64" sed -i 's/-base:0x[0-9A-Fa-f]* //' win32/Makefile.msc
124   - if "%TOOLCHAIN%"=="msvc" nmake -nologo -f win32\Makefile.msc
125   - if "%TOOLCHAIN%"=="msvc" cd ..
126   # Fetch pre-built unicode-data.cc to avoid having to get working tclsh.
127   - curl --retry 5 --retry-connrefused https://oligarchy.co.uk/xapian/patches/unicode-data.cc > xapian-core\unicode\unicode-data.cc
128   - ps: >-
129       if ($env:TOOLCHAIN -eq "msvc") {
130         $env:CC="cl -nologo"
131         $env:CXX="c:/projects/xapian/INST/share/automake-1.16/compile cl -nologo"
132         $env:CXXFLAGS="-EHsc"
133         $env:CPPFLAGS="-Ic:/projects/xapian/zlib"
134         $env:AR="lib"
135         $env:LDFLAGS="-Lc:/projects/xapian/zlib"
136       }
137 build_script:
138   - bash -c 'time ./configure $CONFIGOPTS'
139   - bash -c 'time make -j2' < nul
140 test_script:
141   - bash -c 'time make check VERBOSE=1' < nul