[ci] Comment out lines with a consistent hash+space
[xapian.git] / .github / workflows / ci.yml
blobb9cbfe1a6428a1bc0a2c96611ba135561c65d53e
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: RELEASE/1.4
16     paths-ignore:
17       - '.appveyor.yml'
18       - NEWS
19       - 'xapian-maintainer-tools/**'
21   # Allows you to run this workflow manually from the Actions tab
22   workflow_dispatch:
24 jobs:
25   makedist:
26     name: 'make dist'
27     runs-on: 'ubuntu-latest'
28     steps:
29     - name: Check out repository code
30       uses: actions/checkout@v3
31     - name: Install CCache
32       uses: hendrikmuhs/ccache-action@v1
33       with:
34         key: ${{ github.job }}
35     - name: Cache bootstrap tools
36       uses: actions/cache@v3
37       with:
38         path: |
39           BUILD
40           INST
41         key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles( 'bootstrap', 'patches/**' ) }}
42     - name: Install package dependencies
43       run: |
44         sudo apt-get update
45         sudo apt-get install \
46             doxygen \
47             graphviz \
48             help2man \
49             python3-docutils \
50             pngcrush \
51             python3-sphinx \
52             uuid-dev \
53             libpcre2-dev \
54             libmagic-dev \
55             lua5.4 \
56             liblua5.4-dev \
57             mono-devel \
58             python2-dev \
59             python3-dev \
60             tcl \
61             tcl-dev
62     - name: bootstrap source tree
63       run: |
64         # If we restored cached bootstrap tools their timestamps will be older
65         # than checked out files, but we stored them based on a hash of the
66         # files in git that determine what gets built so we know they are in
67         # fact up to date.  Just touch any stamp files that exist.
68         touch --no-create INST/*.stamp
69         export PATH=/usr/lib/ccache:$PATH
70         echo verbose=off > ~/.wgetrc
71         ./bootstrap xapian-core xapian-applications/omega swig xapian-bindings
72     - name: configure
73       run: ./configure CC='ccache gcc' CXX='ccache g++'
74     - name: make
75       run: make -j2
76     - name: Run tests
77       run: make -j2 check AUTOMATED_TESTING=1 VERBOSE=1
78     - name: Create distribution tarball
79       run: |
80         make dist
81     - uses: actions/upload-artifact@v3
82       with:
83         path: |
84           xapian-core/xapian-core-*.tar.xz
85           xapian-applications/omega/xapian-omega-*.tar.xz
86           xapian-bindings/xapian-bindings-*.tar.xz
87         retention-days: 1
88         if-no-files-found: error
89     - name: Check generated files are in .gitignore
90       # grep '^' passes through all input while giving a non-zero exit status
91       # if that input is empty.
92       run: git status --porcelain|grep '^' && { echo "The generated files listed above are not in .gitignore" ; exit 1; }; true
94   GLIBCXX_DEBUG:
95     runs-on: 'ubuntu-20.04'
96     needs: makedist
97     steps:
98     - name: Install CCache
99       uses: hendrikmuhs/ccache-action@v1
100       with:
101         key: ${{ github.job }}
102     - name: Fetch distribution
103       uses: actions/download-artifact@v3
104     - name: Unpack distribution
105       run: |
106         mv artifact/* .
107         rmdir artifact
108         pushd xapian-core
109         tar --strip-components=1 -xf xapian-core-*.tar.xz
110         popd
111         pushd xapian-applications/omega
112         tar --strip-components=1 -xf xapian-omega-*.tar.xz
113         popd
114         pushd xapian-bindings
115         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
116         popd
117     - name: Install package dependencies
118       run: |
119         sudo apt-get update
120         sudo apt-get install \
121             python3-sphinx \
122             uuid-dev \
123             libpcre2-dev \
124             libmagic-dev \
125             lua5.3 \
126             liblua5.3-dev \
127             mono-devel \
128             python2-dev \
129             python3-dev \
130             tcl \
131             tcl-dev
132     - name: configure
133       run: |
134         export CC='ccache gcc'
135         export CXX='ccache g++'
136         export CPPFLAGS='-D_GLIBCXX_DEBUG'
137         pushd xapian-core
138         ./configure --enable-werror
139         export XAPIAN_CONFIG=$PWD/xapian-config
140         popd
141         pushd xapian-applications/omega
142         ./configure --enable-werror
143         popd
144         pushd xapian-bindings
145         ./configure --enable-werror
146         popd
147     - name: make
148       run: |
149         make -j2 -C xapian-core
150         make -j2 -C xapian-applications/omega
151         make -j2 -C xapian-bindings
152     - name: Run tests
153       run: |
154         export AUTOMATED_TESTING=1
155         export VERBOSE=1
156         make -j2 -C xapian-core check
157         make -j2 -C xapian-applications/omega check
158         make -j2 -C xapian-bindings check
160   FORTIFY_SOURCE_3:
161     # _FORTIFY_SOURCE level 3 requires GCC 12, so currently we need to use
162     # Ubuntu 22.04 and the gcc-12 and g++12 packages.
163     runs-on: 'ubuntu-22.04'
164     needs: makedist
165     steps:
166     - name: Install CCache
167       uses: hendrikmuhs/ccache-action@v1
168       with:
169         key: ${{ github.job }}
170     - name: Fetch distribution
171       uses: actions/download-artifact@v3
172     - name: Unpack distribution
173       run: |
174         mv artifact/* .
175         rmdir artifact
176         pushd xapian-core
177         tar --strip-components=1 -xf xapian-core-*.tar.xz
178         popd
179         pushd xapian-applications/omega
180         tar --strip-components=1 -xf xapian-omega-*.tar.xz
181         popd
182         pushd xapian-bindings
183         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
184     - name: Install package dependencies
185       run: |
186         sudo apt-get update
187         sudo apt-get install \
188             gcc-12 \
189             g++-12 \
190             python3-sphinx \
191             uuid-dev \
192             libpcre2-dev \
193             libmagic-dev \
194             lua5.4 \
195             liblua5.4-dev \
196             mono-devel \
197             python2-dev \
198             python3-dev \
199             tcl \
200             tcl-dev
201     - name: configure
202       run: |
203         export CC='ccache gcc-12'
204         export CXX='ccache g++-12'
205         # Ubuntu's GCC packages define _FORTIFY_SOURCE=2 by default, so we need
206         # to undefine it before we define it to avoid a warning (which becomes
207         # an error with -Werror).
208         export CPPFLAGS='-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3'
209         pushd xapian-core
210         ./configure --enable-werror
211         export XAPIAN_CONFIG=$PWD/xapian-config
212         popd
213         pushd xapian-applications/omega
214         ./configure --enable-werror
215         popd
216         pushd xapian-bindings
217         ./configure --enable-werror
218         popd
219     - name: make
220       run: |
221         make -j2 -C xapian-core
222         make -j2 -C xapian-applications/omega
223         make -j2 -C xapian-bindings
224     - name: Run tests
225       run: |
226         export AUTOMATED_TESTING=1
227         export VERBOSE=1
228         make -j2 -C xapian-core check
229         make -j2 -C xapian-applications/omega check
230         make -j2 -C xapian-bindings check
232   assertions:
233     runs-on: 'ubuntu-22.04'
234     needs: makedist
235     steps:
236     - name: Install CCache
237       uses: hendrikmuhs/ccache-action@v1
238       with:
239         key: ${{ github.job }}
240     - name: Fetch distribution
241       uses: actions/download-artifact@v3
242     - name: Unpack distribution
243       run: |
244         mv artifact/* .
245         rmdir artifact
246         pushd xapian-core
247         tar --strip-components=1 -xf xapian-core-*.tar.xz
248         popd
249         pushd xapian-applications/omega
250         tar --strip-components=1 -xf xapian-omega-*.tar.xz
251         popd
252         pushd xapian-bindings
253         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
254         popd
255     - name: Install package dependencies
256       run: |
257         sudo apt-get update
258         sudo apt-get install \
259             python3-sphinx \
260             uuid-dev \
261             libpcre2-dev \
262             libmagic-dev \
263             lua5.4 \
264             liblua5.4-dev \
265             mono-devel \
266             python2-dev \
267             python3-dev \
268             tcl \
269             tcl-dev
270     - name: configure
271       run: |
272         export CC='ccache gcc'
273         export CXX='ccache g++'
274         pushd xapian-core
275         ./configure --enable-werror --enable-assertions
276         export XAPIAN_CONFIG=$PWD/xapian-config
277         popd
278         pushd xapian-applications/omega
279         ./configure --enable-werror
280         popd
281         pushd xapian-bindings
282         ./configure --enable-werror
283         popd
284     - name: make
285       run: |
286         make -j2 -C xapian-core
287         make -j2 -C xapian-applications/omega
288         make -j2 -C xapian-bindings
289     - name: Run tests
290       run: |
291         export AUTOMATED_TESTING=1
292         export VERBOSE=1
293         make -j2 -C xapian-core check
294         make -j2 -C xapian-applications/omega check
295         make -j2 -C xapian-bindings check
297   debug-log:
298     runs-on: 'ubuntu-22.04'
299     needs: makedist
300     steps:
301     - name: Install CCache
302       uses: hendrikmuhs/ccache-action@v1
303       with:
304         key: ${{ github.job }}
305     - name: Fetch distribution
306       uses: actions/download-artifact@v3
307     - name: Unpack distribution
308       run: |
309         mv artifact/* .
310         rmdir artifact
311         pushd xapian-core
312         tar --strip-components=1 -xf xapian-core-*.tar.xz
313         popd
314         pushd xapian-applications/omega
315         tar --strip-components=1 -xf xapian-omega-*.tar.xz
316         popd
317         pushd xapian-bindings
318         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
319         popd
320     - name: Install package dependencies
321       run: |
322         sudo apt-get update
323         sudo apt-get install \
324             python3-sphinx \
325             uuid-dev \
326             libpcre2-dev \
327             libmagic-dev \
328             lua5.4 \
329             liblua5.4-dev \
330             mono-devel \
331             python2-dev \
332             python3-dev \
333             tcl \
334             tcl-dev
335     - name: configure
336       run: |
337         export CC='ccache gcc'
338         export CXX='ccache g++'
339         pushd xapian-core
340         ./configure --enable-werror --enable-log
341         export XAPIAN_CONFIG=$PWD/xapian-config
342         popd
343         pushd xapian-applications/omega
344         ./configure --enable-werror
345         popd
346         pushd xapian-bindings
347         ./configure --enable-werror
348         popd
349     - name: make
350       run: |
351         make -j2 -C xapian-core
352         make -j2 -C xapian-applications/omega
353         make -j2 -C xapian-bindings
354     - name: Run tests
355       run: |
356         export AUTOMATED_TESTING=1
357         export VERBOSE=1
358         make -j2 -C xapian-core check
359         make -j2 -C xapian-applications/omega check
360         make -j2 -C xapian-bindings check
362   clang:
363     runs-on: 'ubuntu-20.04'
364     needs: makedist
365     steps:
366     - name: Install CCache
367       uses: hendrikmuhs/ccache-action@v1
368       with:
369         key: ${{ github.job }}
370     - name: Fetch distribution
371       uses: actions/download-artifact@v3
372     - name: Unpack distribution
373       run: |
374         mv artifact/* .
375         rmdir artifact
376         pushd xapian-core
377         tar --strip-components=1 -xf xapian-core-*.tar.xz
378         popd
379         pushd xapian-applications/omega
380         tar --strip-components=1 -xf xapian-omega-*.tar.xz
381         popd
382         pushd xapian-bindings
383         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
384         popd
385     - name: Install package dependencies
386       run: |
387         env
388         sudo apt-get update
389         sudo apt-get install \
390             clang \
391             libc++-dev
392         sudo apt-get install \
393             python3-sphinx \
394             uuid-dev \
395             libpcre2-dev \
396             libmagic-dev \
397             python3-dev \
398             tcl \
399             tcl-dev
400     - name: configure
401       run: |
402         export CC='ccache clang'
403         # Build with the llvm c++ library to catch more portability issues.
404         export CXX='ccache clang++ -stdlib=libc++'
405         pushd xapian-core
406         ./configure --enable-werror
407         export XAPIAN_CONFIG=$PWD/xapian-config
408         popd
409         pushd xapian-applications/omega
410         ./configure --enable-werror
411         popd
412         pushd xapian-bindings
413         ./configure --enable-werror --with-python3 --with-tcl
414         popd
415     - name: make
416       run: |
417         make -j2 -C xapian-core
418         make -j2 -C xapian-applications/omega
419         make -j2 -C xapian-bindings
420     - name: Run tests
421       run: |
422         export AUTOMATED_TESTING=1
423         export VERBOSE=1
424         make -j2 -C xapian-core check
425         make -j2 -C xapian-applications/omega check
426         make -j2 -C xapian-bindings check
428   # Test with the oldest clang version we easily can.
429   clang6:
430     runs-on: 'ubuntu-20.04'
431     needs: makedist
432     steps:
433     - name: Install CCache
434       uses: hendrikmuhs/ccache-action@v1
435       with:
436         key: ${{ github.job }}
437     - name: Fetch distribution
438       uses: actions/download-artifact@v3
439     - name: Unpack distribution
440       run: |
441         mv artifact/* .
442         rmdir artifact
443         pushd xapian-core
444         tar --strip-components=1 -xf xapian-core-*.tar.xz
445         popd
446         pushd xapian-applications/omega
447         tar --strip-components=1 -xf xapian-omega-*.tar.xz
448         popd
449         pushd xapian-bindings
450         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
451         popd
452     - name: Install package dependencies
453       run: |
454         env
455         sudo apt-get update
456         sudo apt-get install \
457             clang-6.0
458         sudo apt-get install \
459             python3-sphinx \
460             uuid-dev \
461             libpcre2-dev \
462             libmagic-dev \
463             python3-dev \
464             tcl \
465             tcl-dev
466     - name: configure
467       run: |
468         export CC='ccache clang-6.0'
469         export CXX='ccache clang++-6.0'
470         pushd xapian-core
471         ./configure --enable-werror
472         export XAPIAN_CONFIG=$PWD/xapian-config
473         popd
474         pushd xapian-applications/omega
475         ./configure --enable-werror
476         popd
477         pushd xapian-bindings
478         ./configure --enable-werror --with-python3 --with-tcl
479         popd
480     - name: make
481       run: |
482         make -j2 -C xapian-core
483         make -j2 -C xapian-applications/omega
484         make -j2 -C xapian-bindings
485     - name: Run tests
486       run: |
487         export AUTOMATED_TESTING=1
488         export VERBOSE=1
489         make -j2 -C xapian-core check
490         make -j2 -C xapian-applications/omega check
491         make -j2 -C xapian-bindings check
493   # GCC 4.7 is the oldest GCC we aim to support for 1.4.x, but the oldest we can
494   # easily build with in github actions is 7.5.0.
495   GCC7:
496     name: 'GCC 7'
497     runs-on: 'ubuntu-20.04'
498     needs: makedist
499     steps:
500     - name: Install CCache
501       uses: hendrikmuhs/ccache-action@v1
502       with:
503         key: ${{ github.job }}
504     - name: Fetch distribution
505       uses: actions/download-artifact@v3
506     - name: Unpack distribution
507       run: |
508         mv artifact/* .
509         rmdir artifact
510         pushd xapian-core
511         tar --strip-components=1 -xf xapian-core-*.tar.xz
512         popd
513         pushd xapian-applications/omega
514         tar --strip-components=1 -xf xapian-omega-*.tar.xz
515         popd
516         pushd xapian-bindings
517         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
518         popd
519     - name: Install package dependencies
520       run: |
521         sudo apt-get update
522         sudo apt-get install \
523             gcc-7 \
524             g++-7
525         sudo apt-get install \
526             python3-sphinx \
527             uuid-dev \
528             libpcre2-dev \
529             libmagic-dev \
530             lua5.3 \
531             liblua5.3-dev \
532             mono-devel \
533             python2-dev \
534             python3-dev \
535             tcl \
536             tcl-dev
537     - name: configure
538       run: |
539         export CC='ccache gcc-7'
540         export CXX='ccache g++-7'
541         pushd xapian-core
542         ./configure --enable-werror
543         export XAPIAN_CONFIG=$PWD/xapian-config
544         popd
545         pushd xapian-applications/omega
546         ./configure --enable-werror
547         popd
548         pushd xapian-bindings
549         ./configure --enable-werror
550         popd
551     - name: make
552       run: |
553         make -j2 -C xapian-core
554         make -j2 -C xapian-applications/omega
555         make -j2 -C xapian-bindings
556     - name: Run tests
557       run: |
558         export AUTOMATED_TESTING=1
559         export VERBOSE=1
560         make -j2 -C xapian-core check
561         make -j2 -C xapian-applications/omega check
562         make -j2 -C xapian-bindings check
564   macos:
565     runs-on: 'macos-latest'
566     needs: makedist
567     steps:
568     - name: Install CCache
569       uses: hendrikmuhs/ccache-action@v1
570       with:
571         key: ${{ github.job }}
572     - name: Fetch distribution
573       uses: actions/download-artifact@v3
574     - name: Unpack distribution
575       run: |
576         mv artifact/* .
577         rmdir artifact
578         pushd xapian-core
579         tar --strip-components=1 -xf xapian-core-*.tar.xz
580         popd
581         pushd xapian-applications/omega
582         tar --strip-components=1 -xf xapian-omega-*.tar.xz
583         popd
584         pushd xapian-bindings
585         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
586         popd
587     - name: Install package dependencies
588       run: |
589         # Workaround apparent homebrew bug 2023-01-18
590         rm -f /usr/local/bin/2to3-3.11 /usr/local/bin/idle3.11 /usr/local/bin/pydoc3.11 /usr/local/bin/python3.11 /usr/local/bin/python3.11-config
591         rm -f /usr/local/bin/2to3 /usr/local/bin/idle3 /usr/local/bin/pydoc3 /usr/local/bin/python3 /usr/local/bin/python3-config
592         brew update
593         brew install \
594             libeatmydata \
595             libiconv \
596             libmagic \
597             lua \
598             mono-mdk \
599             pcre2 \
600             pkgconfig \
601             pygments \
602             python \
603             sphinx-doc
604     - name: configure
605       run: |
606         export CC='ccache gcc'
607         export CXX='ccache g++'
608         # Workaround for https://github.com/Homebrew/homebrew-core/issues/136873
609         export EATMYDATA=$(brew --prefix libeatmydata)/bin/eatmydata
610         export PKG_CONFIG_PATH=/usr/local/opt/icu4c/lib/pkgconfig
611         pushd xapian-core
612         ./configure --enable-werror --prefix='${{ runner.temp }}/XapianInstall'
613         export XAPIAN_CONFIG=$PWD/xapian-config
614         popd
615         pushd xapian-applications/omega
616         ./configure --enable-werror --with-libiconv-prefix=/usr/local/opt/libiconv
617         popd
618         pushd xapian-bindings
619         ./configure --enable-werror
620         popd
621     - name: make
622       run: |
623         make -j3 -C xapian-core
624         make -j3 -C xapian-core install
625         make -j3 -C xapian-applications/omega
626         make -j3 -C xapian-bindings
627     - name: Run tests
628       run: |
629         export AUTOMATED_TESTING=1
630         export VERBOSE=1
631         make -j3 -C xapian-core check
632         make -j3 -C xapian-applications/omega check
633         make -j3 -C xapian-bindings check
635   mingw64-i686-cross:
636     runs-on: 'ubuntu-22.04'
637     needs: makedist
638     steps:
639     - name: Install CCache
640       uses: hendrikmuhs/ccache-action@v1
641       with:
642         key: ${{ github.job }}
643     - name: Fetch distribution
644       uses: actions/download-artifact@v3
645     - name: Unpack distribution
646       run: |
647         mv artifact/* .
648         rmdir artifact
649         pushd xapian-core
650         tar --strip-components=1 -xf xapian-core-*.tar.xz
651         popd
652     - name: Install package dependencies
653       run: |
654         sudo apt-get update
655         sudo apt-get install \
656             g++-mingw-w64-i686-win32 \
657             mingw-w64-i686-dev \
658             binutils-mingw-w64-i686 \
659             libz-mingw-w64-dev \
660             mingw-w64-tools
661     - name: configure
662       run: |
663         export EATMYDATA=
664         export PATH=/usr/lib/ccache:$PATH
665         cd xapian-core
666         ./configure --enable-werror --host i686-w64-mingw32
667     - name: make
668       run: |
669         export PATH=/usr/lib/ccache:$PATH
670         make -j2 -C xapian-core
671     - name: Run tests
672       run: |
673         # Stop mono binfmt trying to run .exe files.
674         sudo apt-get purge mono-runtime
675         sudo dpkg --add-architecture i386
676         sudo apt-get update
677         sudo apt-get install wine32 wine-binfmt:amd64 wine:amd64
678         export AUTOMATED_TESTING=1
679         export VERBOSE=1
680         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/ .*//'`"
681         make -j2 -C xapian-core check
683   mingw64-x86-64-cross:
684     runs-on: 'ubuntu-22.04'
685     needs: makedist
686     steps:
687     - name: Install CCache
688       uses: hendrikmuhs/ccache-action@v1
689       with:
690         key: ${{ github.job }}
691     - name: Fetch distribution
692       uses: actions/download-artifact@v3
693     - name: Unpack distribution
694       run: |
695         mv artifact/* .
696         rmdir artifact
697         pushd xapian-core
698         tar --strip-components=1 -xf xapian-core-*.tar.xz
699         popd
700     - name: Install package dependencies
701       run: |
702         sudo apt-get update
703         # Stop mono binfmt trying to run .exe files.
704         sudo apt-get purge mono-runtime
705         sudo apt-get install \
706             g++-mingw-w64-x86-64-win32 \
707             mingw-w64-x86-64-dev \
708             binutils-mingw-w64-x86-64 \
709             libz-mingw-w64-dev \
710             mingw-w64-tools \
711             wine-binfmt \
712             wine \
713             wine64
714         sudo dpkg --add-architecture i386
715         sudo apt-get update
716         sudo apt-get install wine32
717     - name: configure
718       run: |
719         export EATMYDATA=
720         export PATH=/usr/lib/ccache:$PATH
721         cd xapian-core
722         ./configure --enable-werror --host x86_64-w64-mingw32
723     - name: make
724       run: |
725         export PATH=/usr/lib/ccache:$PATH
726         make -j2 -C xapian-core
727     - name: Run tests
728       run: |
729         export AUTOMATED_TESTING=1
730         export VERBOSE=1
731         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/ .*//'`"
732         make -j2 -C xapian-core check
734   Fedora:
735     runs-on: 'ubuntu-22.04'
736     container: fedora:35
737     needs: makedist
738     steps:
739     - name: Install build tools
740       run: dnf install -y --nodocs ccache xz
741     - name: Install CCache
742       uses: hendrikmuhs/ccache-action@v1
743       with:
744         key: ${{ github.job }}
745     - name: Fetch distribution
746       uses: actions/download-artifact@v3
747     - name: Unpack distribution
748       run: |
749         mv artifact/* .
750         rmdir artifact
751         pushd xapian-core
752         tar --strip-components=1 -xf xapian-core-*.tar.xz
753         popd
754         pushd xapian-applications/omega
755         tar --strip-components=1 -xf xapian-omega-*.tar.xz
756         popd
757         pushd xapian-bindings
758         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
759         popd
760     - name: Install package dependencies
761       run: |
762         dnf install -y --nodocs \
763         gcc-c++ file-devel libuuid-devel pcre2-devel perl zlib-devel make pkg-config \
764         python3-devel python3-setuptools python3-sphinx \
765         ruby ruby-devel rubygems rubygem-rdoc rubygem-json rubygem-test-unit \
766         tcl-devel
767     - name: configure
768       run: |
769         export CC='ccache gcc'
770         export CXX='ccache g++'
771         pushd xapian-core
772         ./configure --enable-werror
773         export XAPIAN_CONFIG=$PWD/xapian-config
774         popd
775         pushd xapian-applications/omega
776         ./configure --enable-werror
777         popd
778         pushd xapian-bindings
779         ./configure --enable-werror
780         popd
781     - name: make
782       run: |
783         make -j2 -C xapian-core
784         make -j2 -C xapian-applications/omega
785         make -j2 -C xapian-bindings
786     - name: Run tests
787       run: |
788         export AUTOMATED_TESTING=1
789         export VERBOSE=1
790         make -j2 -C xapian-core check
791         make -j2 -C xapian-applications/omega check
792         make -j2 -C xapian-bindings check
794   android-cross:
795     runs-on: 'ubuntu-22.04'
796     env:
797       NDK: '/usr/local/lib/android/sdk/ndk/25.2.9519653'
798       # NDK: '/home/runner/ndk'
799       host_triplet: 'armv7a-linux-androideabi33'
800     needs: makedist
801     steps:
802     - name: Install CCache
803       uses: hendrikmuhs/ccache-action@v1
804       with:
805         key: ${{ github.job }}
806     - name: Fetch distribution
807       uses: actions/download-artifact@v3
808     - name: Unpack distribution
809       run: |
810         mv artifact/* .
811         rmdir artifact
812         pushd xapian-core
813         tar --strip-components=1 -xf xapian-core-*.tar.xz
814         popd
815     - name: configure
816       run: |
817         PATH=$PATH:$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin
818         cd xapian-core
819         ./configure --enable-werror \
820             --host=$host_triplet \
821             CC="ccache ${host_triplet}-clang" \
822             CXX="ccache ${host_triplet}-clang++" \
823             PKG_CONFIG=/bin/false
824     - name: make
825       run: |
826         PATH=$PATH:$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin
827         make -j2 -C xapian-core
828       # FIXME: Run tests under android emulator?
830   cygwin:
831     # We only test 64-bit cygwin as 32-bit support has been dropped as of
832     # Cygwin 3.4:
833     # https://cygwin.com/pipermail/cygwin/2022-November/252542.html
834     runs-on: 'windows-latest'
835     needs: makedist
836     defaults:
837       run:
838         # `-o incr` needed as GHA supplies shell fragments with DOS EOLs.
839         shell: 'C:\tools\cygwin\bin\bash.EXE --noprofile --norc -e -o igncr -o pipefail {0}'
840     steps:
841     - name: Install Cygwin
842       uses: egor-tensin/setup-cygwin@v4
843       with:
844         packages: gcc-g++ make file-devel libpcre2-devel zlib-devel perl
845     - name: Fetch distribution
846       uses: actions/download-artifact@v3
847     - name: Unpack distribution
848       run: |
849         mv artifact/* .
850         rmdir artifact
851         pushd xapian-core
852         tar --strip-components=1 -xf xapian-core-*.tar.xz
853         popd
854         pushd xapian-applications/omega
855         tar --strip-components=1 -xf xapian-omega-*.tar.xz
856         popd
857         pushd xapian-bindings
858         tar --strip-components=1 -xf xapian-bindings-*.tar.xz
859         popd
860     - name: configure
861       run: |
862         pushd xapian-core
863         ./configure --enable-werror
864         export XAPIAN_CONFIG=$PWD/xapian-config
865         popd
866         pushd xapian-applications/omega
867         ./configure --enable-werror
868         popd
869         # pushd xapian-bindings
870         # ./configure --enable-werror
871         # popd
872     - name: make
873       run: |
874         make -j2 -C xapian-core
875         make -j2 -C xapian-applications/omega
876         # make -j2 -C xapian-bindings
877     - name: Run tests
878       run: |
879         export AUTOMATED_TESTING=1
880         export VERBOSE=1
881         make -j2 -C xapian-core check
882         make -j2 -C xapian-applications/omega check
883         # make -j2 -C xapian-bindings check
885   msys2-mingw32:
886     runs-on: 'windows-latest'
887     needs: makedist
888     defaults:
889       run:
890         shell: msys2 {0}
891     steps:
892     - uses: msys2/setup-msys2@v2
893       with:
894         msystem: mingw32
895         install: base-devel
896         pacboy: >-
897           gcc:p
898           zlib:p
899     - name: Install CCache
900       uses: hendrikmuhs/ccache-action@v1
901       with:
902         key: ${{ github.job }}
903         variant: sccache
904     - name: Fetch distribution
905       uses: actions/download-artifact@v3
906     - name: Unpack distribution
907       run: |
908         mv artifact/* .
909         rmdir artifact
910         pushd xapian-core
911         tar --strip-components=1 -xf xapian-core-*.tar.xz
912         popd
913         # pushd xapian-applications/omega
914         # tar --strip-components=1 -xf xapian-omega-*.tar.xz
915         # popd
916         # pushd xapian-bindings
917         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
918         # popd
919     - name: configure
920       run: |
921         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
922         export CC='sccache gcc'
923         export CXX='sccache g++'
924         pushd xapian-core
925         ./configure --enable-werror
926         export XAPIAN_CONFIG=$PWD/xapian-config
927         popd
928         # pushd xapian-applications/omega
929         # ./configure --enable-werror
930         # popd
931         # pushd xapian-bindings
932         # ./configure --enable-werror
933         # popd
934     - name: make
935       run: |
936         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
937         make -j2 -C xapian-core
938         # make -j2 -C xapian-applications/omega
939         # make -j2 -C xapian-bindings
940     - name: Run tests
941       run: |
942         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
943         export AUTOMATED_TESTING=1
944         export VERBOSE=1
945         make -j2 -C xapian-core check
946         # make -j2 -C xapian-applications/omega check
947         # make -j2 -C xapian-bindings check
949   msys2-mingw64:
950     runs-on: 'windows-latest'
951     needs: makedist
952     defaults:
953       run:
954         shell: msys2 {0}
955     steps:
956     - uses: msys2/setup-msys2@v2
957       with:
958         msystem: mingw64
959         install: base-devel
960         pacboy: >-
961           gcc:p
962           zlib:p
963     - name: Install CCache
964       uses: hendrikmuhs/ccache-action@v1
965       with:
966         key: ${{ github.job }}
967         variant: sccache
968     - name: Fetch distribution
969       uses: actions/download-artifact@v3
970     - name: Unpack distribution
971       run: |
972         mv artifact/* .
973         rmdir artifact
974         pushd xapian-core
975         tar --strip-components=1 -xf xapian-core-*.tar.xz
976         popd
977         # pushd xapian-applications/omega
978         # tar --strip-components=1 -xf xapian-omega-*.tar.xz
979         # popd
980         # pushd xapian-bindings
981         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
982         # popd
983     - name: configure
984       run: |
985         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
986         export CC='sccache gcc'
987         export CXX='sccache g++'
988         pushd xapian-core
989         ./configure --enable-werror
990         export XAPIAN_CONFIG=$PWD/xapian-config
991         popd
992         # pushd xapian-applications/omega
993         # ./configure --enable-werror
994         # popd
995         # pushd xapian-bindings
996         # ./configure --enable-werror
997         # popd
998     - name: make
999       run: |
1000         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1001         make -j2 -C xapian-core
1002         # make -j2 -C xapian-applications/omega
1003         # make -j2 -C xapian-bindings
1004     - name: Run tests
1005       run: |
1006         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1007         export AUTOMATED_TESTING=1
1008         export VERBOSE=1
1009         make -j2 -C xapian-core check
1010         # make -j2 -C xapian-applications/omega check
1011         # make -j2 -C xapian-bindings check
1013   msys2-ucrt64:
1014     runs-on: 'windows-latest'
1015     needs: makedist
1016     defaults:
1017       run:
1018         shell: msys2 {0}
1019     steps:
1020     - uses: msys2/setup-msys2@v2
1021       with:
1022         msystem: ucrt64
1023         install: base-devel
1024         pacboy: >-
1025           gcc:p
1026           zlib:p
1027     - name: Install CCache
1028       uses: hendrikmuhs/ccache-action@v1
1029       with:
1030         key: ${{ github.job }}
1031         variant: sccache
1032     - name: Fetch distribution
1033       uses: actions/download-artifact@v3
1034     - name: Unpack distribution
1035       run: |
1036         mv artifact/* .
1037         rmdir artifact
1038         pushd xapian-core
1039         tar --strip-components=1 -xf xapian-core-*.tar.xz
1040         popd
1041         # pushd xapian-applications/omega
1042         # tar --strip-components=1 -xf xapian-omega-*.tar.xz
1043         # popd
1044         # pushd xapian-bindings
1045         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1046         # popd
1047     - name: configure
1048       run: |
1049         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1050         export CC='sccache gcc'
1051         export CXX='sccache g++'
1052         pushd xapian-core
1053         ./configure --enable-werror
1054         export XAPIAN_CONFIG=$PWD/xapian-config
1055         popd
1056         # pushd xapian-applications/omega
1057         # ./configure --enable-werror
1058         # popd
1059         # pushd xapian-bindings
1060         # ./configure --enable-werror
1061         # popd
1062     - name: make
1063       run: |
1064         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1065         make -j2 -C xapian-core
1066         # make -j2 -C xapian-applications/omega
1067         # make -j2 -C xapian-bindings
1068     - name: Run tests
1069       run: |
1070         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1071         export AUTOMATED_TESTING=1
1072         export VERBOSE=1
1073         make -j2 -C xapian-core check
1074         # make -j2 -C xapian-applications/omega check
1075         # make -j2 -C xapian-bindings check
1077   msvc2019:
1078     runs-on: 'windows-2019'
1079     needs: makedist
1080     defaults:
1081       run:
1082         shell: msys2 {0}
1083     steps:
1084     - uses: msys2/setup-msys2@v2
1085       with:
1086         release: true # Use the pre-installed MSYS2
1087         path-type: inherit
1088         install: base-devel
1089     - name: Install CCache
1090       uses: hendrikmuhs/ccache-action@v1
1091       with:
1092         key: ${{ github.job }}
1093         variant: sccache
1094     - name: Fetch distribution
1095       uses: actions/download-artifact@v3
1096     - name: Unpack distribution
1097       run: |
1098         mv artifact/* .
1099         rmdir artifact
1100         pushd xapian-core
1101         tar --strip-components=1 -xf xapian-core-*.tar.xz
1102         popd
1103         # Need libmagic for omega
1104         # pushd xapian-applications/omega
1105         # tar --strip-components=1 -xf xapian-omega-*.tar.xz
1106         # popd
1107         # pushd xapian-bindings
1108         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1109         # popd
1110     - name: Set up Visual Studio shell
1111       uses: egor-tensin/vs-shell@v2
1112       with:
1113         arch: x64
1114     - name: Build zlib
1115       shell: bash
1116       run: |
1117         # Setup sccache for cl.
1118         ln /c/Users/runneradmin/.cargo/bin/{sccache.exe,cl.exe}
1119         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1120         # We find "link" from coreutils rather than from MSVC.  The coreutils
1121         # "link" is not a useful tool to us, so just delete it rather than
1122         # trying to reorder PATH.
1123         rm /usr/bin/link.exe || true
1124         mkdir zlib
1125         pushd zlib
1126         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 -
1127         # Don't build zlib with -MD as it seems this flag needs to be used
1128         # consistently across the build.  Don't use -Zi -Fd"zlib" as
1129         # ccache/sccache don't seem to be able to handle that.
1130         #
1131         # Don't build zlib with a fixed base address on x64 as that gives
1132         # linker warning LNK4281.
1133         sed -i 's/\(^CFLAGS  *= *-nologo \)-MD \(.* \)-Zi -Fd"zlib" /\1\2/;s/-base:0x[0-9A-Fa-f]* //' win32/Makefile.msc
1134         # Only build the shared library.
1135         nmake -nologo -f 'win32\Makefile.msc' zlib1.dll
1136         popd
1137     - name: configure
1138       run: |
1139         export AR=lib
1140         export CC="cl -nologo"
1141         export CXX="$PWD/xapian-core/compile cl -nologo"
1142         export CPPFLAGS="-I$PWD/zlib"
1143         # Standard C++ stack unwinding; assume extern "C" functions never throw.
1144         export CXXFLAGS=-EHsc
1145         export LDFLAGS="-L$PWD/zlib"
1146         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1147         pushd xapian-core
1148         ./configure --enable-werror --disable-shared
1149         export XAPIAN_CONFIG=$PWD/xapian-config
1150         popd
1151         # pushd xapian-applications/omega
1152         # ./configure --enable-werror
1153         # popd
1154         # pushd xapian-bindings
1155         # ./configure --enable-werror
1156         # popd
1157     - name: make
1158       run: |
1159         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1160         make -j2 -C xapian-core
1161         # make -j2 -C xapian-applications/omega
1162         # make -j2 -C xapian-binding
1163     - name: Run tests
1164       run: |
1165         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1166         export AUTOMATED_TESTING=1
1167         export VERBOSE=1
1168         make -j2 -C xapian-core check
1169         # make -j2 -C xapian-applications/omega check
1170         # make -j2 -C xapian-bindings check
1172   msvc2022:
1173     runs-on: 'windows-2022'
1174     needs: makedist
1175     defaults:
1176       run:
1177         shell: msys2 {0}
1178     steps:
1179     - uses: msys2/setup-msys2@v2
1180       with:
1181         release: true # Use the pre-installed MSYS2
1182         path-type: inherit
1183         install: base-devel
1184     - name: Install CCache
1185       uses: hendrikmuhs/ccache-action@v1
1186       with:
1187         key: ${{ github.job }}
1188         variant: sccache
1189     - name: Fetch distribution
1190       uses: actions/download-artifact@v3
1191     - name: Unpack distribution
1192       run: |
1193         mv artifact/* .
1194         rmdir artifact
1195         pushd xapian-core
1196         tar --strip-components=1 -xf xapian-core-*.tar.xz
1197         popd
1198         # Need libmagic for omega
1199         # pushd xapian-applications/omega
1200         # tar --strip-components=1 -xf xapian-omega-*.tar.xz
1201         # popd
1202         # pushd xapian-bindings
1203         # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1204         # popd
1205     - name: Set up Visual Studio shell
1206       uses: egor-tensin/vs-shell@v2
1207       with:
1208         arch: x64
1209     - name: Build zlib
1210       shell: bash
1211       run: |
1212         # Setup sccache for cl.
1213         ln /c/Users/runneradmin/.cargo/bin/{sccache.exe,cl.exe}
1214         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1215         # We find "link" from coreutils rather than from MSVC.  The coreutils
1216         # "link" is not a useful tool to us, so just delete it rather than
1217         # trying to reorder PATH.
1218         rm /usr/bin/link.exe || true
1219         mkdir zlib
1220         pushd zlib
1221         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 -
1222         # Don't build zlib with -MD as it seems this flag needs to be used
1223         # consistently across the build.  Don't use -Zi -Fd"zlib" as
1224         # ccache/sccache don't seem to be able to handle that.
1225         #
1226         # Don't build zlib with a fixed base address on x64 as that gives
1227         # linker warning LNK4281.
1228         sed -i 's/\(^CFLAGS  *= *-nologo \)-MD \(.* \)-Zi -Fd"zlib" /\1\2/;s/-base:0x[0-9A-Fa-f]* //' win32/Makefile.msc
1229         # Only build the shared library.
1230         nmake -nologo -f 'win32\Makefile.msc' zlib1.dll
1231         popd
1232     - name: configure
1233       run: |
1234         export AR=lib
1235         export CC="cl -nologo"
1236         export CXX="$PWD/xapian-core/compile cl -nologo"
1237         export CPPFLAGS="-I$PWD/zlib"
1238         # Standard C++ stack unwinding; assume extern "C" functions never throw.
1239         export CXXFLAGS=-EHsc
1240         export LDFLAGS="-L$PWD/zlib"
1241         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1242         pushd xapian-core
1243         ./configure --enable-werror --disable-shared
1244         export XAPIAN_CONFIG=$PWD/xapian-config
1245         popd
1246         # pushd xapian-applications/omega
1247         # ./configure --enable-werror
1248         # popd
1249         # pushd xapian-bindings
1250         # ./configure --enable-werror
1251         # popd
1252     - name: make
1253       run: |
1254         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1255         make -j2 -C xapian-core
1256         # make -j2 -C xapian-applications/omega
1257         # make -j2 -C xapian-binding
1258     - name: Run tests
1259       run: |
1260         PATH=/c/Users/runneradmin/.cargo/bin:$PATH
1261         export AUTOMATED_TESTING=1
1262         export VERBOSE=1
1263         make -j2 -C xapian-core check
1264         # make -j2 -C xapian-applications/omega check
1265         # make -j2 -C xapian-bindings check
1267   freebsd:
1268     runs-on: 'macos-12'
1269     needs: makedist
1270     steps:
1271     - name: Install CCache
1272       uses: hendrikmuhs/ccache-action@v1
1273       with:
1274         key: ${{ github.job }}
1275     - name: Fetch distribution
1276       uses: actions/download-artifact@v3
1277     - name: Unpack distribution
1278       run: |
1279         mv artifact/* .
1280         rmdir artifact
1281         # Do actual unpacking on freebsd, mostly to help reduce the size of the
1282         # rsync output in the logs.
1283     - name: Run in FreeBSD VM
1284       uses: vmactions/freebsd-vm@v0
1285       with:
1286         usesh: true
1287         prepare: |
1288           set -e
1289           pkg install -y bash ccache perl5 pcre2
1290           ccache --set-config=cache_dir='/Users/runner/work/xapian/xapian/.ccache'
1291           ccache --set-config=max_size='500M'
1292           ccache --set-config=compression=true
1293         run: |
1294           set -e
1295           export CC='ccache cc'
1296           export CXX='ccache c++'
1297           cd xapian-core
1298           tar --strip-components=1 -xf xapian-core-*.tar.xz
1299           ./configure --enable-werror
1300           export XAPIAN_CONFIG=$PWD/xapian-config
1301           cd ..
1302           cd xapian-applications/omega
1303           tar --strip-components=1 -xf xapian-omega-*.tar.xz
1304           ./configure --enable-werror
1305           cd ../..
1306           # cd xapian-bindings
1307           # tar --strip-components=1 -xf xapian-bindings-*.tar.xz
1308           # cd ..
1309           # Everything gets run in on script so use V=0 to reduce the size of
1310           # the log, but re-run without V=0 on failure to show the compiler
1311           # command line.
1312           make -j2 -C xapian-core V=0 || make -C xapian-core
1313           make -j2 -C xapian-applications/omega V=0 || make -C xapian-core
1314           export AUTOMATED_TESTING=1
1315           export VERBOSE=1
1316           make -j2 -C xapian-core check V=0
1317           make -j2 -C xapian-applications/omega check V=0
1319   checkpatch:
1320     name: 'Automated run of xapian-check-patch'
1321     runs-on: 'ubuntu-latest'
1322     steps:
1323     - name: Check out repository code
1324       uses: actions/checkout@v3
1325       with:
1326         fetch-depth: 0
1327     - name: "Automated run of xapian-check-patch"
1328       # Run the style checking script, checking changes between the common
1329       # ancestor of the target branch of the PR (or master if this isn't a PR)
1330       # and the revision being checked.
1331       run: |
1332         echo "GITHUB_BASE_REF='$GITHUB_BASE_REF'"
1333         git diff ${GITHUB_BASE_REF:-origin/RELEASE/1.4}.. --|xapian-maintainer-tools/xapian-check-patch