3 on: [ push, pull_request ]
22 runs-on: ubuntu-${{ matrix.ubuntu }}.04
25 - uses: actions/checkout@v2
31 uses: shivammathur/setup-php@v2
33 php-version: ${{ matrix.php }}
35 tools: phpunit, phpcs, composer
37 - uses: actions/setup-python@v2
40 if: matrix.ubuntu == 18
45 echo "::set-output name=date::$(/bin/date -u "+%Y%W")"
48 - uses: actions/cache@v2
52 key: nominatim-country-data-${{ steps.get-date.outputs.date }}
54 - uses: ./Nominatim/.github/actions/setup-postgresql
56 postgresql-version: ${{ matrix.postgresql }}
57 postgis-version: ${{ matrix.postgis }}
59 - uses: ./Nominatim/.github/actions/build-nominatim
61 ubuntu: ${{ matrix.ubuntu }}
63 - name: Install test prerequsites
64 run: sudo apt-get install -y -qq pylint python3-pytest python3-behave python3-pytest-cov php-codecoverage
65 if: matrix.ubuntu == 20
67 - name: Install test prerequsites
69 pip3 install pylint==2.6.0 pytest pytest-cov behave==1.2.6
70 if: matrix.ubuntu == 18
73 run: phpcs --report-width=120 .
74 working-directory: Nominatim
76 - name: Python linting
78 working-directory: Nominatim
80 - name: PHP unit tests
81 run: phpunit --coverage-clover ../../coverage-php.xml ./
82 working-directory: Nominatim/test/php
83 if: matrix.ubuntu == 20
85 - name: Python unit tests
86 run: $PYTEST --cov=nominatim --cov-report=xml test/python
87 working-directory: Nominatim
89 PYTEST: ${{ matrix.pytest }}
94 behave -DREMOVE_TEMPLATE=1 -DBUILDDIR=$GITHUB_WORKSPACE/build --format=progress3 -DPHPCOV=./cov
95 composer require phpunit/phpcov:7.0.2
96 vendor/bin/phpcov merge --clover ../../coverage-bdd.xml ./cov
97 working-directory: Nominatim/test/bdd
98 if: matrix.ubuntu == 20
102 behave -DREMOVE_TEMPLATE=1 -DBUILDDIR=$GITHUB_WORKSPACE/build --format=progress3
103 working-directory: Nominatim/test/bdd
104 if: matrix.ubuntu == 18
106 - name: BDD tests (legacy_icu tokenizer)
108 behave -DREMOVE_TEMPLATE=1 -DBUILDDIR=$GITHUB_WORKSPACE/build -DTOKENIZER=legacy_icu --format=progress3
109 working-directory: Nominatim/test/bdd
111 - name: Upload coverage to Codecov
112 uses: codecov/codecov-action@v1
114 files: ./Nominatim/coverage*.xml
116 name: codecov-umbrella
117 fail_ci_if_error: false
118 path_to_write_report: ./coverage/codecov_report.txt
120 if: matrix.ubuntu == 20
134 runs-on: ubuntu-${{ matrix.ubuntu }}.04
137 - uses: actions/checkout@v2
145 echo "::set-output name=date::$(/bin/date -u "+%Y%W")"
148 - uses: actions/cache@v2
152 key: nominatim-country-data-${{ steps.get-date.outputs.date }}
154 - uses: actions/cache@v2
157 monaco-latest.osm.pbf
158 key: nominatim-test-data-${{ steps.get-date.outputs.date }}
160 - uses: actions/setup-python@v2
163 if: matrix.ubuntu == 18
165 - uses: ./Nominatim/.github/actions/setup-postgresql
167 postgresql-version: ${{ matrix.postgresql }}
168 postgis-version: ${{ matrix.postgis }}
169 - uses: ./Nominatim/.github/actions/build-nominatim
171 ubuntu: ${{ matrix.ubuntu }}
173 - name: Clean installation
174 run: rm -rf Nominatim build
177 - name: Prepare import environment
179 if [ ! -f monaco-latest.osm.pbf ]; then
180 wget --no-verbose https://download.geofabrik.de/europe/monaco-latest.osm.pbf
187 run: nominatim import --osm-file ../monaco-latest.osm.pbf
189 working-directory: data-env
191 - name: Import special phrases
192 run: nominatim special-phrases --import-from-wiki
193 working-directory: data-env
195 - name: Check full import
196 run: nominatim admin --check-database
197 working-directory: data-env
199 - name: Warm up database
200 run: nominatim admin --warm
201 working-directory: data-env
205 nominatim replication --init
206 nominatim replication --once
207 working-directory: data-env
209 - name: Run reverse-only import
210 run : nominatim import --osm-file ../monaco-latest.osm.pbf --reverse-only --no-updates
211 working-directory: data-env
213 NOMINATIM_DATABASE_DSN: pgsql:dbname=reverse
215 - name: Check reverse import
216 run: nominatim admin --check-database
217 working-directory: data-env