]> git.openstreetmap.org Git - nominatim.git/blob - .github/workflows/ci-tests.yml
4824749c69fa5d7f4106f4312936ed21cde92814
[nominatim.git] / .github / workflows / ci-tests.yml
1 name: CI Tests
2
3 on: [ push, pull_request ]
4
5 jobs:
6     tests:
7         runs-on: ubuntu-20.04
8
9         steps:
10             - uses: actions/checkout@v2
11               with:
12                   submodules: true
13
14             - uses: ./.github/actions/setup-postgresql
15
16             - uses: ./.github/actions/build-nominatim
17
18             - name: Install test prerequsites
19               run: |
20                    sudo apt-get install -y -qq php-codesniffer python3-tidylib
21                    sudo pip3 install behave nose
22
23             - name: PHP linting
24               run: phpcs --report-width=120 .
25
26             - name: PHP unit tests
27               run: phpunit ./
28               working-directory: test/php
29
30             - name: BDD tests
31               run: behave -DREMOVE_TEMPLATE=1 --format=progress3 db osm2pgsql
32               working-directory: test/bdd
33
34     import:
35         runs-on: ubuntu-20.04
36
37         steps:
38             - uses: actions/checkout@v2
39               with:
40                   submodules: true
41
42             - uses: ./.github/actions/setup-postgresql
43
44             - uses: ./.github/actions/build-nominatim
45
46             - name: Download test extract
47               run: wget --no-verbose https://download.geofabrik.de/europe/monaco-latest.osm.pbf
48
49             - name: Create configuration
50               run: |
51                    echo '<?php' > settings/local.php
52                    echo " @define('CONST_Pyosmium_Binary', '/usr/lib/python3-pyosmium/pyosmium-get-changes');" >> settings/local.php
53               working-directory: build
54
55             - name: Import
56               run: php ./utils/setup.php --osm-file ../monaco-latest.osm.pbf --osm2pgsql-cache 500 --all
57               working-directory: build
58
59             - name: Import special phrases
60               run: php ./utils/specialphrases.php --wiki-import | psql -d nominatim
61               working-directory: build
62
63             - name: Check import
64               run: php ./utils/check_import_finished.php
65               working-directory: build
66
67             - name: Run update
68               run: |
69                    php ./utils/update.php --init-updates
70                    php ./utils/update.php --import-osmosis
71               working-directory: build