-
Notifications
You must be signed in to change notification settings - Fork 286
133 lines (110 loc) · 4.51 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
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-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Java 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
cache: 'gradle'
- name: Compile project
run: ./gradlew app:es_embedded:assemble --no-daemon
- uses: actions/checkout@v4
with:
repository: osm-search/Nominatim
submodules: true
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 prerequisits
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq libboost-system-dev libboost-filesystem-dev libexpat1-dev zlib1g-dev libbz2-dev libpq-dev libproj-dev liblua5.3-dev lua5.3 python3-psycopg2 python3-pyosmium python3-dotenv python3-psutil python3-jinja2 python3-icu python3-datrie postgresql-14-postgis-3 postgresql-client-14 postgresql-14 postgresql-14-postgis-3-scripts nlohmann-json3-dev
pip3 install sqlalchemy GeoAlchemy2 psycopg
shell: bash
- name: Setup database
run: |
echo 'fsync = off' | sudo tee /etc/postgresql/14/main/conf.d/local.conf
echo 'synchronous_commit = off' | sudo tee -a /etc/postgresql/14/main/conf.d/local.conf
echo 'full_page_writes = off' | sudo tee -a /etc/postgresql/14/main/conf.d/local.conf
echo 'shared_buffers = 512MB' | sudo tee -a /etc/postgresql/14/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: mkdir nomin-build && cd nomin-build && cmake -DBUILD_MODULE=off ../Nominatim && make -j2 && sudo make install
shell: bash
- 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: |
export NOMINATIM_TOKENIZER=icu
nominatim import --osm-file ../monaco-latest.osm.pbf --reverse-only
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: |
nominatim replication --init
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