]> git.openstreetmap.org Git - nominatim.git/blob - .github/workflows/ci-tests.yml
Merge pull request #2029 from lonvia/master
[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/build-nominatim
15
16             - name: Install test prerequsites
17               run: |
18                    sudo apt-get install -y -qq php-codesniffer python3-tidylib
19                    sudo pip3 install behave nose
20
21             - name: PHP linting
22               run: phpcs --report-width=120 .
23
24             - name: Setup database
25               run: |
26                   sudo systemctl start postgresql
27                   sudo -u postgres createuser -S www-data
28                   sudo -u postgres createuser -s runner
29               shell: bash
30
31             - name: PHP unit tests
32               run: phpunit ./
33               working-directory: test/php
34
35             - name: BDD tests
36               run: behave -DREMOVE_TEMPLATE=1 --format=progress3 db osm2pgsql
37               working-directory: test/bdd
38
39     import:
40         runs-on: ubuntu-20.04
41
42         steps:
43             - uses: actions/checkout@v2
44               with:
45                   submodules: true
46
47             - uses: ./.github/actions/build-nominatim
48
49             - name: Download test extract
50               run: wget --no-verbose https://download.geofabrik.de/europe/monaco-latest.osm.pbf
51
52             - name: Setup database
53               run: |
54                   sudo systemctl start postgresql
55                   sudo -u postgres createuser -S www-data
56                   sudo -u postgres createuser -s runner
57               shell: bash
58
59             - name: Create configuartion
60               run: |
61                    echo '<?php' > settings/local.php
62                    echo " @define('CONST_Pyosmium_Binary', '/usr/lib/python3-pyosmium/pyosmium-get-changes');" >> settings/local.php
63               working-directory: build
64
65             - name: Import
66               run: php ./utils/setup.php --osm-file ../monaco-latest.osm.pbf --osm2pgsql-cache 500 --all
67               working-directory: build
68
69             - name: Import special phrases
70               run: php ./utils/specialphrases.php --wiki-import | psql -d nominatim
71               working-directory: build
72
73             - name: Check import
74               run: php ./utils/check_import_finished.php
75               working-directory: build
76
77             - name: Run update
78               run: |
79                    php ./utils/update.php --init-updates
80                    php ./utils/update.php --import-osmosis
81               working-directory: build