update README.md: fix deprecation warning when starting service #675
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| build: | |
| name: Compile project and run tests (Java ${{ matrix.java }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| java: | |
| - 21 | |
| - 25 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Java ${{ matrix.java }} | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{ matrix.java }} | |
| cache: 'gradle' | |
| - name: Compile project, run tests | |
| run: ./gradlew build --no-daemon | |
| - name: Rename jar with version and git SHA | |
| if: matrix.java == 21 | |
| run: | | |
| VERSION=$(./gradlew -q properties --property version | grep '^version:' | awk '{print $2}') | |
| SHA=$(git rev-parse --short HEAD) | |
| mv target/photon-*.jar target/photon-$VERSION-$SHA.jar | |
| - name: Upload photon jar artifact | |
| if: matrix.java == 21 | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: photon-jar | |
| path: target/photon-*.jar | |
| if-no-files-found: error | |
| import: | |
| name: Import OSM data from Nominatim into Photon | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Java 21 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 21 | |
| cache: 'gradle' | |
| - name: Compile project | |
| run: ./gradlew assemble --no-daemon | |
| - name: Get Photon version | |
| run: echo "PHOTON_VERSION=$(./gradlew -q properties --property version | grep '^version:' | awk '{print $2}')" >> "$GITHUB_ENV" | |
| - uses: actions/checkout@v6 | |
| with: | |
| repository: osm-search/Nominatim | |
| path: Nominatim | |
| - name: Get Date | |
| run: echo "cache_key=$(/bin/date -u "+%Y%W")" >> "$GITHUB_ENV" | |
| shell: bash | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| Nominatim/data/country_osm_grid.sql.gz | |
| monaco-latest.osm.pbf | |
| key: nominatim-test-data-${{ env.cache_key }} | |
| - name: Install prerequisites | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq osm2pgsql postgresql-postgis virtualenv pkg-config libicu-dev | |
| shell: bash | |
| - name: Setup database | |
| run: | | |
| echo 'fsync = off' | sudo tee /etc/postgresql/16/main/conf.d/local.conf | |
| echo 'synchronous_commit = off' | sudo tee -a /etc/postgresql/16/main/conf.d/local.conf | |
| echo 'full_page_writes = off' | sudo tee -a /etc/postgresql/16/main/conf.d/local.conf | |
| echo 'shared_buffers = 512MB' | sudo tee -a /etc/postgresql/16/main/conf.d/local.conf | |
| sudo systemctl start postgresql | |
| sudo -u postgres createuser -S www-data | |
| sudo -u postgres createuser -s runner | |
| psql -d postgres -c "ALTER USER runner PASSWORD 'foobar'" | |
| psql --version | |
| psql -d postgres -c "SELECT version()" | |
| shell: bash | |
| - name: Download dependencies | |
| run: | | |
| if [ ! -f Nominatim/data/country_osm_grid.sql.gz ]; then | |
| wget --no-verbose -O Nominatim/data/country_osm_grid.sql.gz https://www.nominatim.org/data/country_grid.sql.gz | |
| fi | |
| shell: bash | |
| - name: Build Nominatim | |
| run: | | |
| virtualenv ~/venv | |
| ~/venv/bin/pip install packaging/nominatim-db | |
| shell: bash | |
| working-directory: Nominatim | |
| - name: Prepare import environment | |
| run: | | |
| if [ ! -f monaco-latest.osm.pbf ]; then | |
| wget --no-verbose https://download.geofabrik.de/europe/monaco-latest.osm.pbf | |
| fi | |
| mkdir data-env | |
| shell: bash | |
| - name: Import Nominatim | |
| run: | | |
| ~/venv/bin/nominatim import --osm-file ../monaco-latest.osm.pbf --reverse-only | |
| ~/venv/bin/nominatim admin --check-database | |
| shell: bash | |
| working-directory: data-env | |
| - name: Import Photon | |
| run: | | |
| java -jar "target/photon-$PHOTON_VERSION.jar" import -database nominatim -user runner -password foobar | |
| java -jar "target/photon-$PHOTON_VERSION.jar" update-init -import-user runner -database nominatim -user runner -password foobar | |
| - name: Update Nominatim | |
| run: | | |
| ~/venv/bin/pip install osmium | |
| ~/venv/bin/nominatim replication --init | |
| ~/venv/bin/nominatim replication --once | |
| shell: bash | |
| working-directory: data-env | |
| env: | |
| NOMINATIM_REPLICATION_MAX_DIFF: 10 | |
| - name: Update Photon | |
| run: java -jar "target/photon-$PHOTON_VERSION.jar" update -database nominatim -user runner -password foobar |