3 on: [ push, pull_request ]
20 runs-on: ubuntu-${{ matrix.ubuntu }}.04
23 - uses: actions/checkout@v2
29 uses: shivammathur/setup-php@v2
32 tools: phpunit, phpcs, composer
34 - uses: actions/setup-python@v2
37 if: matrix.ubuntu == 18
42 echo "::set-output name=date::$(/bin/date -u "+%Y%W")"
45 - uses: actions/cache@v2
49 key: nominatim-country-data-${{ steps.get-date.outputs.date }}
51 - uses: ./Nominatim/.github/actions/setup-postgresql
53 postgresql-version: ${{ matrix.postgresql }}
54 postgis-version: ${{ matrix.postgis }}
56 - uses: ./Nominatim/.github/actions/build-nominatim
58 ubuntu: ${{ matrix.ubuntu }}
60 - name: Install test prerequsites
61 run: sudo apt-get install -y -qq php-codesniffer pylint python3-pytest python3-behave python3-pytest-cov php-codecoverage php-xdebug
62 if: matrix.ubuntu == 20
64 - name: Install test prerequsites
66 sudo apt-get install -y -qq php-codesniffer php-codecoverage php-xdebug
67 pip3 install pylint==2.6.0 pytest pytest-cov behave==1.2.6
68 if: matrix.ubuntu == 18
71 run: phpcs --report-width=120 .
72 working-directory: Nominatim
74 - name: Python linting
76 working-directory: Nominatim
78 - name: PHP unit tests
79 run: phpunit --coverage-clover ../../coverage-php.xml ./
80 working-directory: Nominatim/test/php
82 - name: Python unit tests
83 run: $PYTEST --cov=nominatim --cov-report=xml test/python
84 working-directory: Nominatim
86 PYTEST: ${{ matrix.pytest }}
91 behave -DREMOVE_TEMPLATE=1 -DBUILDDIR=$GITHUB_WORKSPACE/build --format=progress3 -DPHPCOV=./cov
92 composer require phpunit/phpcov:7.0.2
93 vendor/bin/phpcov merge --clover ../../coverage-bdd.xml ./cov
94 working-directory: Nominatim/test/bdd
96 - name: BDD tests (legacy_icu tokenizer)
98 behave -DREMOVE_TEMPLATE=1 -DBUILDDIR=$GITHUB_WORKSPACE/build -DTOKENIZER=legacy_icu --format=progress3
99 working-directory: Nominatim/test/bdd
101 - name: Upload coverage to Codecov
102 uses: codecov/codecov-action@v1
104 files: ./Nominatim/coverage*.xml
106 name: codecov-umbrella
107 fail_ci_if_error: false
108 path_to_write_report: ./coverage/codecov_report.txt
123 runs-on: ubuntu-${{ matrix.ubuntu }}.04
126 - uses: actions/checkout@v2
134 echo "::set-output name=date::$(/bin/date -u "+%Y%W")"
137 - uses: actions/cache@v2
141 key: nominatim-country-data-${{ steps.get-date.outputs.date }}
143 - uses: actions/cache@v2
146 monaco-latest.osm.pbf
147 key: nominatim-test-data-${{ steps.get-date.outputs.date }}
149 - uses: actions/setup-python@v2
152 if: matrix.ubuntu == 18
154 - uses: ./Nominatim/.github/actions/setup-postgresql
156 postgresql-version: ${{ matrix.postgresql }}
157 postgis-version: ${{ matrix.postgis }}
158 - uses: ./Nominatim/.github/actions/build-nominatim
160 ubuntu: ${{ matrix.ubuntu }}
162 - name: Clean installation
163 run: rm -rf Nominatim build
166 - name: Prepare import environment
168 if [ ! -f monaco-latest.osm.pbf ]; then
169 wget --no-verbose https://download.geofabrik.de/europe/monaco-latest.osm.pbf
176 run: nominatim import --osm-file ../monaco-latest.osm.pbf
178 working-directory: data-env
180 - name: Import special phrases
181 run: nominatim special-phrases --import-from-wiki
182 working-directory: data-env
184 - name: Check full import
185 run: nominatim admin --check-database
186 working-directory: data-env
188 - name: Warm up database
189 run: nominatim admin --warm
190 working-directory: data-env
194 nominatim replication --init
195 nominatim replication --once
196 working-directory: data-env
198 - name: Run reverse-only import
199 run : nominatim import --osm-file ../monaco-latest.osm.pbf --reverse-only --no-updates
200 working-directory: data-env
202 NOMINATIM_DATABASE_DSN: pgsql:dbname=reverse
204 - name: Check reverse import
205 run: nominatim admin --check-database
206 working-directory: data-env