Factor out function to decode 2 hex digits
[xapian.git] / .appveyor.yml
blob3857eb8bc5c563a2379227dab687b16f318f2f2f
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 2019
20   - TOOLCHAIN: mingw64
21     platform: x64
22     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
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 2019
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-8.1.0-posix-dwarf-rt_v6-rev0\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-8.1.0-posix-seh-rt_v6-rev0\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   - if "%TOOLCHAIN%"=="mingw64" appveyor-retry bash -c 'pacman -Sy --noconfirm zlib-devel'
103   # Work around odd ownership of directories in CI build image.
104   - if "%TOOLCHAIN%"=="cygwin" bash -c 'git config --global --add safe.directory /cygdrive/c/projects/xapian'
105   # Install cygwin git and patch packages since those installed in the image
106   # want the 32-bit cygwin1.dll which means they fail to work if the 64-bit
107   # cygwin1.dll is first on PATH.
108   - 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
109   - 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
110   - bash -c 'time ./bootstrap --fetch-url-command="curl --retry 5 --retry-connrefused -L" xapian-core'
111   - if defined VCVARS_BAT call %VCVARS_BAT%
112   - if "%TOOLCHAIN%"=="msvc" mkdir zlib
113   - if "%TOOLCHAIN%"=="msvc" cd zlib
114   - 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 -'
115   # Don't build zlib with -MD as it seems this flag needs to be used
116   # consistently across the build.
117   - if "%TOOLCHAIN%"=="msvc" sed -i 's/\(^CFLAGS  *= *-nologo \)-MD /\1/' win32/Makefile.msc
118   # Don't build zlib with a fixed base address on x64 as that gives linker
119   # warning LNK4281.
120   - if "%TOOLCHAIN%-%Platform%"=="msvc-x64" sed -i 's/-base:0x[0-9A-Fa-f]* //' win32/Makefile.msc
121   - if "%TOOLCHAIN%"=="msvc" nmake -nologo -f win32\Makefile.msc
122   - if "%TOOLCHAIN%"=="msvc" cd ..
123   # Fetch pre-built unicode-data.cc to avoid having to get working tclsh.
124   - curl --retry 5 --retry-connrefused https://oligarchy.co.uk/xapian/patches/unicode-data.cc > xapian-core\unicode\unicode-data.cc
125   - ps: >-
126       if ($env:TOOLCHAIN -eq "msvc") {
127         $env:CC="cl -nologo"
128         $env:CXX="c:/projects/xapian/INST/share/automake-1.16/compile cl -nologo"
129         $env:CXXFLAGS="-EHsc"
130         $env:CPPFLAGS="-Ic:/projects/xapian/zlib"
131         $env:AR="lib"
132         $env:LDFLAGS="-Lc:/projects/xapian/zlib"
133       }
134 build_script:
135   - bash -c 'time ./configure $CONFIGOPTS'
136   - bash -c 'time make -j2' < nul
137 test_script:
138   - bash -c 'time make check VERBOSE=1' < nul