-
Notifications
You must be signed in to change notification settings - Fork 286
134 lines (111 loc) · 4.22 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: CI
on:
push:
pull_request:
jobs:
build:
name: Compile project and run tests (Java ${{ matrix.java }})
runs-on: ubuntu-latest
strategy:
matrix:
java:
- 11
- 17
- 21
steps:
- uses: actions/checkout@v4
- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'gradle'
- name: Compile project, run tests
run: ./gradlew build --no-daemon
import:
name: Import OSM data from Nominatim into Photon
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Setup Java 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
cache: 'gradle'
- name: Compile project
run: ./gradlew app:es_embedded:assemble --no-daemon
- uses: actions/checkout@v4
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: |
PHOTON_VERSION=`grep 'version =' buildSrc/shared.gradle | head -n 1 | sed "s:.*= '::;s:'.*::"`
java -jar target/photon-${PHOTON_VERSION}.jar -nominatim-import -database nominatim -user runner -password foobar
java -jar target/photon-${PHOTON_VERSION}.jar -nominatim-update-init-for 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: |
PHOTON_VERSION=`grep 'version =' buildSrc/shared.gradle | head -n 1 | sed "s:.*= '::;s:'.*::"`
java -jar target/photon-${PHOTON_VERSION}.jar -nominatim-update -database nominatim -user runner -password foobar