-
Notifications
You must be signed in to change notification settings - Fork 115
211 lines (178 loc) · 5.84 KB
/
ci.yaml
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
name: CI
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
container:
image: python:3.11
env:
USER: root
steps:
- run: |
apt-get update
apt-get install --yes --no-install-recommends \
postgresql-client \
g++ \
libarchive-dev \
libboost-python-dev \
libosmpbf-dev \
libprotobuf-dev \
make \
pkg-config \
protobuf-compiler \
osmosis \
cmake \
extra-cmake-modules \
qtbase5-dev \
flex \
bison
- uses: actions/checkout@v4
- name: Setup env
run: |
# configure paths used for tmp files
mkdir -p /data/work/$USER /data/work/$USER/cache
chown $USER /data/work/$USER /data/work/$USER/cache
# compile osm pbf parser
cd modules/osm_pbf_parser && make && cd ../../
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint
run: |
./tools/pytest.sh lint
- name: MyPy
run: |
./tools/pytest.sh mypy
tests:
runs-on: ubuntu-latest
container:
image: python:3.11
env:
USER: root
services:
postgres:
image: postgis/postgis:13-3.0-alpine
env:
POSTGRES_PASSWORD: -osmose-
env:
DB_HOST: postgres
DB_BASE_TEST: osmose
PGPASSWORD: -osmose-
steps:
- run: |
apt-get update
apt-get install --yes --no-install-recommends \
postgresql-client \
g++ \
libarchive-dev \
libboost-python-dev \
libosmpbf-dev \
libprotobuf-dev \
make \
pkg-config \
protobuf-compiler \
osmosis \
cmake \
extra-cmake-modules \
qtbase5-dev \
flex \
bison
- uses: actions/checkout@v4
- name: Setup env
run: |
# configure paths used for tmp files
mkdir -p /data/work/$USER /data/work/$USER/cache
chown $USER /data/work/$USER /data/work/$USER/cache
# compile osm pbf parser
cd modules/osm_pbf_parser && make && cd ../../
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Init Postgres
run: |
psql -h postgres -U postgres postgres -c 'CREATE USER osmose;'
psql -h postgres -U postgres postgres -c "ALTER USER osmose WITH PASSWORD '-osmose-';"
psql -h postgres -U postgres postgres -c 'CREATE DATABASE osmose;'
psql -h postgres -U postgres postgres -c 'GRANT ALL ON database osmose TO osmose;'
psql -h postgres -U postgres osmose -c 'CREATE EXTENSION IF NOT EXISTS hstore; CREATE EXTENSION IF NOT EXISTS fuzzystrmatch; CREATE EXTENSION IF NOT EXISTS unaccent; CREATE EXTENSION IF NOT EXISTS postgis;'
psql -h postgres -U postgres osmose -c "GRANT SELECT,UPDATE,DELETE ON TABLE spatial_ref_sys TO osmose;"
psql -h postgres -U postgres osmose -c "GRANT SELECT,UPDATE,DELETE,INSERT ON TABLE geometry_columns TO osmose;"
- name: Merge
run: |
./tools/pytest.sh merge
- name: Other
run: |
./tools/pytest.sh other
optional_tests:
runs-on: ubuntu-latest
container:
image: python:3.11
env:
USER: root
services:
postgres:
image: postgis/postgis:13-3.0-alpine
env:
POSTGRES_PASSWORD: -osmose-
env:
DB_HOST: postgres
DB_BASE_TEST: osmose
PGPASSWORD: -osmose-
steps:
- run: |
apt-get update
apt-get install --yes --no-install-recommends \
postgresql-client \
g++ \
libarchive-dev \
libboost-python-dev \
libosmpbf-dev \
libprotobuf-dev \
make \
pkg-config \
protobuf-compiler \
osmosis \
cmake \
extra-cmake-modules \
qtbase5-dev \
flex \
bison
- uses: actions/checkout@v4
- name: Setup env
run: |
# configure paths used for tmp files
mkdir -p /data/work/$USER /data/work/$USER/cache
chown $USER /data/work/$USER /data/work/$USER/cache
# compile osm pbf parser
cd modules/osm_pbf_parser && make && cd ../../
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Init Postgres
run: |
psql -h postgres -U postgres postgres -c 'CREATE USER osmose;'
psql -h postgres -U postgres postgres -c "ALTER USER osmose WITH PASSWORD '-osmose-';"
psql -h postgres -U postgres postgres -c 'CREATE DATABASE osmose;'
psql -h postgres -U postgres postgres -c 'GRANT ALL ON database osmose TO osmose;'
psql -h postgres -U postgres osmose -c 'CREATE EXTENSION IF NOT EXISTS hstore; CREATE EXTENSION IF NOT EXISTS fuzzystrmatch; CREATE EXTENSION IF NOT EXISTS unaccent; CREATE EXTENSION IF NOT EXISTS postgis;'
psql -h postgres -U postgres osmose -c "GRANT SELECT,UPDATE,DELETE ON TABLE spatial_ref_sys TO osmose;"
psql -h postgres -U postgres osmose -c "GRANT SELECT,UPDATE,DELETE,INSERT ON TABLE geometry_columns TO osmose;"
- name: SAX
run: |
./tools/pytest.sh sax
continue-on-error: true