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