3 on: [ push, pull_request ]
10 - uses: actions/checkout@v3
14 - uses: actions/cache@v3
17 data/country_osm_grid.sql.gz
18 key: nominatim-country-data-1
20 - name: Package tarball
22 if [ ! -f data/country_osm_grid.sql.gz ]; then
23 wget --no-verbose -O data/country_osm_grid.sql.gz https://www.nominatim.org/data/country_grid.sql.gz
26 tar czf nominatim-src.tar.bz2 Nominatim
27 mv nominatim-src.tar.bz2 Nominatim
29 - name: 'Upload Artifact'
30 uses: actions/upload-artifact@v3
33 path: nominatim-src.tar.bz2
40 flavour: [oldstuff, "ubuntu-20", "ubuntu-22"]
61 runs-on: ubuntu-${{ matrix.ubuntu }}.04
64 - uses: actions/download-artifact@v3
68 - name: Unpack Nominatim
69 run: tar xf nominatim-src.tar.bz2
72 uses: shivammathur/setup-php@v2
74 php-version: ${{ matrix.php }}
75 tools: phpunit, phpcs, composer
76 ini-values: opcache.jit=disable
78 - uses: actions/setup-python@v4
81 if: matrix.flavour == 'oldstuff'
83 - uses: ./Nominatim/.github/actions/setup-postgresql
85 postgresql-version: ${{ matrix.postgresql }}
86 postgis-version: ${{ matrix.postgis }}
88 - uses: ./Nominatim/.github/actions/build-nominatim
90 flavour: ${{ matrix.flavour }}
91 lua: ${{ matrix.lua }}
93 - name: Install test prerequsites (behave from apt)
94 run: sudo apt-get install -y -qq python3-behave
95 if: matrix.flavour == 'ubuntu-20'
97 - name: Install test prerequsites (behave from pip)
98 run: pip3 install behave==1.2.6
99 if: (matrix.flavour == 'oldstuff') || (matrix.flavour == 'ubuntu-22')
101 - name: Install test prerequsites (from apt for Ununtu 2x)
102 run: sudo apt-get install -y -qq python3-pytest uvicorn
103 if: matrix.flavour != 'oldstuff'
105 - name: Install test prerequsites (from pip for Ubuntu 18)
106 run: pip3 install pytest uvicorn
107 if: matrix.flavour == 'oldstuff'
109 - name: Install Python webservers
110 run: pip3 install falcon sanic sanic-testing sanic-cors starlette
112 - name: Install latest pylint/mypy
113 run: pip3 install -U pylint mypy types-PyYAML types-jinja2 types-psycopg2 types-psutil types-requests typing-extensions asgi_lifespan sqlalchemy2-stubs
116 run: phpcs --report-width=120 .
117 working-directory: Nominatim
119 - name: Python linting
120 run: python3 -m pylint nominatim
121 working-directory: Nominatim
123 - name: PHP unit tests
125 working-directory: Nominatim/test/php
126 if: ${{ (matrix.ubuntu == 20) || (matrix.ubuntu == 22) }}
128 - name: Python unit tests
129 run: python3 -m pytest test/python
130 working-directory: Nominatim
134 python3 -m behave -DREMOVE_TEMPLATE=1 -DBUILDDIR=$GITHUB_WORKSPACE/build --format=progress3
135 working-directory: Nominatim/test/bdd
137 - name: Install newer Python packages (for typechecking info)
138 run: pip3 install -U osmium uvicorn
139 if: matrix.flavour != 'oldstuff'
141 - name: Python static typechecking
142 run: python3 -m mypy --strict nominatim
143 working-directory: Nominatim
144 if: matrix.flavour != 'oldstuff'
147 needs: create-archive
148 runs-on: ubuntu-20.04
151 - uses: actions/download-artifact@v3
155 - name: Unpack Nominatim
156 run: tar xf nominatim-src.tar.bz2
159 uses: shivammathur/setup-php@v2
163 - uses: ./Nominatim/.github/actions/setup-postgresql
165 postgresql-version: 13
168 - name: Install Postgresql server dev
169 run: sudo apt-get install postgresql-server-dev-13
171 - uses: ./Nominatim/.github/actions/build-nominatim
173 cmake-args: -DBUILD_MODULE=on
175 - name: Install test prerequsites
176 run: sudo apt-get install -y -qq python3-behave
178 - name: BDD tests (legacy tokenizer)
180 python3 -m behave -DREMOVE_TEMPLATE=1 -DBUILDDIR=$GITHUB_WORKSPACE/build -DTOKENIZER=legacy --format=progress3
181 working-directory: Nominatim/test/bdd
185 runs-on: ubuntu-latest
186 needs: create-archive
190 name: [Ubuntu-20, Ubuntu-22]
193 image: "ubuntu:20.04"
195 install_mode: install-apache
197 image: "ubuntu:22.04"
199 install_mode: install-apache
202 image: ${{ matrix.image }}
208 shell: sudo -Hu nominatim bash --noprofile --norc -eo pipefail {0}
211 - name: Prepare container (Ubuntu)
213 export APT_LISTCHANGES_FRONTEND=none
214 export DEBIAN_FRONTEND=noninteractive
216 apt-get install -y git sudo wget
217 ln -snf /usr/share/zoneinfo/$CONTAINER_TIMEZONE /etc/localtime && echo $CONTAINER_TIMEZONE > /etc/timezone
220 - name: Setup import user
223 echo 'nominatim ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/nominiatim
224 echo "/home/nominatim/Nominatim/vagrant/Install-on-${OS}.sh no $INSTALL_MODE" > /home/nominatim/vagrant.sh
227 OS: ${{ matrix.name }}
228 INSTALL_MODE: ${{ matrix.install_mode }}
230 - uses: actions/download-artifact@v3
233 path: /home/nominatim
235 - name: Install Nominatim
237 export USERNAME=nominatim
238 export USERHOME=/home/nominatim
240 export HAVE_SELINUX=no
241 tar xf nominatim-src.tar.bz2
243 working-directory: /home/nominatim
245 - name: Prepare import environment
247 mv Nominatim/test/testdb/apidb-test-data.pbf test.pbf
249 mkdir data-env-reverse
250 working-directory: /home/nominatim
252 - name: Print version
253 run: nominatim --version
254 working-directory: /home/nominatim/nominatim-project
256 - name: Collect host OS information
257 run: nominatim admin --collect-os-info
258 working-directory: /home/nominatim/nominatim-project
261 run: nominatim import --osm-file ../test.pbf
262 working-directory: /home/nominatim/nominatim-project
264 - name: Import special phrases
265 run: nominatim special-phrases --import-from-wiki
266 working-directory: /home/nominatim/nominatim-project
268 - name: Check full import
269 run: nominatim admin --check-database
270 working-directory: /home/nominatim/nominatim-project
272 - name: Warm up database
273 run: nominatim admin --warm
274 working-directory: /home/nominatim/nominatim-project
276 - name: Prepare update (Ubuntu)
277 run: apt-get install -y python3-pip
282 pip3 install --user osmium
283 nominatim replication --init
284 NOMINATIM_REPLICATION_MAX_DIFF=1 nominatim replication --once
285 working-directory: /home/nominatim/nominatim-project
287 - name: Clean up database
288 run: nominatim refresh --postcodes --word-tokens
289 working-directory: /home/nominatim/nominatim-project
291 - name: Run reverse-only import
293 echo 'NOMINATIM_DATABASE_DSN="pgsql:dbname=reverse"' >> .env
294 nominatim import --osm-file ../test.pbf --reverse-only --no-updates
295 working-directory: /home/nominatim/data-env-reverse
297 - name: Check reverse-only import
298 run: nominatim admin --check-database
299 working-directory: /home/nominatim/data-env-reverse
301 - name: Clean up database (reverse-only import)
302 run: nominatim refresh --postcodes --word-tokens
303 working-directory: /home/nominatim/nominatim-project