[ci] Test Tcl bindings for dragonfly/freebsd
[xapian.git] / .github / workflows / ci.yml
blob94315fc1921399e7eda215a311902dc9867a8c0c
1 name: CI
3 # Use bash by default on all platforms.
4 defaults:
5   run:
6     shell: bash
8 on:
9   push:
10     paths-ignore:
11       - '.appveyor.yml'
12       - NEWS
13       - 'xapian-maintainer-tools/**'
14   pull_request:
15     branches: master
16     paths-ignore:
17       - '.appveyor.yml'
18       - NEWS
19       - 'xapian-maintainer-tools/**'
21   # Allows you to run this workflow manually from the Actions tab
22   workflow_dispatch:
24 jobs:
25   makedist:
26     name: 'make dist'
27     runs-on: 'ubuntu-latest'
28     env:
29       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
30     steps:
31     - name: Check out repository code
32       uses: actions/checkout@v4
33       with:
34         show-progress: false
35     - name: Install CCache
36       uses: hendrikmuhs/ccache-action@v1
37       with:
38         key: ${{ github.job }}
39     - name: Cache bootstrap tools
40       uses: actions/cache@v4
41       with:
42         path: |
43           BUILD
44           INST
45         key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles( 'bootstrap', 'patches/**' ) }}
46     - name: Install package dependencies
47       run: |
48         sudo apt-get update
49         sudo apt-get install \
50             doxygen \
51             graphviz \
52             help2man \
53             python3-docutils \
54             pngcrush \
55             python3-sphinx \
56             uuid-dev \
57             libpcre2-dev \
58             libmagic-dev \
59             lua5.4 \
60             liblua5.4-dev \
61             mono-devel \
62             python3-dev \
63             tcl \
64             tcl-dev \
65             libicu-dev \
66             pkg-config \
67             libpoppler-glib-dev \
68             libglib2.0-dev \
69             libe-book-dev \
70             libetonyek-dev \
71             libgepub-0.6-dev \
72             libgmime-3.0-dev \
73             libarchive-dev \
74             libabw-dev \
75             libcdr-dev \
76             libextractor-dev \
77             libextractor-plugins-all \
78             libmwaw-dev \
79             libreofficekit-dev libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-writer \
80             libtesseract-dev \
81             tesseract-ocr-eng
82     - name: bootstrap source tree
83       run: |
84         # If we restored cached bootstrap tools their timestamps will be older
85         # than checked out files, but we stored them based on a hash of the
86         # files in git that determine what gets built so we know they are in
87         # fact up to date.  Just touch any stamp files that exist.
88         touch --no-create INST/*.stamp
89         export PATH=/usr/lib/ccache:$PATH
90         echo verbose=off > ~/.wgetrc
91         ./bootstrap xapian-core xapian-applications/omega swig xapian-bindings xapian-letor
92     - name: configure
93       run: ./configure CC='ccache gcc' CXX='ccache g++'
94     - name: make
95       run: make -j2
96     - name: Run tests
97       run: make -j2 check AUTOMATED_TESTING=1 VERBOSE=1
98     - name: Create distribution tarball
99       run: |
100         make dist
101     - uses: actions/upload-artifact@v4
102       with:
103         path: |
104           xapian-core/xapian-core-*.tar.xz
105           xapian-applications/omega/xapian-omega-*.tar.xz
106           xapian-bindings/xapian-bindings-*.tar.xz
107           xapian-letor/xapian-letor-*.tar.xz
108         # Files are already compressed so don't try to compress again.
109         compression-level: 0
110         retention-days: 1
111         if-no-files-found: error
112     - name: Check generated files are in .gitignore
113       # grep '^' passes through all input while giving a non-zero exit status
114       # if that input is empty.
115       run: git status --porcelain|grep '^' && { echo "The generated files listed above are not in .gitignore" ; exit 1; }; true
117   clang-santisers:
118     runs-on: 'ubuntu-latest'
119     env:
120       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
121     needs: makedist
122     steps:
123     - name: Install CCache
124       uses: hendrikmuhs/ccache-action@v1
125       with:
126         key: ${{ github.job }}
127     - name: Fetch distribution
128       uses: actions/download-artifact@v4
129     - name: Unpack distribution
130       run: |
131         mv artifact/* .
132         rmdir artifact
133         pushd xapian-core
134         tar --strip-components=1 -xf xapian-core-*.tar.xz
135         popd
136         pushd xapian-applications/omega
137         tar --strip-components=1 -xf xapian-omega-*.tar.xz
138         popd
139         # pushd xapian-bindings
140         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
141         # popd
142         pushd xapian-letor
143         tar --strip-components=1 -xf xapian-letor-*.tar.xz
144         popd
145     - name: Install package dependencies
146       run: |
147         sudo apt-get update
148         sudo apt-get install \
149             python3-sphinx \
150             uuid-dev \
151             libpcre2-dev \
152             libmagic-dev \
153             lua5.4 \
154             liblua5.4-dev \
155             mono-devel \
156             python3-dev \
157             tcl \
158             tcl-dev \
159             libicu-dev \
160             pkg-config \
161             libpoppler-glib-dev \
162             libglib2.0-dev \
163             libe-book-dev \
164             libetonyek-dev \
165             libgepub-0.6-dev \
166             libgmime-3.0-dev \
167             libarchive-dev \
168             libabw-dev \
169             libcdr-dev \
170             libextractor-dev \
171             libmwaw-dev \
172             libreofficekit-dev libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-writer \
173             libtesseract-dev \
174             tesseract-ocr-eng
175     - name: configure
176       run: |
177         # We use clang here because (at least currently) it supports a few
178         # extra sanitiser checks compared to GCC.
179         export CC='ccache clang'
180         export CXX='ccache clang++'
181         # float-divide-by-zero, nullability and unsigned-overflow aren't
182         # undefined behaviour checks, but they catch for things we don't expect
183         # our code to do.
184         export CXXFLAGS='-fsanitize=address,undefined,float-divide-by-zero,local-bounds,nullability,unsigned-integer-overflow -fsanitize-address-use-after-scope -fsanitize-recover=all -g -O2 -fno-omit-frame-pointer'
185         pushd xapian-core
186         ./configure --enable-werror
187         export XAPIAN_CONFIG=$PWD/xapian-config
188         popd
189         pushd xapian-applications/omega
190         ./configure --enable-werror
191         popd
192         # pushd xapian-bindings
193         ## PHP calls dlopen() with "RTLD_DEEPBIND flag which is incompatible
194         ## with sanitizer runtime".
195         ##
196         ## Other bindings should work, but need to debug why they fail to
197         ## work properly currently (with Lua, Python and Tcl we fail to find the
198         ## symbol __ubsan_handle_function_type_mismatch when the module is
199         ## loaded which seems like a setup problem).
200         # ./configure --enable-werror --without-lua --without-php --without-python3 --without-tcl
201         # popd
202         pushd xapian-letor
203         ./configure --enable-werror
204         popd
205     - name: make
206       run: |
207         make -j2 -C xapian-core
208         make -j2 -C xapian-applications/omega
209         # make -j2 -C xapian-bindings MACOS_SIP_HACK_ENV='env LSAN_OPTIONS=leak_check_at_exit=0 LD_PRELOAD=libasan.so.8:libubsan.so.1'
210         make -j2 -C xapian-letor
211     - name: Run tests
212       run: |
213         export AUTOMATED_TESTING=1
214         export VERBOSE=1
215         make -j2 -C xapian-core check
216         make -j2 -C xapian-applications/omega check
217         # make -j2 -C xapian-bindings check MACOS_SIP_HACK_ENV='env LSAN_OPTIONS=leak_check_at_exit=0 LD_PRELOAD=libasan.so.8:libubsan.so.1'
218         make -j2 -C xapian-letor check
220   GLIBCXX_DEBUG:
221     runs-on: 'ubuntu-20.04'
222     env:
223       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
224     needs: makedist
225     steps:
226     - name: Install CCache
227       uses: hendrikmuhs/ccache-action@v1
228       with:
229         key: ${{ github.job }}
230     - name: Fetch distribution
231       uses: actions/download-artifact@v4
232     - name: Unpack distribution
233       run: |
234         mv artifact/* .
235         rmdir artifact
236         pushd xapian-core
237         tar --strip-components=1 -xf xapian-core-*.tar.xz
238         popd
239         pushd xapian-applications/omega
240         tar --strip-components=1 -xf xapian-omega-*.tar.xz
241         popd
242         pushd xapian-bindings
243         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
244         popd
245         pushd xapian-letor
246         tar --strip-components=1 -xf xapian-letor-*.tar.xz
247         popd
248     - name: Install package dependencies
249       run: |
250         sudo apt-get update
251         sudo apt-get install \
252             python3-sphinx \
253             uuid-dev \
254             libpcre2-dev \
255             libmagic-dev \
256             lua5.3 \
257             liblua5.3-dev \
258             mono-devel \
259             python3-dev \
260             tcl \
261             tcl-dev \
262             libicu-dev \
263             pkg-config \
264             libpoppler-glib-dev \
265             libglib2.0-dev \
266             libe-book-dev \
267             libetonyek-dev \
268             libgepub-0.6-dev \
269             libgmime-2.6-dev \
270             libarchive-dev \
271             libabw-dev \
272             libcdr-dev \
273             libextractor-dev \
274             libmwaw-dev \
275             libreofficekit-dev libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-writer
276       # tesseract's C++ API uses std::vector so would need rebuilding with
277       # -D_GLIBCXX_DEBUG too.
278       #      libtesseract-dev \
279       #      tesseract-ocr-eng
280     - name: configure
281       run: |
282         export CC='ccache gcc'
283         export CXX='ccache g++'
284         export CPPFLAGS='-D_GLIBCXX_DEBUG'
285         pushd xapian-core
286         ./configure --enable-werror
287         export XAPIAN_CONFIG=$PWD/xapian-config
288         popd
289         pushd xapian-applications/omega
290         ./configure --enable-werror
291         popd
292         pushd xapian-bindings
293         ./configure --enable-werror
294         popd
295         pushd xapian-letor
296         ./configure --enable-werror
297         popd
298     - name: make
299       run: |
300         make -j2 -C xapian-core
301         make -j2 -C xapian-applications/omega
302         make -j2 -C xapian-bindings
303         make -j2 -C xapian-letor
304     - name: Run tests
305       run: |
306         export AUTOMATED_TESTING=1
307         export VERBOSE=1
308         make -j2 -C xapian-core check
309         make -j2 -C xapian-applications/omega check
310         make -j2 -C xapian-bindings check
311         make -j2 -C xapian-letor check
313   FORTIFY_SOURCE_3:
314     # _FORTIFY_SOURCE level 3 requires GCC 12, so currently we need to use
315     # Ubuntu 22.04 and the gcc-12 and g++12 packages.
316     runs-on: 'ubuntu-22.04'
317     env:
318       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
319     needs: makedist
320     steps:
321     - name: Install CCache
322       uses: hendrikmuhs/ccache-action@v1
323       with:
324         key: ${{ github.job }}
325     - name: Fetch distribution
326       uses: actions/download-artifact@v4
327     - name: Unpack distribution
328       run: |
329         mv artifact/* .
330         rmdir artifact
331         pushd xapian-core
332         tar --strip-components=1 -xf xapian-core-*.tar.xz
333         popd
334         pushd xapian-applications/omega
335         tar --strip-components=1 -xf xapian-omega-*.tar.xz
336         popd
337         pushd xapian-bindings
338         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
339         popd
340         pushd xapian-letor
341         tar --strip-components=1 -xf xapian-letor-*.tar.xz
342         popd
343     - name: Install package dependencies
344       run: |
345         sudo apt-get update
346         sudo apt-get install \
347             gcc-12 \
348             g++-12 \
349             python3-sphinx \
350             uuid-dev \
351             libpcre2-dev \
352             libmagic-dev \
353             lua5.4 \
354             liblua5.4-dev \
355             mono-devel \
356             python3-dev \
357             tcl \
358             tcl-dev \
359             libicu-dev \
360             pkg-config \
361             libpoppler-glib-dev \
362             libglib2.0-dev \
363             libe-book-dev \
364             libetonyek-dev \
365             libgepub-0.6-dev \
366             libgmime-3.0-dev \
367             libarchive-dev \
368             libabw-dev \
369             libcdr-dev \
370             libextractor-dev \
371             libextractor-plugins-all \
372             libmwaw-dev \
373             libreofficekit-dev libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-writer \
374             libtesseract-dev \
375             tesseract-ocr-eng
376     - name: configure
377       run: |
378         export CC='ccache gcc-12'
379         export CXX='ccache g++-12'
380         # Make this build use builddir != srcdir as we aim to support that and
381         # so want to catch regressions in support.  This build seems a good
382         # choice for that as it's as full a build as any.
383         mkdir -p _build/xapian-core _build/xapian-applications/omega _build/xapian-bindings _build/xapian-letor
384         cd _build
385         # Ubuntu's GCC packages define _FORTIFY_SOURCE=2 by default, so we need
386         # to undefine it before we define it to avoid a warning (which becomes
387         # an error with -Werror).
388         export CPPFLAGS='-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3'
389         pushd xapian-core
390         ../../xapian-core/configure --enable-werror
391         export XAPIAN_CONFIG=$PWD/xapian-config
392         popd
393         pushd xapian-applications/omega
394         ../../../xapian-applications/omega/configure --enable-werror
395         popd
396         pushd xapian-bindings
397         ../../xapian-bindings/configure --enable-werror
398         popd
399         pushd xapian-letor
400         ../../xapian-letor/configure --enable-werror
401         popd
402     - name: make
403       run: |
404         cd _build
405         make -j2 -C xapian-core
406         make -j2 -C xapian-applications/omega
407         make -j2 -C xapian-bindings
408         make -j2 -C xapian-letor
409     - name: Run tests
410       run: |
411         export AUTOMATED_TESTING=1
412         export VERBOSE=1
413         cd _build
414         make -j2 -C xapian-core check
415         make -j2 -C xapian-applications/omega check
416         make -j2 -C xapian-bindings check
417         make -j2 -C xapian-letor check
419   assertions:
420     runs-on: 'ubuntu-22.04'
421     env:
422       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
423     needs: makedist
424     steps:
425     - name: Install CCache
426       uses: hendrikmuhs/ccache-action@v1
427       with:
428         key: ${{ github.job }}
429     - name: Fetch distribution
430       uses: actions/download-artifact@v4
431     - name: Unpack distribution
432       run: |
433         mv artifact/* .
434         rmdir artifact
435         pushd xapian-core
436         tar --strip-components=1 -xf xapian-core-*.tar.xz
437         popd
438         pushd xapian-applications/omega
439         tar --strip-components=1 -xf xapian-omega-*.tar.xz
440         popd
441         pushd xapian-bindings
442         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
443         popd
444         pushd xapian-letor
445         tar --strip-components=1 -xf xapian-letor-*.tar.xz
446         popd
447     - name: Install package dependencies
448       run: |
449         sudo apt-get update
450         sudo apt-get install \
451             python3-sphinx \
452             uuid-dev \
453             libpcre2-dev \
454             libmagic-dev \
455             lua5.4 \
456             liblua5.4-dev \
457             mono-devel \
458             python3-dev \
459             tcl \
460             tcl-dev \
461             libicu-dev \
462             pkg-config \
463             libpoppler-glib-dev \
464             libglib2.0-dev \
465             libe-book-dev \
466             libetonyek-dev \
467             libgepub-0.6-dev \
468             libgmime-3.0-dev \
469             libarchive-dev \
470             libabw-dev \
471             libcdr-dev \
472             libextractor-dev \
473             libextractor-plugins-all \
474             libmwaw-dev \
475             libreofficekit-dev libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-writer \
476             libtesseract-dev \
477             tesseract-ocr-eng
478     - name: configure
479       run: |
480         export CC='ccache gcc'
481         export CXX='ccache g++'
482         pushd xapian-core
483         ./configure --enable-werror --enable-assertions
484         export XAPIAN_CONFIG=$PWD/xapian-config
485         popd
486         pushd xapian-applications/omega
487         ./configure --enable-werror
488         popd
489         pushd xapian-bindings
490         ./configure --enable-werror
491         popd
492         pushd xapian-letor
493         ./configure --enable-werror
494         popd
495     - name: make
496       run: |
497         make -j2 -C xapian-core
498         make -j2 -C xapian-applications/omega
499         make -j2 -C xapian-bindings
500         make -j2 -C xapian-letor
501     - name: Run tests
502       run: |
503         export AUTOMATED_TESTING=1
504         export VERBOSE=1
505         make -j2 -C xapian-core check
506         make -j2 -C xapian-applications/omega check
507         make -j2 -C xapian-bindings check
508         make -j2 -C xapian-letor check
510   debug-log:
511     runs-on: 'ubuntu-22.04'
512     env:
513       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
514     needs: makedist
515     steps:
516     - name: Install CCache
517       uses: hendrikmuhs/ccache-action@v1
518       with:
519         key: ${{ github.job }}
520     - name: Fetch distribution
521       uses: actions/download-artifact@v4
522     - name: Unpack distribution
523       run: |
524         mv artifact/* .
525         rmdir artifact
526         pushd xapian-core
527         tar --strip-components=1 -xf xapian-core-*.tar.xz
528         popd
529         pushd xapian-applications/omega
530         tar --strip-components=1 -xf xapian-omega-*.tar.xz
531         popd
532         pushd xapian-bindings
533         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
534         popd
535         pushd xapian-letor
536         tar --strip-components=1 -xf xapian-letor-*.tar.xz
537         popd
538     - name: Install package dependencies
539       run: |
540         sudo apt-get update
541         sudo apt-get install \
542             python3-sphinx \
543             uuid-dev \
544             libpcre2-dev \
545             libmagic-dev \
546             lua5.4 \
547             liblua5.4-dev \
548             mono-devel \
549             python3-dev \
550             tcl \
551             tcl-dev \
552             libicu-dev \
553             pkg-config \
554             libpoppler-glib-dev \
555             libglib2.0-dev \
556             libe-book-dev \
557             libetonyek-dev \
558             libgepub-0.6-dev \
559             libgmime-3.0-dev \
560             libarchive-dev \
561             libabw-dev \
562             libcdr-dev \
563             libextractor-dev \
564             libextractor-plugins-all \
565             libmwaw-dev \
566             libreofficekit-dev libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-writer \
567             libtesseract-dev \
568             tesseract-ocr-eng
569     - name: configure
570       run: |
571         export CC='ccache gcc'
572         export CXX='ccache g++'
573         pushd xapian-core
574         ./configure --enable-werror --enable-log
575         export XAPIAN_CONFIG=$PWD/xapian-config
576         popd
577         pushd xapian-applications/omega
578         ./configure --enable-werror
579         popd
580         pushd xapian-bindings
581         ./configure --enable-werror
582         popd
583         pushd xapian-letor
584         ./configure --enable-werror
585         popd
586     - name: make
587       run: |
588         make -j2 -C xapian-core
589         make -j2 -C xapian-applications/omega
590         make -j2 -C xapian-bindings
591         make -j2 -C xapian-letor
592     - name: Run tests
593       run: |
594         export AUTOMATED_TESTING=1
595         export VERBOSE=1
596         make -j2 -C xapian-core check
597         make -j2 -C xapian-applications/omega check
598         make -j2 -C xapian-bindings check
599         make -j2 -C xapian-letor check
601   clang:
602     runs-on: 'ubuntu-20.04'
603     env:
604       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
605     needs: makedist
606     steps:
607     - name: Install CCache
608       uses: hendrikmuhs/ccache-action@v1
609       with:
610         key: ${{ github.job }}
611     - name: Fetch distribution
612       uses: actions/download-artifact@v4
613     - name: Unpack distribution
614       run: |
615         mv artifact/* .
616         rmdir artifact
617         pushd xapian-core
618         tar --strip-components=1 -xf xapian-core-*.tar.xz
619         popd
620         pushd xapian-applications/omega
621         tar --strip-components=1 -xf xapian-omega-*.tar.xz
622         popd
623         pushd xapian-bindings
624         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
625         popd
626         pushd xapian-letor
627         tar --strip-components=1 -xf xapian-letor-*.tar.xz
628         popd
629     - name: Install package dependencies
630       run: |
631         env
632         sudo apt-get update
633         sudo apt-get install \
634             clang \
635             libc++-dev
636         sudo apt-get install \
637             python3-sphinx \
638             uuid-dev \
639             libpcre2-dev \
640             libmagic-dev \
641             python3-dev \
642             tcl \
643             tcl-dev \
644             libicu-dev \
645             pkg-config \
646             libpoppler-glib-dev \
647             libglib2.0-dev \
648             libe-book-dev \
649             libetonyek-dev \
650             libgepub-0.6-dev \
651             libgmime-2.6-dev \
652             libarchive-dev \
653             libabw-dev \
654             libcdr-dev \
655             libextractor-dev \
656             libmwaw-dev \
657             libtesseract-dev \
658             tesseract-ocr-eng
659             # libreoffice support doesn't work when compiled with clang on Linux
660     - name: configure
661       run: |
662         export CC='ccache clang'
663         # Build with the llvm c++ library to catch more portability issues.
664         export CXX='ccache clang++ -stdlib=libc++'
665         pushd xapian-core
666         ./configure --enable-werror
667         export XAPIAN_CONFIG=$PWD/xapian-config
668         popd
669         pushd xapian-applications/omega
670         ./configure --enable-werror
671         popd
672         pushd xapian-bindings
673         ./configure --enable-werror --with-python3 --with-tcl
674         popd
675         pushd xapian-letor
676         ./configure --enable-werror
677         popd
678     - name: make
679       run: |
680         make -j2 -C xapian-core
681         make -j2 -C xapian-applications/omega
682         make -j2 -C xapian-bindings
683         make -j2 -C xapian-letor
684     - name: Run tests
685       run: |
686         export AUTOMATED_TESTING=1
687         export VERBOSE=1
688         make -j2 -C xapian-core check
689         make -j2 -C xapian-applications/omega check
690         make -j2 -C xapian-bindings check
691         make -j2 -C xapian-letor check
693   # Test with the oldest clang version we easily can.
694   clang6:
695     runs-on: 'ubuntu-20.04'
696     env:
697       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
698     needs: makedist
699     steps:
700     - name: Install CCache
701       uses: hendrikmuhs/ccache-action@v1
702       with:
703         key: ${{ github.job }}
704     - name: Fetch distribution
705       uses: actions/download-artifact@v4
706     - name: Unpack distribution
707       run: |
708         mv artifact/* .
709         rmdir artifact
710         pushd xapian-core
711         tar --strip-components=1 -xf xapian-core-*.tar.xz
712         popd
713         pushd xapian-applications/omega
714         tar --strip-components=1 -xf xapian-omega-*.tar.xz
715         popd
716         pushd xapian-bindings
717         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
718         popd
719         pushd xapian-letor
720         tar --strip-components=1 -xf xapian-letor-*.tar.xz
721         popd
722     - name: Install package dependencies
723       run: |
724         env
725         sudo apt-get update
726         sudo apt-get install \
727             clang-6.0
728         sudo apt-get install \
729             python3-sphinx \
730             uuid-dev \
731             libpcre2-dev \
732             libmagic-dev \
733             python3-dev \
734             tcl \
735             tcl-dev \
736             pkg-config \
737             libpoppler-glib-dev \
738             libglib2.0-dev \
739             libe-book-dev \
740             libetonyek-dev \
741             libgepub-0.6-dev \
742             libgmime-2.6-dev \
743             libarchive-dev \
744             libabw-dev \
745             libcdr-dev \
746             libextractor-dev \
747             libmwaw-dev \
748             libtesseract-dev \
749             tesseract-ocr-eng
750             # libreoffice support doesn't work when compiled with clang on Linux
751     - name: configure
752       run: |
753         export CC='ccache clang-6.0'
754         export CXX='ccache clang++-6.0'
755         pushd xapian-core
756         ./configure --enable-werror
757         export XAPIAN_CONFIG=$PWD/xapian-config
758         popd
759         pushd xapian-applications/omega
760         ./configure --enable-werror
761         popd
762         pushd xapian-bindings
763         ./configure --enable-werror --with-python3 --with-tcl
764         popd
765         pushd xapian-letor
766         ./configure --enable-werror
767         popd
768     - name: make
769       run: |
770         make -j2 -C xapian-core
771         make -j2 -C xapian-applications/omega
772         make -j2 -C xapian-bindings
773         make -j2 -C xapian-letor
774     - name: Run tests
775       run: |
776         export AUTOMATED_TESTING=1
777         export VERBOSE=1
778         make -j2 -C xapian-core check
779         make -j2 -C xapian-applications/omega check
780         make -j2 -C xapian-bindings check
781         make -j2 -C xapian-letor check
783   # GCC 7 is the oldest GCC we currently aim to support.
784   # Ubuntu 20.04 has GCC 7.5.0.
785   GCC7:
786     name: 'GCC 7'
787     runs-on: 'ubuntu-20.04'
788     env:
789       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
790     needs: makedist
791     steps:
792     - name: Install CCache
793       uses: hendrikmuhs/ccache-action@v1
794       with:
795         key: ${{ github.job }}
796     - name: Fetch distribution
797       uses: actions/download-artifact@v4
798     - name: Unpack distribution
799       run: |
800         mv artifact/* .
801         rmdir artifact
802         pushd xapian-core
803         tar --strip-components=1 -xf xapian-core-*.tar.xz
804         popd
805         pushd xapian-applications/omega
806         tar --strip-components=1 -xf xapian-omega-*.tar.xz
807         popd
808         pushd xapian-bindings
809         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
810         popd
811         pushd xapian-letor
812         tar --strip-components=1 -xf xapian-letor-*.tar.xz
813         popd
814     - name: Install package dependencies
815       run: |
816         sudo apt-get update
817         sudo apt-get install \
818             gcc-7 \
819             g++-7
820         sudo apt-get install \
821             python3-sphinx \
822             uuid-dev \
823             libpcre2-dev \
824             libmagic-dev \
825             lua5.3 \
826             liblua5.3-dev \
827             mono-devel \
828             python3-dev \
829             tcl \
830             tcl-dev \
831             libpoppler-glib-dev \
832             libglib2.0-dev \
833             libe-book-dev \
834             libetonyek-dev \
835             libgepub-0.6-dev \
836             libgmime-2.6-dev \
837             libarchive-dev \
838             libabw-dev \
839             libcdr-dev \
840             libextractor-dev \
841             libmwaw-dev \
842             libreofficekit-dev libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-writer \
843             libtesseract-dev \
844             tesseract-ocr-eng
845     - name: configure
846       run: |
847         export CC='ccache gcc-7'
848         export CXX='ccache g++-7'
849         pushd xapian-core
850         ./configure --enable-werror
851         export XAPIAN_CONFIG=$PWD/xapian-config
852         popd
853         pushd xapian-applications/omega
854         ./configure --enable-werror
855         popd
856         pushd xapian-bindings
857         ./configure --enable-werror
858         popd
859         pushd xapian-letor
860         ./configure --enable-werror
861         popd
862     - name: make
863       run: |
864         make -j2 -C xapian-core
865         make -j2 -C xapian-applications/omega
866         make -j2 -C xapian-bindings
867         make -j2 -C xapian-letor
868     - name: Run tests
869       run: |
870         export AUTOMATED_TESTING=1
871         export VERBOSE=1
872         make -j2 -C xapian-core check
873         make -j2 -C xapian-applications/omega check
874         make -j2 -C xapian-bindings check
875         make -j2 -C xapian-letor check
877   Emscripten:
878     runs-on: 'ubuntu-20.04'
879     needs: makedist
880     env:
881       EM_COMPILER_WRAPPER: ccache
882     steps:
883     - name: Install CCache
884       uses: hendrikmuhs/ccache-action@v1
885       with:
886         key: ${{ github.job }}
887     - name: Fetch distribution
888       uses: actions/download-artifact@v4
889     - name: Unpack distribution
890       run: |
891         mv artifact/* .
892         rmdir artifact
893         pushd xapian-core
894         tar --strip-components=1 -xf xapian-core-*.tar.xz
895         popd
896     - name: Setup emsdk
897       uses: mymindstorm/setup-emsdk@v13
898       with:
899         # With 3.1.51 `emcc -c` seems to fail.
900         version: 3.1.50
901         # This is the name of the cache folder.
902         # The cache folder will be placed in the build directory,
903         #  so make sure it doesn't conflict with anything!
904         actions-cache-folder: 'emsdk-cache'
905     - name: Use Node.js
906       uses: actions/setup-node@v4
907     - name: configure
908       run: |
909         cd xapian-core
910         export CPPFLAGS='-DFLINTLOCK_USE_FLOCK'
911         export CXXFLAGS='-Oz -s USE_ZLIB=1 -fno-rtti'
912         emconfigure ./configure --enable-werror --disable-shared
913     - name: make
914       run: |
915         cd xapian-core
916         emmake make
917     - name: Run tests
918       run: |
919         cd xapian-core
920         em++ -Oz -s USE_ZLIB=1 -std=c++11 -s WASM=1 -Iinclude emscripten/xapianjstest.cc .libs/libxapian-1.5.a -o emscripten/xapianjstest.js
921         cd emscripten
922         node xapianjstest.js
924   debian-stable:
925     runs-on: 'ubuntu-latest'
926     container: debian:stable
927     env:
928       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
929     needs: makedist
930     steps:
931     - name: Install package dependencies
932       run: |
933         apt-get update
934         apt-get install -y \
935             xz-utils \
936             python3-sphinx \
937             uuid-dev \
938             libpcre2-dev \
939             libmagic-dev \
940             lua5.4 \
941             liblua5.4-dev \
942             mono-devel \
943             python3-dev \
944             tcl \
945             tcl-dev \
946             libicu-dev \
947             pkg-config \
948             libpoppler-glib-dev \
949             libglib2.0-dev \
950             libe-book-dev \
951             libetonyek-dev \
952             libgepub-0.7-dev \
953             libgmime-3.0-dev \
954             libarchive-dev \
955             libabw-dev \
956             libcdr-dev \
957             libextractor-dev \
958             libmwaw-dev \
959             libreofficekit-dev libreoffice-calc libreoffice-draw libreoffice-impress libreoffice-writer \
960             libtesseract-dev \
961             tesseract-ocr-eng
962     - name: Install CCache
963       uses: hendrikmuhs/ccache-action@v1
964       with:
965         key: ${{ github.job }}
966     - name: Fetch distribution
967       uses: actions/download-artifact@v4
968     - name: Unpack distribution
969       run: |
970         mv artifact/* .
971         rmdir artifact
972         pushd xapian-core
973         tar --strip-components=1 -xf xapian-core-*.tar.xz
974         popd
975         pushd xapian-applications/omega
976         tar --strip-components=1 -xf xapian-omega-*.tar.xz
977         popd
978         pushd xapian-bindings
979         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
980         popd
981         pushd xapian-letor
982         tar --strip-components=1 -xf xapian-letor-*.tar.xz
983         popd
984     - name: configure
985       run: |
986         export CC='ccache gcc'
987         export CXX='ccache g++'
988         pushd xapian-core
989         ./configure --enable-werror
990         export XAPIAN_CONFIG=$PWD/xapian-config
991         popd
992         pushd xapian-applications/omega
993         ./configure --enable-werror
994         popd
995         pushd xapian-bindings
996         ./configure --enable-werror
997         popd
998         pushd xapian-letor
999         ./configure --enable-werror
1000         popd
1001     - name: make
1002       run: |
1003         make -j2 -C xapian-core
1004         make -j2 -C xapian-applications/omega
1005         make -j2 -C xapian-bindings
1006         make -j2 -C xapian-letor
1007     - name: Run tests
1008       run: |
1009         export AUTOMATED_TESTING=1
1010         export VERBOSE=1
1011         make -j2 -C xapian-core check
1012         make -j2 -C xapian-applications/omega check
1013         make -j2 -C xapian-bindings check
1014         make -j2 -C xapian-letor check
1016   macos:
1017     runs-on: 'macos-latest'
1018     needs: makedist
1019     steps:
1020     - name: Install CCache
1021       uses: hendrikmuhs/ccache-action@v1
1022       with:
1023         key: ${{ github.job }}
1024     - name: Fetch distribution
1025       uses: actions/download-artifact@v4
1026     - name: Unpack distribution
1027       run: |
1028         mv artifact/* .
1029         rmdir artifact
1030         pushd xapian-core
1031         tar --strip-components=1 -xf xapian-core-*.tar.xz
1032         popd
1033         pushd xapian-applications/omega
1034         tar --strip-components=1 -xf xapian-omega-*.tar.xz
1035         popd
1036         pushd xapian-bindings
1037         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1038         popd
1039         pushd xapian-letor
1040         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1041         popd
1042     - name: Install package dependencies
1043       run: |
1044         # Workaround apparent homebrew bug 2024-01-17
1045         rm -f /usr/local/bin/2to3-3.* /usr/local/bin/idle3.* /usr/local/bin/pydoc3.* /usr/local/bin/python3.* /usr/local/bin/python3.*-config
1046         rm -f /usr/local/bin/2to3 /usr/local/bin/idle3 /usr/local/bin/pydoc3 /usr/local/bin/python3 /usr/local/bin/python3-config
1047         brew update
1048         brew install -q \
1049             gmime \
1050             icu4c \
1051             libabw \
1052             libarchive \
1053             libcdr \
1054             libetonyek \
1055             libextractor \
1056             libiconv \
1057             libmagic \
1058             libmwaw \
1059             lua \
1060             pcre2 \
1061             pkgconfig \
1062             poppler \
1063             pygments \
1064             python \
1065             sphinx-doc
1066         # mono-mdk: "make check" fails on aarch64 macos-latest (but works on
1067         # x86_64 macos-12 and macos-13).  Last checked 2024-05-05.
1068         #
1069         # libeatmydata doesn't currently actually do anything on macOS:
1070         # https://github.com/stewartsmith/libeatmydata/issues/34
1071         # It's also started failing to even run in homebrew so don't install
1072         # for now.
1073         #
1074         # homebrew tesseract 5.2.0 only extracts "ee" from img/Test1.gif (5.1.0
1075         # worked).
1076         # tesseract
1077     - name: configure
1078       run: |
1079         export CC='ccache gcc'
1080         export CXX='ccache g++'
1081         export PKG_CONFIG_PATH="$(brew --prefix icu4c)/lib/pkgconfig"
1082         pushd xapian-core
1083         ./configure --enable-werror --prefix='${{ runner.temp }}/XapianInstall'
1084         export XAPIAN_CONFIG=$PWD/xapian-config
1085         popd
1086         pushd xapian-applications/omega
1087         ./configure --enable-werror --with-libiconv-prefix="$(brew --prefix libiconv)"
1088         popd
1089         pushd xapian-bindings
1090         # Homebrew package mono-mdk-for-visual-studio is pre-installed in the
1091         # image so we need to select the bindings we want except for csharp
1092         # as that currently fails on aarch64 macos.
1093         ./configure --enable-werror --with-java --with-lua --with-perl --with-ruby
1094         popd
1095         pushd xapian-letor
1096         ./configure --enable-werror
1097         popd
1098     - name: make
1099       run: |
1100         make -j3 -C xapian-core
1101         make -j3 -C xapian-core install
1102         make -j3 -C xapian-applications/omega
1103         make -j3 -C xapian-bindings
1104         make -j3 -C xapian-letor
1105     - name: Run tests
1106       run: |
1107         export LIBEXTRACTOR_PREFIX=${HOMEBREW_PREFIX:-/usr/local}/lib/libextractor
1108         export AUTOMATED_TESTING=1
1109         export VERBOSE=1
1110         make -j3 -C xapian-core check
1111         make -j3 -C xapian-applications/omega check
1112         make -j3 -C xapian-bindings check
1113         make -j3 -C xapian-letor check
1114     - name: Save log files
1115       if: ${{ failure() }}
1116       uses: actions/upload-artifact@v4
1117       with:
1118         name: logs-${{ github.job }}-${{ github.sha }}
1119         overwrite: true
1120         path: |
1121           **/*.log
1123   macos-13:
1124     runs-on: 'macos-13'
1125     needs: makedist
1126     steps:
1127     - name: Install CCache
1128       uses: hendrikmuhs/ccache-action@v1
1129       with:
1130         key: ${{ github.job }}
1131     - name: Fetch distribution
1132       uses: actions/download-artifact@v4
1133     - name: Unpack distribution
1134       run: |
1135         mv artifact/* .
1136         rmdir artifact
1137         pushd xapian-core
1138         tar --strip-components=1 -xf xapian-core-*.tar.xz
1139         popd
1140         pushd xapian-applications/omega
1141         tar --strip-components=1 -xf xapian-omega-*.tar.xz
1142         popd
1143         pushd xapian-bindings
1144         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1145         popd
1146         pushd xapian-letor
1147         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1148         popd
1149     - name: Install package dependencies
1150       run: |
1151         # Workaround apparent homebrew bug 2024-01-17
1152         rm -f /usr/local/bin/2to3-3.* /usr/local/bin/idle3.* /usr/local/bin/pydoc3.* /usr/local/bin/python3.* /usr/local/bin/python3.*-config
1153         rm -f /usr/local/bin/2to3 /usr/local/bin/idle3 /usr/local/bin/pydoc3 /usr/local/bin/python3 /usr/local/bin/python3-config
1154         brew update
1155         brew install -q \
1156             gmime \
1157             icu4c \
1158             libabw \
1159             libarchive \
1160             libcdr \
1161             libetonyek \
1162             libextractor \
1163             libiconv \
1164             libmagic \
1165             libmwaw \
1166             lua \
1167             mono-mdk \
1168             pcre2 \
1169             pkgconfig \
1170             poppler \
1171             pygments \
1172             python \
1173             sphinx-doc
1174         # libeatmydata doesn't currently actually do anything on macOS:
1175         # https://github.com/stewartsmith/libeatmydata/issues/34
1176         # It's also started failing to even run in homebrew so don't install
1177         # for now.
1178         #
1179         # homebrew tesseract 5.2.0 only extracts "ee" from img/Test1.gif (5.1.0
1180         # worked).
1181         # tesseract
1182     - name: configure
1183       run: |
1184         export CC='ccache gcc'
1185         export CXX='ccache g++'
1186         export PKG_CONFIG_PATH="$(brew --prefix icu4c)/lib/pkgconfig"
1187         pushd xapian-core
1188         ./configure --enable-werror --prefix='${{ runner.temp }}/XapianInstall'
1189         export XAPIAN_CONFIG=$PWD/xapian-config
1190         popd
1191         pushd xapian-applications/omega
1192         ./configure --enable-werror --with-libiconv-prefix="$(brew --prefix libiconv)"
1193         popd
1194         pushd xapian-bindings
1195         ./configure --enable-werror
1196         popd
1197         pushd xapian-letor
1198         ./configure --enable-werror
1199         popd
1200     - name: make
1201       run: |
1202         make -j4 -C xapian-core
1203         make -j4 -C xapian-core install
1204         make -j4 -C xapian-applications/omega
1205         make -j4 -C xapian-bindings
1206         make -j4 -C xapian-letor
1207     - name: Run tests
1208       run: |
1209         export LIBEXTRACTOR_PREFIX=${HOMEBREW_PREFIX:-/usr/local}/lib/libextractor
1210         export AUTOMATED_TESTING=1
1211         export VERBOSE=1
1212         make -j4 -C xapian-core check
1213         make -j4 -C xapian-applications/omega check
1214         make -j4 -C xapian-bindings check
1215         make -j4 -C xapian-letor check
1216     - name: Save log files
1217       if: ${{ failure() }}
1218       uses: actions/upload-artifact@v4
1219       with:
1220         name: logs-${{ github.job }}-${{ github.sha }}
1221         overwrite: true
1222         path: |
1223           **/*.log
1225   macos-12:
1226     runs-on: 'macos-12'
1227     needs: makedist
1228     steps:
1229     - name: Install CCache
1230       uses: hendrikmuhs/ccache-action@v1
1231       with:
1232         key: ${{ github.job }}
1233     - name: Fetch distribution
1234       uses: actions/download-artifact@v4
1235     - name: Unpack distribution
1236       run: |
1237         mv artifact/* .
1238         rmdir artifact
1239         pushd xapian-core
1240         tar --strip-components=1 -xf xapian-core-*.tar.xz
1241         popd
1242         pushd xapian-applications/omega
1243         tar --strip-components=1 -xf xapian-omega-*.tar.xz
1244         popd
1245         pushd xapian-bindings
1246         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1247         popd
1248         pushd xapian-letor
1249         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1250         popd
1251     - name: Install package dependencies
1252       run: |
1253         # Workaround apparent homebrew bug 2024-01-17
1254         rm -f /usr/local/bin/2to3-3.* /usr/local/bin/idle3.* /usr/local/bin/pydoc3.* /usr/local/bin/python3.* /usr/local/bin/python3.*-config
1255         rm -f /usr/local/bin/2to3 /usr/local/bin/idle3 /usr/local/bin/pydoc3 /usr/local/bin/python3 /usr/local/bin/python3-config
1256         brew update
1257         brew install -q \
1258             gmime \
1259             icu4c \
1260             libabw \
1261             libarchive \
1262             libcdr \
1263             libetonyek \
1264             libextractor \
1265             libiconv \
1266             libmagic \
1267             libmwaw \
1268             lua \
1269             mono-mdk \
1270             pcre2 \
1271             pkgconfig \
1272             poppler \
1273             pygments \
1274             python \
1275             sphinx-doc
1276         # libeatmydata doesn't currently actually do anything on macOS:
1277         # https://github.com/stewartsmith/libeatmydata/issues/34
1278         # It's also started failing to even run in homebrew so don't install
1279         # for now.
1280         #
1281         # homebrew tesseract 5.2.0 only extracts "ee" from img/Test1.gif (5.1.0
1282         # worked).
1283         # tesseract
1284     - name: configure
1285       run: |
1286         export CC='ccache gcc'
1287         export CXX='ccache g++'
1288         export PKG_CONFIG_PATH="$(brew --prefix icu4c)/lib/pkgconfig"
1289         pushd xapian-core
1290         ./configure --enable-werror --prefix='${{ runner.temp }}/XapianInstall'
1291         export XAPIAN_CONFIG=$PWD/xapian-config
1292         popd
1293         pushd xapian-applications/omega
1294         ./configure --enable-werror --with-libiconv-prefix="$(brew --prefix libiconv)"
1295         popd
1296         pushd xapian-bindings
1297         ./configure --enable-werror
1298         popd
1299         pushd xapian-letor
1300         ./configure --enable-werror
1301         popd
1302     - name: make
1303       run: |
1304         make -j3 -C xapian-core
1305         make -j3 -C xapian-core install
1306         make -j3 -C xapian-applications/omega
1307         make -j3 -C xapian-bindings
1308         make -j3 -C xapian-letor
1309     - name: Run tests
1310       run: |
1311         export LIBEXTRACTOR_PREFIX=${HOMEBREW_PREFIX:-/usr/local}/lib/libextractor
1312         export AUTOMATED_TESTING=1
1313         export VERBOSE=1
1314         make -j3 -C xapian-core check
1315         make -j3 -C xapian-applications/omega check
1316         make -j3 -C xapian-bindings check
1317         make -j3 -C xapian-letor check
1318     - name: Save log files
1319       if: ${{ failure() }}
1320       uses: actions/upload-artifact@v4
1321       with:
1322         name: logs-${{ github.job }}-${{ github.sha }}
1323         overwrite: true
1324         path: |
1325           **/*.log
1327   mingw64-i686-cross:
1328     runs-on: 'ubuntu-22.04'
1329     needs: makedist
1330     steps:
1331     - name: Install CCache
1332       uses: hendrikmuhs/ccache-action@v1
1333       with:
1334         key: ${{ github.job }}
1335     - name: Fetch distribution
1336       uses: actions/download-artifact@v4
1337     - name: Unpack distribution
1338       run: |
1339         mv artifact/* .
1340         rmdir artifact
1341         pushd xapian-core
1342         tar --strip-components=1 -xf xapian-core-*.tar.xz
1343         popd
1344         pushd xapian-letor
1345         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1346         popd
1347     - name: Install package dependencies
1348       run: |
1349         sudo apt-get update
1350         sudo apt-get install \
1351             g++-mingw-w64-i686-win32 \
1352             mingw-w64-i686-dev \
1353             binutils-mingw-w64-i686 \
1354             libz-mingw-w64-dev \
1355             mingw-w64-tools
1356     - name: configure
1357       run: |
1358         export EATMYDATA=
1359         export PATH=/usr/lib/ccache:$PATH
1360         pushd xapian-core
1361         ./configure --enable-werror --host i686-w64-mingw32
1362         export XAPIAN_CONFIG=$PWD/xapian-config
1363         popd
1364         pushd xapian-letor
1365         ./configure --enable-werror --host i686-w64-mingw32
1366         popd
1367     - name: make
1368       run: |
1369         export PATH=/usr/lib/ccache:$PATH
1370         make -j2 -C xapian-core
1371         make -j2 -C xapian-letor
1372     - name: Run tests
1373       run: |
1374         # Stop mono binfmt trying to run .exe files.
1375         sudo apt-get purge mono-runtime
1376         sudo dpkg --add-architecture i386
1377         sudo apt-get update
1378         sudo apt-get install wine32 wine-binfmt:amd64 wine:amd64
1379         export AUTOMATED_TESTING=1
1380         export VERBOSE=1
1381         export WINEPATH="$PWD/xapian-core/.libs;/usr/lib/gcc/i686-w64-mingw32/`i686-w64-mingw32-g++ --version 2>/dev/null|head -n1|sed 's/.*) //;s/ .*//'`"
1382         make -j2 -C xapian-core check
1383         export WINEPATH="$PWD/xapian-letor/.libs;$WINEPATH"
1384         make -j2 -C xapian-letor check
1386   mingw64-x86-64-cross:
1387     runs-on: 'ubuntu-22.04'
1388     needs: makedist
1389     steps:
1390     - name: Install CCache
1391       uses: hendrikmuhs/ccache-action@v1
1392       with:
1393         key: ${{ github.job }}
1394     - name: Fetch distribution
1395       uses: actions/download-artifact@v4
1396     - name: Unpack distribution
1397       run: |
1398         mv artifact/* .
1399         rmdir artifact
1400         pushd xapian-core
1401         tar --strip-components=1 -xf xapian-core-*.tar.xz
1402         export XAPIAN_CONFIG=$PWD/xapian-config
1403         popd
1404         pushd xapian-letor
1405         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1406         popd
1407     - name: Install package dependencies
1408       run: |
1409         sudo apt-get update
1410         # Stop mono binfmt trying to run .exe files.
1411         sudo apt-get purge mono-runtime
1412         sudo apt-get install \
1413             g++-mingw-w64-x86-64-win32 \
1414             mingw-w64-x86-64-dev \
1415             binutils-mingw-w64-x86-64 \
1416             libz-mingw-w64-dev \
1417             mingw-w64-tools \
1418             wine-binfmt \
1419             wine \
1420             wine64
1421         sudo dpkg --add-architecture i386
1422         sudo apt-get update
1423         sudo apt-get install wine32
1424     - name: configure
1425       run: |
1426         export EATMYDATA=
1427         export PATH=/usr/lib/ccache:$PATH
1428         pushd xapian-core
1429         ./configure --enable-werror --host x86_64-w64-mingw32
1430         export XAPIAN_CONFIG=$PWD/xapian-config
1431         popd
1432         pushd xapian-letor
1433         ./configure --enable-werror --host x86_64-w64-mingw32
1434         popd
1435     - name: make
1436       run: |
1437         export PATH=/usr/lib/ccache:$PATH
1438         make -j2 -C xapian-core
1439         make -j2 -C xapian-letor
1440     - name: Run tests
1441       run: |
1442         export AUTOMATED_TESTING=1
1443         export VERBOSE=1
1444         export WINEPATH="$PWD/xapian-core/.libs;/usr/lib/gcc/x86_64-w64-mingw32/`x86_64-w64-mingw32-g++ --version 2>/dev/null|head -n1|sed 's/.*) //;s/ .*//'`"
1445         make -j2 -C xapian-core check
1446         export WINEPATH="$PWD/xapian-letor/.libs;$WINEPATH"
1447         make -j2 -C xapian-letor check
1449   Fedora:
1450     runs-on: 'ubuntu-22.04'
1451     container: fedora:35
1452     needs: makedist
1453     steps:
1454     - name: Install build tools
1455       run: dnf install -y --nodocs ccache xz
1456     - name: Install CCache
1457       uses: hendrikmuhs/ccache-action@v1
1458       with:
1459         key: ${{ github.job }}
1460     - name: Fetch distribution
1461       uses: actions/download-artifact@v4
1462     - name: Unpack distribution
1463       run: |
1464         mv artifact/* .
1465         rmdir artifact
1466         pushd xapian-core
1467         tar --strip-components=1 -xf xapian-core-*.tar.xz
1468         popd
1469         pushd xapian-applications/omega
1470         tar --strip-components=1 -xf xapian-omega-*.tar.xz
1471         popd
1472         pushd xapian-bindings
1473         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1474         popd
1475         pushd xapian-letor
1476         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1477         popd
1478     - name: Install package dependencies
1479       run: |
1480         dnf install -y --nodocs \
1481         gcc-c++ file-devel libuuid-devel pcre2-devel perl zlib-devel make pkg-config \
1482         python3-devel python3-setuptools python3-sphinx \
1483         ruby ruby-devel rubygems rubygem-rdoc rubygem-json rubygem-test-unit \
1484         tcl-devel
1485     - name: configure
1486       run: |
1487         export CC='ccache gcc'
1488         export CXX='ccache g++'
1489         pushd xapian-core
1490         ./configure --enable-werror
1491         export XAPIAN_CONFIG=$PWD/xapian-config
1492         popd
1493         pushd xapian-applications/omega
1494         ./configure --enable-werror
1495         popd
1496         pushd xapian-bindings
1497         ./configure --enable-werror
1498         popd
1499         pushd xapian-letor
1500         ./configure --enable-werror
1501         popd
1502     - name: make
1503       run: |
1504         make -j2 -C xapian-core
1505         make -j2 -C xapian-applications/omega
1506         make -j2 -C xapian-bindings
1507         make -j2 -C xapian-letor
1508     - name: Run tests
1509       run: |
1510         export AUTOMATED_TESTING=1
1511         export VERBOSE=1
1512         make -j2 -C xapian-core check
1513         make -j2 -C xapian-applications/omega check
1514         make -j2 -C xapian-bindings check
1515         make -j2 -C xapian-letor check
1517   android-cross:
1518     runs-on: 'ubuntu-22.04'
1519     env:
1520       # Override github default because 27.1.12297006 fails with link errors in
1521       # a shared build, such as:
1522       # ld.lld: error: non-exported symbol '__aeabi_uidivmod' in '/usr/local/lib/android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/linux-x86_64/lib/clang/18/lib/linux/libclang_rt.builtins-arm-android.a(aeabi_uidivmod.S.o)' is referenced by DSO './.libs/libxapian-1.5.so'
1523       ANDROID_NDK: '/usr/local/lib/android/sdk/ndk/26.3.11579264'
1524       host_triplet: 'armv7a-linux-androideabi34'
1525     needs: makedist
1526     steps:
1527     - name: Install CCache
1528       uses: hendrikmuhs/ccache-action@v1
1529       with:
1530         key: ${{ github.job }}
1531     - name: Fetch distribution
1532       uses: actions/download-artifact@v4
1533     - name: Unpack distribution
1534       run: |
1535         mv artifact/* .
1536         rmdir artifact
1537         pushd xapian-core
1538         tar --strip-components=1 -xf xapian-core-*.tar.xz
1539         popd
1540     - name: configure
1541       run: |
1542         PATH=$PATH:$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin
1543         cd xapian-core
1544         ./configure --enable-werror \
1545             --host=$host_triplet \
1546             CC="ccache ${host_triplet}-clang" \
1547             CXX="ccache ${host_triplet}-clang++" \
1548             PKG_CONFIG=/bin/false
1549     - name: make
1550       run: |
1551         PATH=$PATH:$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin
1552         make -j2 -C xapian-core
1553       # FIXME: Run tests under android emulator?
1555   cygwin:
1556     # We only test 64-bit cygwin as 32-bit support has been dropped as of
1557     # Cygwin 3.4:
1558     # https://cygwin.com/pipermail/cygwin/2022-November/252542.html
1559     runs-on: 'windows-latest'
1560     needs: makedist
1561     defaults:
1562       run:
1563         # `-o igncr` needed as GHA supplies shell fragments with DOS EOLs.
1564         shell: 'C:\tools\cygwin\bin\bash.EXE --noprofile --norc -e -o igncr -o pipefail {0}'
1565     steps:
1566     - name: Install Cygwin
1567       uses: egor-tensin/setup-cygwin@v4
1568       with:
1569         packages: gcc-g++ make file-devel libpcre2-devel zlib-devel perl
1570     - name: Install CCache
1571       uses: hendrikmuhs/ccache-action@v1
1572       with:
1573         key: ${{ github.job }}
1574     - name: Fetch distribution
1575       uses: actions/download-artifact@v4
1576     - name: Unpack distribution
1577       run: |
1578         mv artifact/* .
1579         rmdir artifact
1580         pushd xapian-core
1581         tar --strip-components=1 -xf xapian-core-*.tar.xz
1582         popd
1583         pushd xapian-applications/omega
1584         tar --strip-components=1 -xf xapian-omega-*.tar.xz
1585         popd
1586         pushd xapian-bindings
1587         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1588         popd
1589         pushd xapian-letor
1590         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1591         popd
1592     - name: configure
1593       run: |
1594         export CC='ccache gcc'
1595         export CXX='ccache g++'
1596         pushd xapian-core
1597         ./configure --enable-werror
1598         export XAPIAN_CONFIG=$PWD/xapian-config
1599         popd
1600         pushd xapian-applications/omega
1601         ./configure --enable-werror
1602         popd
1603         # pushd xapian-bindings
1604         # ./configure --enable-werror
1605         # popd
1606         pushd xapian-letor
1607         ./configure --enable-werror
1608         popd
1609     - name: make
1610       run: |
1611         make -j2 -C xapian-core
1612         make -j2 -C xapian-applications/omega
1613         # make -j2 -C xapian-bindings
1614         make -j2 -C xapian-letor
1615     - name: Run tests
1616       run: |
1617         export AUTOMATED_TESTING=1
1618         export VERBOSE=1
1619         make -j2 -C xapian-core check
1620         make -j2 -C xapian-applications/omega check
1621         # make -j2 -C xapian-bindings check
1622         make -j2 -C xapian-letor check
1624   msys2-mingw32:
1625     runs-on: 'windows-latest'
1626     needs: makedist
1627     defaults:
1628       run:
1629         shell: msys2 {0}
1630     steps:
1631     - uses: msys2/setup-msys2@v2
1632       with:
1633         msystem: mingw32
1634         install: base-devel
1635         pacboy: >-
1636           file:p
1637           gcc:p
1638           pcre2:p
1639           zlib:p
1640     - name: Install CCache
1641       uses: hendrikmuhs/ccache-action@v1
1642       with:
1643         key: ${{ github.job }}
1644         variant: sccache
1645     - name: Fetch distribution
1646       uses: actions/download-artifact@v4
1647     - name: Unpack distribution
1648       run: |
1649         mv artifact/* .
1650         rmdir artifact
1651         pushd xapian-core
1652         tar --strip-components=1 -xf xapian-core-*.tar.xz
1653         popd
1654         pushd xapian-applications/omega
1655         tar --strip-components=1 -xf xapian-omega-*.tar.xz
1656         popd
1657         # pushd xapian-bindings
1658         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1659         # popd
1660         pushd xapian-letor
1661         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1662         popd
1663     - name: configure
1664       run: |
1665         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1666         export CC='sccache gcc'
1667         export CXX='sccache g++'
1668         pushd xapian-core
1669         ./configure --enable-werror
1670         export XAPIAN_CONFIG=$PWD/xapian-config
1671         popd
1672         pushd xapian-applications/omega
1673         ./configure --enable-werror
1674         popd
1675         # pushd xapian-bindings
1676         # ./configure --enable-werror
1677         # popd
1678         pushd xapian-letor
1679         ./configure --enable-werror
1680         popd
1681     - name: make
1682       run: |
1683         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1684         make -j2 -C xapian-core
1685         make -j2 -C xapian-applications/omega
1686         # make -j2 -C xapian-bindings
1687         make -j2 -C xapian-letor
1688     - name: Run tests
1689       run: |
1690         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1691         export AUTOMATED_TESTING=1
1692         export VERBOSE=1
1693         make -j2 -C xapian-core check
1694         make -j2 -C xapian-applications/omega check
1695         # make -j2 -C xapian-bindings check
1696         make -j2 -C xapian-letor check
1698   msys2-mingw64:
1699     runs-on: 'windows-latest'
1700     needs: makedist
1701     defaults:
1702       run:
1703         shell: msys2 {0}
1704     steps:
1705     - uses: msys2/setup-msys2@v2
1706       with:
1707         msystem: mingw64
1708         install: base-devel
1709         pacboy: >-
1710           file:p
1711           gcc:p
1712           pcre2:p
1713           zlib:p
1714     - name: Install CCache
1715       uses: hendrikmuhs/ccache-action@v1
1716       with:
1717         key: ${{ github.job }}
1718         variant: sccache
1719     - name: Fetch distribution
1720       uses: actions/download-artifact@v4
1721     - name: Unpack distribution
1722       run: |
1723         mv artifact/* .
1724         rmdir artifact
1725         pushd xapian-core
1726         tar --strip-components=1 -xf xapian-core-*.tar.xz
1727         popd
1728         pushd xapian-applications/omega
1729         tar --strip-components=1 -xf xapian-omega-*.tar.xz
1730         popd
1731         # pushd xapian-bindings
1732         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1733         # popd
1734         pushd xapian-letor
1735         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1736         popd
1737     - name: configure
1738       run: |
1739         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1740         export CC='sccache gcc'
1741         export CXX='sccache g++'
1742         pushd xapian-core
1743         ./configure --enable-werror
1744         export XAPIAN_CONFIG=$PWD/xapian-config
1745         popd
1746         pushd xapian-applications/omega
1747         ./configure --enable-werror
1748         popd
1749         # pushd xapian-bindings
1750         # ./configure --enable-werror
1751         # popd
1752         pushd xapian-letor
1753         ./configure --enable-werror
1754         popd
1755     - name: make
1756       run: |
1757         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1758         make -j2 -C xapian-core
1759         make -j2 -C xapian-applications/omega
1760         # make -j2 -C xapian-bindings
1761         make -j2 -C xapian-letor
1762     - name: Run tests
1763       run: |
1764         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1765         export AUTOMATED_TESTING=1
1766         export VERBOSE=1
1767         make -j2 -C xapian-core check
1768         make -j2 -C xapian-applications/omega check
1769         # make -j2 -C xapian-bindings check
1770         make -j2 -C xapian-letor check
1772   msys2-ucrt64:
1773     runs-on: 'windows-latest'
1774     needs: makedist
1775     defaults:
1776       run:
1777         shell: msys2 {0}
1778     steps:
1779     - uses: msys2/setup-msys2@v2
1780       with:
1781         msystem: ucrt64
1782         install: base-devel
1783         pacboy: >-
1784           file:p
1785           gcc:p
1786           pcre2:p
1787           zlib:p
1788     - name: Install CCache
1789       uses: hendrikmuhs/ccache-action@v1
1790       with:
1791         key: ${{ github.job }}
1792         variant: sccache
1793     - name: Fetch distribution
1794       uses: actions/download-artifact@v4
1795     - name: Unpack distribution
1796       run: |
1797         mv artifact/* .
1798         rmdir artifact
1799         pushd xapian-core
1800         tar --strip-components=1 -xf xapian-core-*.tar.xz
1801         popd
1802         pushd xapian-applications/omega
1803         tar --strip-components=1 -xf xapian-omega-*.tar.xz
1804         popd
1805         # pushd xapian-bindings
1806         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1807         # popd
1808         pushd xapian-letor
1809         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1810         popd
1811     - name: configure
1812       run: |
1813         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1814         export CC='sccache gcc'
1815         export CXX='sccache g++'
1816         pushd xapian-core
1817         ./configure --enable-werror
1818         export XAPIAN_CONFIG=$PWD/xapian-config
1819         popd
1820         pushd xapian-applications/omega
1821         ./configure --enable-werror
1822         popd
1823         # pushd xapian-bindings
1824         # ./configure --enable-werror
1825         # popd
1826         pushd xapian-letor
1827         ./configure --enable-werror
1828         popd
1829     - name: make
1830       run: |
1831         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1832         make -j2 -C xapian-core
1833         make -j2 -C xapian-applications/omega
1834         # make -j2 -C xapian-bindings
1835         make -j2 -C xapian-letor
1836     - name: Run tests
1837       run: |
1838         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1839         export AUTOMATED_TESTING=1
1840         export VERBOSE=1
1841         make -j2 -C xapian-core check
1842         make -j2 -C xapian-applications/omega check
1843         # make -j2 -C xapian-bindings check
1844         make -j2 -C xapian-letor check
1846   msvc2019:
1847     runs-on: 'windows-2019'
1848     needs: makedist
1849     defaults:
1850       run:
1851         shell: msys2 {0}
1852     steps:
1853     - uses: msys2/setup-msys2@v2
1854       with:
1855         release: true # Use the pre-installed MSYS2
1856         path-type: inherit
1857         install: base-devel
1858     - name: Install CCache
1859       uses: hendrikmuhs/ccache-action@v1
1860       with:
1861         key: ${{ github.job }}
1862         variant: sccache
1863     - name: Fetch distribution
1864       uses: actions/download-artifact@v4
1865     - name: Unpack distribution
1866       run: |
1867         mv artifact/* .
1868         rmdir artifact
1869         pushd xapian-core
1870         tar --strip-components=1 -xf xapian-core-*.tar.xz
1871         popd
1872         # Need libmagic for omega
1873         # pushd xapian-applications/omega
1874         # tar --strip-components=1 -xf xapian-omega-*.tar.xz
1875         # popd
1876         # pushd xapian-bindings
1877         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1878         # popd
1879         pushd xapian-letor
1880         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1881         popd
1882     - name: Set up Visual Studio shell
1883       uses: egor-tensin/vs-shell@v2
1884       with:
1885         arch: x64
1886     - name: Build zlib
1887       shell: bash
1888       run: |
1889         # Setup sccache for cl.
1890         ln /c/Users/runneradmin/.cargo/bin/{sccache.exe,cl.exe}
1891         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1892         # We find "link" from coreutils rather than from MSVC.  The coreutils
1893         # "link" is not a useful tool to us, so just delete it rather than
1894         # trying to reorder PATH.
1895         rm /usr/bin/link.exe || true
1896         mkdir zlib
1897         pushd zlib
1898         curl --retry 5 --retry-connrefused -L https://github.com/xapian/xapian-dev-deps/releases/download/current/zlib-1.2.13.tar.gz|tar --strip-components=1 -zxf -
1899         # Don't build zlib with -MD as it seems this flag needs to be used
1900         # consistently across the build.  Don't use -Zi -Fd"zlib" as
1901         # ccache/sccache don't seem to be able to handle that.
1902         #
1903         # Don't build zlib with a fixed base address on x64 as that gives
1904         # linker warning LNK4281.
1905         sed -i 's/\(^CFLAGS  *= *-nologo \)-MD \(.* \)-Zi -Fd"zlib" /\1\2/;s/-base:0x[0-9A-Fa-f]* //' win32/Makefile.msc
1906         # Only build the shared library.
1907         nmake -nologo -f 'win32\Makefile.msc' zlib1.dll
1908         popd
1909     - name: configure
1910       run: |
1911         export AR=lib
1912         export CC="cl -nologo"
1913         export CXX="$PWD/xapian-core/compile cl -nologo"
1914         export CPPFLAGS="-I$PWD/zlib"
1915         # Standard C++ stack unwinding; assume extern "C" functions never throw.
1916         export CXXFLAGS=-EHsc
1917         export LD=link
1918         export LDFLAGS="-L$PWD/zlib"
1919         export NM=dumpbin
1920         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1921         pushd xapian-core
1922         ./configure --enable-werror --disable-shared
1923         export XAPIAN_CONFIG=$PWD/xapian-config
1924         popd
1925         # pushd xapian-applications/omega
1926         # ./configure --enable-werror
1927         # popd
1928         # pushd xapian-bindings
1929         # ./configure --enable-werror
1930         # popd
1931         pushd xapian-letor
1932         ./configure --enable-werror --disable-shared
1933         popd
1934     - name: make
1935       run: |
1936         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1937         make -j2 -C xapian-core
1938         # make -j2 -C xapian-applications/omega
1939         # make -j2 -C xapian-bindings
1940         make -j2 -C xapian-letor
1941     - name: Run tests
1942       run: |
1943         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1944         export AUTOMATED_TESTING=1
1945         export VERBOSE=1
1946         make -j2 -C xapian-core check
1947         # make -j2 -C xapian-applications/omega check
1948         # make -j2 -C xapian-bindings check
1949         make -j2 -C xapian-letor check
1951   msvc2022:
1952     runs-on: 'windows-2022'
1953     needs: makedist
1954     defaults:
1955       run:
1956         shell: msys2 {0}
1957     steps:
1958     - uses: msys2/setup-msys2@v2
1959       with:
1960         release: true # Use the pre-installed MSYS2
1961         path-type: inherit
1962         install: base-devel
1963     - name: Install CCache
1964       uses: hendrikmuhs/ccache-action@v1
1965       with:
1966         key: ${{ github.job }}
1967         variant: sccache
1968     - name: Fetch distribution
1969       uses: actions/download-artifact@v4
1970     - name: Unpack distribution
1971       run: |
1972         mv artifact/* .
1973         rmdir artifact
1974         pushd xapian-core
1975         tar --strip-components=1 -xf xapian-core-*.tar.xz
1976         popd
1977         # Need libmagic for omega
1978         # pushd xapian-applications/omega
1979         # tar --strip-components=1 -xf xapian-omega-*.tar.xz
1980         # popd
1981         # pushd xapian-bindings
1982         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1983         # popd
1984         pushd xapian-letor
1985         tar --strip-components=1 -xf xapian-letor-*.tar.xz
1986         popd
1987     - name: Set up Visual Studio shell
1988       uses: egor-tensin/vs-shell@v2
1989       with:
1990         arch: x64
1991     - name: Build zlib
1992       shell: bash
1993       run: |
1994         # Setup sccache for cl.
1995         ln /c/Users/runneradmin/.cargo/bin/{sccache.exe,cl.exe}
1996         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1997         # We find "link" from coreutils rather than from MSVC.  The coreutils
1998         # "link" is not a useful tool to us, so just delete it rather than
1999         # trying to reorder PATH.
2000         rm /usr/bin/link.exe || true
2001         mkdir zlib
2002         pushd zlib
2003         curl --retry 5 --retry-connrefused -L https://github.com/xapian/xapian-dev-deps/releases/download/current/zlib-1.2.13.tar.gz|tar --strip-components=1 -zxf -
2004         # Don't build zlib with -MD as it seems this flag needs to be used
2005         # consistently across the build.  Don't use -Zi -Fd"zlib" as
2006         # ccache/sccache don't seem to be able to handle that.
2007         #
2008         # Don't build zlib with a fixed base address on x64 as that gives
2009         # linker warning LNK4281.
2010         sed -i 's/\(^CFLAGS  *= *-nologo \)-MD \(.* \)-Zi -Fd"zlib" /\1\2/;s/-base:0x[0-9A-Fa-f]* //' win32/Makefile.msc
2011         # Only build the shared library.
2012         nmake -nologo -f 'win32\Makefile.msc' zlib1.dll
2013         popd
2014     - name: configure
2015       run: |
2016         export AR=lib
2017         export CC="cl -nologo"
2018         export CXX="$PWD/xapian-core/compile cl -nologo"
2019         export CPPFLAGS="-I$PWD/zlib"
2020         # Standard C++ stack unwinding; assume extern "C" functions never throw.
2021         export CXXFLAGS=-EHsc
2022         export LD=link
2023         export LDFLAGS="-L$PWD/zlib"
2024         export NM=dumpbin
2025         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2026         pushd xapian-core
2027         ./configure --enable-werror --disable-shared
2028         export XAPIAN_CONFIG=$PWD/xapian-config
2029         popd
2030         # pushd xapian-applications/omega
2031         # ./configure --enable-werror
2032         # popd
2033         # pushd xapian-bindings
2034         # ./configure --enable-werror
2035         # popd
2036         pushd xapian-letor
2037         ./configure --enable-werror --disable-shared
2038         popd
2039     - name: make
2040       run: |
2041         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2042         make -j2 -C xapian-core
2043         # make -j2 -C xapian-applications/omega
2044         # make -j2 -C xapian-bindings
2045         make -j2 -C xapian-letor
2046     - name: Run tests
2047       run: |
2048         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2049         export AUTOMATED_TESTING=1
2050         export VERBOSE=1
2051         make -j2 -C xapian-core check
2052         # make -j2 -C xapian-applications/omega check
2053         # make -j2 -C xapian-bindings check
2054         make -j2 -C xapian-letor check
2056   msvc2019-x86:
2057     runs-on: 'windows-2019'
2058     needs: makedist
2059     defaults:
2060       run:
2061         shell: msys2 {0}
2062     steps:
2063     - uses: msys2/setup-msys2@v2
2064       with:
2065         release: true # Use the pre-installed MSYS2
2066         path-type: inherit
2067         install: base-devel
2068     - name: Install CCache
2069       uses: hendrikmuhs/ccache-action@v1
2070       with:
2071         key: ${{ github.job }}
2072         variant: sccache
2073     - name: Fetch distribution
2074       uses: actions/download-artifact@v4
2075     - name: Unpack distribution
2076       run: |
2077         mv artifact/* .
2078         rmdir artifact
2079         pushd xapian-core
2080         tar --strip-components=1 -xf xapian-core-*.tar.xz
2081         popd
2082         # Need libmagic for omega
2083         # pushd xapian-applications/omega
2084         # tar --strip-components=1 -xf xapian-omega-*.tar.xz
2085         # popd
2086         # pushd xapian-bindings
2087         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
2088         # popd
2089         pushd xapian-letor
2090         tar --strip-components=1 -xf xapian-letor-*.tar.xz
2091         popd
2092     - name: Set up Visual Studio shell
2093       uses: egor-tensin/vs-shell@v2
2094       with:
2095         arch: x86
2096     - name: Build zlib
2097       shell: bash
2098       run: |
2099         # Setup sccache for cl.
2100         ln /c/Users/runneradmin/.cargo/bin/{sccache.exe,cl.exe}
2101         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2102         # We find "link" from coreutils rather than from MSVC.  The coreutils
2103         # "link" is not a useful tool to us, so just delete it rather than
2104         # trying to reorder PATH.
2105         rm /usr/bin/link.exe || true
2106         mkdir zlib
2107         pushd zlib
2108         curl --retry 5 --retry-connrefused -L https://github.com/xapian/xapian-dev-deps/releases/download/current/zlib-1.2.13.tar.gz|tar --strip-components=1 -zxf -
2109         # Don't build zlib with -MD as it seems this flag needs to be used
2110         # consistently across the build.  Don't use -Zi -Fd"zlib" as
2111         # ccache/sccache don't seem to be able to handle that.
2112         sed -i 's/\(^CFLAGS  *= *-nologo \)-MD \(.* \)-Zi -Fd"zlib" /\1\2/' win32/Makefile.msc
2113         # Only build the static library.
2114         nmake -nologo -f 'win32\Makefile.msc' zlib.lib
2115         popd
2116     - name: configure
2117       run: |
2118         export AR=lib
2119         export CC="cl -nologo"
2120         export CXX="$PWD/xapian-core/compile cl -nologo"
2121         export CPPFLAGS="-I$PWD/zlib"
2122         # Standard C++ stack unwinding; assume extern "C" functions never throw.
2123         export CXXFLAGS=-EHsc
2124         export LD=link
2125         export LDFLAGS="-L$PWD/zlib"
2126         export NM=dumpbin
2127         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2128         pushd xapian-core
2129         ./configure --enable-werror --disable-shared
2130         export XAPIAN_CONFIG=$PWD/xapian-config
2131         popd
2132         # pushd xapian-applications/omega
2133         # ./configure --enable-werror
2134         # popd
2135         # pushd xapian-bindings
2136         # ./configure --enable-werror
2137         # popd
2138         pushd xapian-letor
2139         ./configure --enable-werror --disable-shared
2140         popd
2141     - name: make
2142       run: |
2143         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2144         make -j2 -C xapian-core
2145         # make -j2 -C xapian-applications/omega
2146         # make -j2 -C xapian-bindings
2147         make -j2 -C xapian-letor
2148     - name: Run tests
2149       run: |
2150         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2151         export AUTOMATED_TESTING=1
2152         export VERBOSE=1
2153         make -j2 -C xapian-core check
2154         # make -j2 -C xapian-applications/omega check
2155         # make -j2 -C xapian-bindings check
2156         make -j2 -C xapian-letor check
2158   msvc2022-x86:
2159     runs-on: 'windows-2022'
2160     needs: makedist
2161     defaults:
2162       run:
2163         shell: msys2 {0}
2164     steps:
2165     - uses: msys2/setup-msys2@v2
2166       with:
2167         release: true # Use the pre-installed MSYS2
2168         path-type: inherit
2169         install: base-devel
2170     - name: Install CCache
2171       uses: hendrikmuhs/ccache-action@v1
2172       with:
2173         key: ${{ github.job }}
2174         variant: sccache
2175     - name: Fetch distribution
2176       uses: actions/download-artifact@v4
2177     - name: Unpack distribution
2178       run: |
2179         mv artifact/* .
2180         rmdir artifact
2181         pushd xapian-core
2182         tar --strip-components=1 -xf xapian-core-*.tar.xz
2183         popd
2184         # Need libmagic for omega
2185         # pushd xapian-applications/omega
2186         # tar --strip-components=1 -xf xapian-omega-*.tar.xz
2187         # popd
2188         # pushd xapian-bindings
2189         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
2190         # popd
2191         pushd xapian-letor
2192         tar --strip-components=1 -xf xapian-letor-*.tar.xz
2193         popd
2194     - name: Set up Visual Studio shell
2195       uses: egor-tensin/vs-shell@v2
2196       with:
2197         arch: x86
2198     - name: Build zlib
2199       shell: bash
2200       run: |
2201         # Setup sccache for cl.
2202         ln /c/Users/runneradmin/.cargo/bin/{sccache.exe,cl.exe}
2203         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2204         # We find "link" from coreutils rather than from MSVC.  The coreutils
2205         # "link" is not a useful tool to us, so just delete it rather than
2206         # trying to reorder PATH.
2207         rm /usr/bin/link.exe || true
2208         mkdir zlib
2209         pushd zlib
2210         curl --retry 5 --retry-connrefused -L https://github.com/xapian/xapian-dev-deps/releases/download/current/zlib-1.2.13.tar.gz|tar --strip-components=1 -zxf -
2211         # Don't build zlib with -MD as it seems this flag needs to be used
2212         # consistently across the build.  Don't use -Zi -Fd"zlib" as
2213         # ccache/sccache don't seem to be able to handle that.
2214         sed -i 's/\(^CFLAGS  *= *-nologo \)-MD \(.* \)-Zi -Fd"zlib" /\1\2/' win32/Makefile.msc
2215         # Only build the static library.
2216         nmake -nologo -f 'win32\Makefile.msc' zlib.lib
2217         popd
2218     - name: configure
2219       run: |
2220         export AR=lib
2221         export CC="cl -nologo"
2222         export CXX="$PWD/xapian-core/compile cl -nologo"
2223         export CPPFLAGS="-I$PWD/zlib"
2224         # Standard C++ stack unwinding; assume extern "C" functions never throw.
2225         export CXXFLAGS=-EHsc
2226         export LD=link
2227         export LDFLAGS="-L$PWD/zlib"
2228         export NM=dumpbin
2229         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2230         pushd xapian-core
2231         ./configure --enable-werror --disable-shared
2232         export XAPIAN_CONFIG=$PWD/xapian-config
2233         popd
2234         # pushd xapian-applications/omega
2235         # ./configure --enable-werror
2236         # popd
2237         # pushd xapian-bindings
2238         # ./configure --enable-werror
2239         # popd
2240         pushd xapian-letor
2241         ./configure --enable-werror --disable-shared
2242         popd
2243     - name: make
2244       run: |
2245         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2246         make -j2 -C xapian-core
2247         # make -j2 -C xapian-applications/omega
2248         # make -j2 -C xapian-bindings
2249         make -j2 -C xapian-letor
2250     - name: Run tests
2251       run: |
2252         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
2253         export AUTOMATED_TESTING=1
2254         export VERBOSE=1
2255         make -j2 -C xapian-core check
2256         # make -j2 -C xapian-applications/omega check
2257         # make -j2 -C xapian-bindings check
2258         make -j2 -C xapian-letor check
2260   freebsd:
2261     runs-on: 'ubuntu-22.04'
2262     needs: makedist
2263     steps:
2264     - name: Install CCache
2265       uses: hendrikmuhs/ccache-action@v1
2266       with:
2267         key: ${{ github.job }}
2268     - name: Fetch distribution
2269       uses: actions/download-artifact@v4
2270     - name: Unpack distribution
2271       run: |
2272         mv artifact/* .
2273         rmdir artifact
2274         # Do actual unpacking in the VM, mostly to help reduce the size of the
2275         # rsync output in the logs.
2276     - uses: vmactions/freebsd-vm@v1
2277       # Limit wasted resources if the VM action gets into an infinite loop.
2278       timeout-minutes: 60
2279       with:
2280         # The default is csh!
2281         usesh: true
2282         prepare: |
2283           set -e
2284           pkg install -y bash ccache lua54 perl5 php82 pcre2 pkgconf py311-sphinx python3 ruby rubygem-rdoc rubygem-test-unit tcl86
2285           ccache --set-config=cache_dir="$HOME/work/xapian/xapian/.ccache"
2286           ccache --set-config=max_size='500M'
2287           ccache --set-config=compression=true
2288         run: |
2289           set -e
2290           export CC='ccache cc'
2291           export CXX='ccache c++'
2292           export TCLSH=tclsh8.6
2293           mv xapian-* "$HOME"
2294           cd
2295           cd xapian-core
2296           tar --strip-components=1 -xf xapian-core-*.tar.xz
2297           ./configure --enable-werror
2298           export XAPIAN_CONFIG=$PWD/xapian-config
2299           cd ..
2300           cd xapian-applications/omega
2301           tar --strip-components=1 -xf xapian-omega-*.tar.xz
2302           ./configure --enable-werror
2303           cd ../..
2304           cd xapian-bindings
2305           tar --strip-components=1 -xf xapian-bindings-*.tar.xz
2306           ./configure --enable-werror --with-lua --with-perl --with-php --with-python3 --with-ruby --with-tcl
2307           cd ..
2308           cd xapian-letor
2309           tar --strip-components=1 -xf xapian-letor-*.tar.xz
2310           ./configure --enable-werror
2311           cd ..
2312           # Everything gets run in one script so use V=0 to reduce the size of
2313           # the log, but re-run without V=0 on failure to show the compiler
2314           # command line.
2315           make -j2 -C xapian-core V=0 || make -C xapian-core
2316           make -j2 -C xapian-applications/omega V=0 || make -C xapian-applications/omega
2317           make -j2 -C xapian-bindings V=0 || make -C xapian-bindings
2318           make -j2 -C xapian-letor V=0 || make -C xapian-letor
2319           export AUTOMATED_TESTING=1
2320           export VERBOSE=1
2321           make -j2 -C xapian-core check V=0
2322           make -j2 -C xapian-applications/omega check V=0
2323           make -j2 -C xapian-bindings check V=0
2324           make -j2 -C xapian-letor check V=0
2326   dragonfly:
2327     runs-on: 'ubuntu-22.04'
2328     needs: makedist
2329     steps:
2330     - name: Install CCache
2331       uses: hendrikmuhs/ccache-action@v1
2332       with:
2333         key: ${{ github.job }}
2334     - name: Fetch distribution
2335       uses: actions/download-artifact@v4
2336     - name: Unpack distribution
2337       run: |
2338         mv artifact/* .
2339         rmdir artifact
2340         # Do actual unpacking in the VM, mostly to help reduce the size of the
2341         # rsync output in the logs.
2342     - uses: vmactions/dragonflybsd-vm@v1
2343       # Limit wasted resources if the VM action gets into an infinite loop.
2344       timeout-minutes: 60
2345       with:
2346         # The default is csh!
2347         usesh: true
2348         prepare: |
2349           set -e
2350           pkg install -y bash ccache lua54 perl5 php82 pcre2 pkgconf py39-sphinx python3 ruby rubygem-rdoc rubygem-test-unit tcl86
2351           ccache --set-config=cache_dir="$HOME/work/xapian/xapian/.ccache"
2352           ccache --set-config=max_size='500M'
2353           ccache --set-config=compression=true
2354         run: |
2355           set -e
2356           export CC='ccache cc'
2357           export CXX='ccache c++'
2358           export TCLSH=tclsh8.6
2359           mv xapian-* "$HOME"
2360           cd
2361           cd xapian-core
2362           tar --strip-components=1 -xf xapian-core-*.tar.xz
2363           ./configure --enable-werror
2364           export XAPIAN_CONFIG=$PWD/xapian-config
2365           cd ..
2366           cd xapian-applications/omega
2367           tar --strip-components=1 -xf xapian-omega-*.tar.xz
2368           ./configure --enable-werror
2369           cd ../..
2370           cd xapian-bindings
2371           tar --strip-components=1 -xf xapian-bindings-*.tar.xz
2372           ./configure --enable-werror --with-lua --with-perl --with-php --with-python3 --with-ruby --with-tcl
2373           cd ..
2374           cd xapian-letor
2375           tar --strip-components=1 -xf xapian-letor-*.tar.xz
2376           ./configure --enable-werror
2377           cd ..
2378           # Everything gets run in one script so use V=0 to reduce the size of
2379           # the log, but re-run without V=0 on failure to show the compiler
2380           # command line.
2381           make -j2 -C xapian-core V=0 || make -C xapian-core
2382           make -j2 -C xapian-applications/omega V=0 || make -C xapian-applications/omega
2383           make -j2 -C xapian-bindings V=0 || make -C xapian-bindings
2384           make -j2 -C xapian-letor V=0 || make -C xapian-letor
2385           export AUTOMATED_TESTING=1
2386           export VERBOSE=1
2387           make -j2 -C xapian-core check V=0
2388           make -j2 -C xapian-applications/omega check V=0
2389           make -j2 -C xapian-bindings check V=0
2390           make -j2 -C xapian-letor check V=0
2392   netbsd:
2393     runs-on: 'ubuntu-22.04'
2394     needs: makedist
2395     steps:
2396     - name: Install CCache
2397       uses: hendrikmuhs/ccache-action@v1
2398       with:
2399         key: ${{ github.job }}
2400     - name: Fetch distribution
2401       uses: actions/download-artifact@v4
2402     - name: Unpack distribution
2403       run: |
2404         mv artifact/* .
2405         rmdir artifact
2406         # Do actual unpacking in the VM, mostly to help reduce the size of the
2407         # rsync output in the logs.
2408     - uses: vmactions/netbsd-vm@v1
2409       # Limit wasted resources if the VM action gets into an infinite loop.
2410       timeout-minutes: 60
2411       with:
2412         # Default is ksh, which should be OK.
2413         # usesh: true
2414         prepare: |
2415           set -e
2416           /usr/sbin/pkg_add -u ccache perl pcre2
2417           ccache --set-config=cache_dir="$HOME/work/xapian/xapian/.ccache"
2418           ccache --set-config=max_size='500M'
2419           ccache --set-config=compression=true
2420         run: |
2421           set -e
2422           ulimit
2423           export CC='ccache cc'
2424           export CXX='ccache c++'
2425           mv xapian-* "$HOME"
2426           cd
2427           cd xapian-core
2428           tar --strip-components=1 -xf xapian-core-*.tar.xz
2429           ./configure --enable-werror
2430           export XAPIAN_CONFIG=$PWD/xapian-config
2431           cd ..
2432           cd xapian-applications/omega
2433           tar --strip-components=1 -xf xapian-omega-*.tar.xz
2434           ./configure --enable-werror
2435           cd ../..
2436           # cd xapian-bindings
2437           # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
2438           # cd ..
2439           cd xapian-letor
2440           tar --strip-components=1 -xf xapian-letor-*.tar.xz
2441           ./configure --enable-werror
2442           cd ..
2443           # Everything gets run in one script so use V=0 to reduce the size of
2444           # the log, but re-run without V=0 on failure to show the compiler
2445           # command line.
2446           make -j2 -C xapian-core V=0 || make -C xapian-core
2447           make -j2 -C xapian-applications/omega V=0 || make -C xapian-applications/omega
2448           make -j2 -C xapian-letor V=0 || make -C xapian-letor
2449           export AUTOMATED_TESTING=1
2450           export VERBOSE=1
2451           make -j2 -C xapian-core check V=0
2452           make -j2 -C xapian-applications/omega check V=0
2453           make -j2 -C xapian-letor check V=0
2454           # Avoid bloating output with a huge file tree visualisation.
2455           rm -rf xapian-*
2457   openbsd:
2458     runs-on: 'ubuntu-22.04'
2459     needs: makedist
2460     steps:
2461     - name: Install CCache
2462       uses: hendrikmuhs/ccache-action@v1
2463       with:
2464         key: ${{ github.job }}
2465     - name: Fetch distribution
2466       uses: actions/download-artifact@v4
2467     - name: Unpack distribution
2468       run: |
2469         mv artifact/* .
2470         rmdir artifact
2471         # Do actual unpacking in the VM, mostly to help reduce the size of the
2472         # rsync output in the logs.
2473     - uses: vmactions/openbsd-vm@v1
2474       # Limit wasted resources if the VM action gets into an infinite loop.
2475       timeout-minutes: 60
2476       with:
2477         # Default is ksh, which should be OK.
2478         # usesh: true
2479         prepare: |
2480           set -e
2481           pkg_add ccache gtar-1.35 libmagic
2482           ccache --set-config=cache_dir="$HOME/work/xapian/xapian/.ccache"
2483           ccache --set-config=max_size='500M'
2484           ccache --set-config=compression=true
2485         run: |
2486           set -e
2487           export CC='ccache cc'
2488           export CXX='ccache c++'
2489           mv xapian-* "$HOME"
2490           cd
2491           cd xapian-core
2492           gtar --strip-components=1 -xf xapian-core-*.tar.xz
2493           ./configure --enable-werror
2494           export XAPIAN_CONFIG=$PWD/xapian-config
2495           $XAPIAN_CONFIG --ltlibs || true
2496           $XAPIAN_CONFIG --libs || true
2497           $XAPIAN_CONFIG --cxxflags || true
2498           cd ..
2499           cd xapian-applications/omega
2500           gtar --strip-components=1 -xf xapian-omega-*.tar.xz
2501           ./configure --enable-werror
2502           cd ../..
2503           # cd xapian-bindings
2504           # gtar --strip-components=1 -xf xapian-bindings-*.tar.xz
2505           # ./configure --enable-werror
2506           # cd ..
2507           cd xapian-letor
2508           gtar --strip-components=1 -xf xapian-letor-*.tar.xz
2509           ./configure --enable-werror
2510           cd ..
2511           # Everything gets run in one script so use V=0 to reduce the size of
2512           # the log, but re-run without V=0 on failure to show the compiler
2513           # command line.
2514           make -j2 -C xapian-core V=0 || make -C xapian-core
2515           make -j2 -C xapian-applications/omega V=0 || make -C xapian-applications/omega
2516           # make -j2 -C xapian-bindings V=0 || make -C xapian-bindings
2517           make -j2 -C xapian-letor V=0 || make -C xapian-letor
2518           export AUTOMATED_TESTING=1
2519           export VERBOSE=1
2520           make -j2 -C xapian-core check V=0
2521           make -j2 -C xapian-applications/omega check V=0
2522           # make -j2 -C xapian-bindings check V=0
2523           make -j2 -C xapian-letor check V=0
2524           # Avoid bloating output with a huge file tree visualisation.
2525           rm -rf xapian-*
2527   checkpatch:
2528     name: 'Automated run of xapian-check-patch'
2529     runs-on: 'ubuntu-latest'
2530     steps:
2531     - name: Check out repository code
2532       uses: actions/checkout@v4
2533       with:
2534         fetch-depth: 0
2535         show-progress: false
2536     - name: "Automated run of xapian-check-patch"
2537       # Run the style checking script, checking changes between the common
2538       # ancestor of the target branch of the PR (or master if this isn't a PR)
2539       # and the revision being checked.
2540       run: |
2541         case ${GITHUB_BASE_REF:+PR}:`git remote get-url origin` in
2542           PR:*)
2543             BASE=origin/$GITHUB_BASE_REF ;;
2544           :https://github.com/xapian/xapian)
2545             BASE=origin/master ;;
2546           *)
2547             git remote add xapian https://github.com/xapian/xapian.git
2548             git fetch --no-tags xapian master
2549             BASE=xapian/master ;;
2550         esac
2551         git diff "${BASE}.." --|xapian-maintainer-tools/xapian-check-patch