Document where to install .jar on macOS
[xapian.git] / .github / workflows / ci.yml
blob966a478ebefcc21ae071b48c30cebb5db3f1b430
1 name: CI
3 on:
4   push:
5     paths-ignore:
6       - '.appveyor.yml'
7       - NEWS
8       - 'xapian-maintainer-tools/**'
9   pull_request:
10     branches: RELEASE/1.4
11     paths-ignore:
12       - '.appveyor.yml'
13       - NEWS
14       - 'xapian-maintainer-tools/**'
16   # Allows you to run this workflow manually from the Actions tab
17   workflow_dispatch:
19 jobs:
20   GLIBCXX_DEBUG:
21     runs-on: 'ubuntu-20.04'
22     steps:
23     - name: Check out repository code
24       uses: actions/checkout@v2
25     - name: Install CCache
26       uses: hendrikmuhs/ccache-action@v1
27       with:
28         key: GLIBCXX_DEBUG
29     - name: Install package dependencies
30       run: |
31         sudo apt-get update
32         sudo apt-get install \
33             doxygen \
34             graphviz \
35             help2man \
36             python3-docutils \
37             pngcrush \
38             python3-sphinx \
39             uuid-dev \
40             libpcre2-dev \
41             libmagic-dev \
42             lua5.3 \
43             liblua5.3-dev \
44             mono-devel \
45             python-dev \
46             python3-dev \
47             tcl \
48             tcl-dev
49     - name: bootstrap source tree
50       run: ./bootstrap xapian-core xapian-applications/omega swig xapian-bindings xapian-letor
51     - name: configure
52       run: ./configure CC='ccache gcc' CXX='ccache g++' CPPFLAGS='-D_GLIBCXX_DEBUG'
53     - name: make
54       run: make -j2
55     - name: Run tests
56       run: make -j2 check VERBOSE=1 AUTOMATED_TESTING=1
57     - name: Check generated files are in .gitignore
58       # grep '^' passes through all input while giving a non-zero exit status
59       # if that input is empty.
60       run: git status --porcelain|grep '^' && { echo "The generated files listed above are not in .gitignore" ; exit 1; }; true
62   FORTIFY_SOURCE_3:
63     # _FORTIFY_SOURCE level 3 requires GCC 12, so currently we need to use
64     # Ubuntu 22.04 and the gcc-12 and g++12 packages.
65     runs-on: 'ubuntu-22.04'
66     steps:
67     - name: Check out repository code
68       uses: actions/checkout@v2
69     - name: Install CCache
70       uses: hendrikmuhs/ccache-action@v1
71       with:
72         key: GLIBCXX_DEBUG
73     - name: Install package dependencies
74       run: |
75         sudo apt-get update
76         sudo apt-get install \
77             gcc-12 \
78             g++-12 \
79             doxygen \
80             graphviz \
81             help2man \
82             python3-docutils \
83             pngcrush \
84             python3-sphinx \
85             uuid-dev \
86             libpcre2-dev \
87             libmagic-dev \
88             lua5.4 \
89             liblua5.4-dev \
90             mono-devel \
91             python3-dev \
92             tcl \
93             tcl-dev
94     - name: bootstrap source tree
95       run: ./bootstrap xapian-core xapian-applications/omega swig xapian-bindings xapian-letor
96     - name: configure
97       # Ubuntu's GCC packages define _FORTIFY_SOURCE=2 by default, so we need
98       # to undefine it before we define it to avoid a warning (which becomes
99       # an error with -Werror).
100       run: ./configure CC='ccache gcc-12' CXX='ccache g++-12' CPPFLAGS='-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3'
101     - name: make
102       run: make -j2
103     - name: Run tests
104       run: make -j2 check VERBOSE=1 AUTOMATED_TESTING=1
105     - name: Check generated files are in .gitignore
106       # grep '^' passes through all input while giving a non-zero exit status
107       # if that input is empty.
108       run: git status --porcelain|grep '^' && { echo "The generated files listed above are not in .gitignore" ; exit 1; }; true
110   clang:
111     runs-on: 'ubuntu-20.04'
112     steps:
113     - name: Check out repository code
114       uses: actions/checkout@v2
115     - name: Install CCache
116       uses: hendrikmuhs/ccache-action@v1
117       with:
118         key: clang
119     - name: Install package dependencies
120       run: |
121         env
122         sudo apt-get update
123         sudo apt-get install \
124             clang \
125             libc++-dev
126         sudo apt-get install \
127             doxygen \
128             graphviz \
129             help2man \
130             python3-docutils \
131             pngcrush \
132             python3-sphinx \
133             uuid-dev \
134             libpcre2-dev \
135             libmagic-dev \
136             tcl \
137             tcl-dev
138     - name: bootstrap source tree
139       run: ./bootstrap xapian-core xapian-applications/omega swig xapian-bindings xapian-letor
140     - name: configure
141       # Build with the llvm c++ library to catch more portability issues.
142       run: ./configure CC='ccache clang' CXX='ccache clang++ -stdlib=libc++' --with-python3 --with-tcl
143     - name: make
144       run: make -j2
145     - name: Run tests
146       run: make -j2 check VERBOSE=1 AUTOMATED_TESTING=1
147     - name: Check generated files are in .gitignore
148       # grep '^' passes through all input while giving a non-zero exit status
149       # if that input is empty.
150       run: git status --porcelain|grep '^' && { echo "The generated files listed above are not in .gitignore" ; exit 1; }; true
152   # GCC 4.7 is the oldest GCC we aim to support for 1.4.x, but the oldest we can
153   # easily build with in github actions is 4.8.  There's no package of GCC 4.8
154   # in Ubuntu 20.04 so we have to run this on 18.04 (also useful to test
155   # there for portability).
156   GCC4-8:
157     name: 'GCC 4.8'
158     runs-on: 'ubuntu-18.04'
159     env:
160       LIBEXTRACTOR_PREFIX: '/usr/lib/x86_64-linux-gnu/libextractor'
161     steps:
162     - name: Check out repository code
163       uses: actions/checkout@v2
164     - name: Install CCache
165       uses: hendrikmuhs/ccache-action@v1
166       with:
167         key: GCC4-8
168     - name: Install package dependencies
169       run: |
170         sudo apt-get update
171         sudo apt-get install \
172             gcc-4.8 \
173             g++-4.8
174         sudo apt-get install \
175             doxygen \
176             graphviz \
177             help2man \
178             python3-docutils \
179             pngcrush \
180             python3-sphinx \
181             uuid-dev \
182             libpcre2-dev \
183             libmagic-dev \
184             lua5.3 \
185             liblua5.3-dev \
186             mono-devel \
187             python3-dev \
188             tcl \
189             tcl-dev
190     - name: bootstrap source tree
191       run: ./bootstrap xapian-core xapian-applications/omega swig xapian-bindings xapian-letor
192     - name: configure
193       run: ./configure CC='ccache gcc-4.8' CXX='ccache g++-4.8'
194     - name: make
195       run: make -j2
196     - name: Run tests
197       run: make -j2 check VERBOSE=1 AUTOMATED_TESTING=1
198     - name: Check generated files are in .gitignore
199       # grep '^' passes through all input while giving a non-zero exit status
200       # if that input is empty.
201       run: git status --porcelain|grep '^' && { echo "The generated files listed above are not in .gitignore" ; exit 1; }; true
203   macos:
204     runs-on: 'macos-latest'
205     steps:
206     - name: Check out repository code
207       uses: actions/checkout@v2
208     - name: Install CCache
209       uses: hendrikmuhs/ccache-action@v1
210       with:
211         key: macos
212     - name: Install package dependencies
213       run: |
214         brew update
215         brew install \
216             doxygen \
217             gmime \
218             graphviz \
219             help2man \
220             libiconv \
221             libmagic \
222             lua \
223             mono-mdk \
224             pcre2 \
225             pkgconfig \
226             pngcrush \
227             python
228         pip3 install sphinx docutils
229     - name: bootstrap source tree
230       run: ./bootstrap xapian-core xapian-applications/omega swig xapian-bindings xapian-letor
231     - name: configure
232       run: ./configure CC='ccache gcc' CXX='ccache g++' CPPFLAGS='-I${{ runner.temp }}/xapian-libsvm-fixed-include' PKG_CONFIG_PATH=/usr/local/opt/icu4c/lib/pkgconfig --prefix='${{ runner.temp }}/XapianInstall' --with-libiconv-prefix=/usr/local/opt/libiconv
233     - name: make
234       run: |
235         make -j3
236         make -C xapian-core install
237     - name: Run tests
238       run: make -j2 check VERBOSE=1 AUTOMATED_TESTING=1
239     - name: Check generated files are in .gitignore
240       # grep '^' passes through all input while giving a non-zero exit status
241       # if that input is empty.
242       run: |
243         find . \( -name 'config.guess~' -o -name 'config.sub~' -o -name 'install-sh~' \) -delete
244         git status --porcelain|grep '^' && { echo "The generated files listed above are not in .gitignore" ; exit 1; }; true
246   checkpatch:
247     name: 'Automated run of xapian-check-patch'
248     runs-on: 'ubuntu-latest'
249     steps:
250     - name: Check out repository code
251       uses: actions/checkout@v2
252       with:
253         fetch-depth: 0
254     - name: "Automated run of xapian-check-patch"
255       # Run the style checking script, checking changes between the common
256       # ancestor of the target branch of the PR (or master if this isn't a PR)
257       # and the revision being checked.
258       run: |
259         echo "GITHUB_BASE_REF='$GITHUB_BASE_REF'"
260         git diff ${GITHUB_BASE_REF:-origin/RELEASE/1.4}.. --|xapian-maintainer-tools/xapian-check-patch