3 on: [ push, pull_request ]
19 - uses: actions/checkout@v2
25 uses: shivammathur/setup-php@v2
28 tools: phpunit, phpcs, composer
33 echo "::set-output name=date::$(/bin/date -u "+%Y%W")"
36 - uses: actions/cache@v2
40 key: nominatim-country-data-${{ steps.get-date.outputs.date }}
42 - uses: ./Nominatim/.github/actions/setup-postgresql
44 postgresql-version: ${{ matrix.postgresql }}
45 postgis-version: ${{ matrix.postgis }}
46 - uses: ./Nominatim/.github/actions/build-nominatim
48 - name: Install test prerequsites
49 run: sudo apt-get install -y -qq php-codesniffer pylint python3-pytest python3-behave python3-pytest-cov php-codecoverage php-xdebug
52 run: phpcs --report-width=120 .
53 working-directory: Nominatim
55 - name: Python linting
56 run: pylint --extension-pkg-whitelist=osmium nominatim
57 working-directory: Nominatim
59 - name: PHP unit tests
60 run: phpunit --coverage-clover ../../coverage-php.xml ./
61 working-directory: Nominatim/test/php
63 - name: Python unit tests
64 run: py.test-3 --cov=nominatim --cov-report=xml test/python
65 working-directory: Nominatim
69 behave -DREMOVE_TEMPLATE=1 -DBUILDDIR=$GITHUB_WORKSPACE/build --format=progress3 -DPHPCOV=./cov
70 composer require phpunit/phpcov:7.0.2
71 vendor/bin/phpcov merge --clover ../../coverage-bdd.xml ./cov
72 working-directory: Nominatim/test/bdd
74 - name: BDD tests (legacy_icu tokenizer)
76 behave -DREMOVE_TEMPLATE=1 -DBUILDDIR=$GITHUB_WORKSPACE/build -DTOKENIZER=legacy_icu --format=progress3
77 working-directory: Nominatim/test/bdd
79 - name: Upload coverage to Codecov
80 uses: codecov/codecov-action@v1
82 files: ./Nominatim/coverage*.xml
84 name: codecov-umbrella
85 fail_ci_if_error: false
86 path_to_write_report: ./coverage/codecov_report.txt
101 runs-on: ubuntu-${{ matrix.ubuntu }}.04
104 - uses: actions/checkout@v2
112 echo "::set-output name=date::$(/bin/date -u "+%Y%W")"
115 - uses: actions/cache@v2
119 key: nominatim-country-data-${{ steps.get-date.outputs.date }}
121 - uses: actions/cache@v2
124 monaco-latest.osm.pbf
125 key: nominatim-test-data-${{ steps.get-date.outputs.date }}
127 - uses: actions/setup-python@v2
130 if: matrix.ubuntu == 18
132 - uses: ./Nominatim/.github/actions/setup-postgresql
134 postgresql-version: ${{ matrix.postgresql }}
135 postgis-version: ${{ matrix.postgis }}
136 - uses: ./Nominatim/.github/actions/build-nominatim
138 ubuntu: ${{ matrix.ubuntu }}
140 - name: Clean installation
141 run: rm -rf Nominatim build
144 - name: Prepare import environment
146 if [ ! -f monaco-latest.osm.pbf ]; then
147 wget --no-verbose https://download.geofabrik.de/europe/monaco-latest.osm.pbf
154 run: nominatim import --osm-file ../monaco-latest.osm.pbf
156 working-directory: data-env
158 - name: Import special phrases
159 run: nominatim special-phrases --import-from-wiki
160 working-directory: data-env
162 - name: Check full import
163 run: nominatim admin --check-database
164 working-directory: data-env
166 - name: Warm up database
167 run: nominatim admin --warm
168 working-directory: data-env
172 nominatim replication --init
173 nominatim replication --once
174 working-directory: data-env
176 - name: Run reverse-only import
177 run : nominatim import --osm-file ../monaco-latest.osm.pbf --reverse-only --no-updates
178 working-directory: data-env
180 NOMINATIM_DATABASE_DSN: pgsql:dbname=reverse
182 - name: Check reverse import
183 run: nominatim admin --check-database
184 working-directory: data-env