forked from osm2pgsql-dev/osm2pgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
275 lines (260 loc) · 8.16 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
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
name: CI
on: [ push, pull_request ]
defaults:
run:
shell: bash
jobs:
macOS:
env:
BUILD_PARALLEL_LEVEL: 4
BUILD_TARGET: all man
BUILD_TESTS: ON
BUILD_TYPE: ${{ matrix.build_type || 'Debug' }}
CXXFLAGS: -pedantic -Werror -Wextra
LUA_VERSION: ${{ matrix.lua_version || '' }}
LUAJIT_OPTION: ${{ matrix.luajit_option && 'ON' || 'OFF' }}
PGDATA: /tmp/postgresql/data
PGDATABASE: postgres
PGHOST: localhost
name: macos${{ matrix.image_tag }}
runs-on: macos-${{ matrix.image_tag }}
strategy:
fail-fast: false
matrix:
image_tag:
- 10.15
- 11
- 12
lua_version:
- 5.4
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/macos-prerequisites
- uses: ./.github/actions/build-and-test
Ubuntu:
env:
BUILD_PARALLEL_LEVEL: 4
BUILD_TARGET: all man
BUILD_TESTS: ON
BUILD_TYPE: ${{ matrix.build_type || 'Debug' }}
CC: ${{ matrix.cc || 'gcc' }}
CPP_VERSION: ${{ matrix.cpp_version || '' }}
CXXFLAGS: -pedantic -Werror -Wextra
DEBIAN_FRONTEND: noninteractive
LUA_VERSION: ${{ matrix.lua_version || '' }}
LUAJIT_OPTION: ${{ matrix.luajit_option && 'ON' || 'OFF' }}
POSTGIS_VERSION: ${{ matrix.postgis_version || '3' }}
POSTGRESQL_VERSION: ${{ matrix.postgresql_version || '14' }}
USE_PROJ_LIB: ${{ matrix.use_proj_lib || '' }}
name: >-
ubuntu${{ matrix.image_tag }}
pg${{ matrix.postgresql_version || '13' }}
${{ matrix.cc || 'gcc' }}
${{ matrix.build_type == 'Release' && 'release' || '' }}
${{ matrix.lua_version && format('lua{0}', matrix.lua_version) || 'nolua' }}
${{ matrix.luajit_option && 'jit' || '' }}
${{ matrix.cpp_version && format('cpp{0}', matrix.cpp_version) || '' }}
${{ matrix.use_proj_lib && (matrix.use_proj_lib == 'off' && 'noproj' || format('proj{0}', matrix.use_proj_lib)) || '' }}
runs-on: ubuntu-${{ matrix.image_tag }}
strategy:
fail-fast: false
matrix:
image_tag:
# - 18.04 # Clang 6.0.0 | GCC 7.5.0
# - 20.04 # Clang 10.0.0 | GCC 9.4.0
- 22.04 # Clang 14.0.0 | GCC 11.2.0
cc:
- clang
- gcc
lua_version:
- 5.4
- false
luajit_option:
- false
- true
postgis_version:
- 3
postgresql_version:
- 14
exclude:
- lua_version: false
luajit_option: true
include:
# ubuntu18-pg95-gcc7-jit
- build_type: Release
cc: gcc-7
image_tag: 18.04
lua_version: 5.3
luajit_option: true
postgis_version: 2.5
postgresql_version: 9.5
# ubuntu18-pg96-clang8-jit
- build_type: Release
cc: clang-8
image_tag: 18.04
lua_version: 5.3
luajit_option: true
postgis_version: 2.5
postgresql_version: 9.6
# ubuntu18-pg10-gcc9
- build_type: Debug
cc: gcc-9
cpp_version: 17
image_tag: 18.04
lua_version: 5.3
luajit_option: false
postgis_version: 3
postgresql_version: 10
# ubuntu18-pg11-clang9
- build_type: Debug
cc: clang-9
cpp_version: 17
image_tag: 18.04
lua_version: false
luajit_option: false
postgis_version: 2.5
postgresql_version: 11
# ubuntu20-pg12-gcc10-jit
- build_type: Debug
cc: gcc-10
cpp_version: 17
image_tag: 20.04
lua_version: 5.3
luajit_option: true
postgis_version: 2.5
postgresql_version: 12
# ubuntu20-pg13-clang10-jit
- build_type: Debug
cc: clang-10
cpp_version: 17
image_tag: 20.04
lua_version: 5.3
luajit_option: true
postgis_version: 3
postgresql_version: 13
# ubuntu20-pg13-clang10-proj6
- build_type: Debug
cc: clang-10
cpp_version: 17
image_tag: 20.04
lua_version: 5.3
luajit_option: false
postgis_version: 3
postgresql_version: 13
use_proj_lib: 6
# ubuntu20-pg13-clang10-noproj
- build_type: Debug
cc: clang-10
cpp_version: 17
image_tag: 20.04
lua_version: 5.3
luajit_option: false
postgis_version: 3
postgresql_version: 13
use_proj_lib: off
# ubuntu20-pg14-clang10-cpp17
- build_type: Debug
cc: clang-10
cpp_version: 17
image_tag: 20.04
lua_version: 5.3
luajit_option: false
postgis_version: 3
postgresql_version: 14
use_proj_lib: 6
# ubuntu20-pg13-gcc10-release
- build_type: Release
cc: gcc-10
cpp_version: 17
image_tag: 20.04
lua_version: 5.3
luajit_option: true
postgis_version: 2.5
postgresql_version: 13
# ubuntu20-pg13-gcc10-release-nolua
- build_type: Release
cc: gcc-10
cpp_version: 17
image_tag: 20.04
lua_version: false
luajit_option: false
postgis_version: 2.5
postgresql_version: 13
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/ubuntu-prerequisites
- uses: ./.github/actions/build-and-test
with:
test-wrapper: pg_virtualenv
windows:
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2022]
runs-on: ${{ matrix.os }}
env:
GETOPT_INCLUDE_DIR: ${{ github.workspace }}/../wingetopt/src
GETOPT_LIBRARY: ${{ github.workspace }}/../wingetopt/build/Release/wingetopt.lib
VCPKG_DEFAULT_BINARY_CACHE: C:/vcpkg_binary_cache
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
C:/vcpkg_binary_cache
key: vcpkg-binary-cache-${{ matrix.os }}
- uses: actions/cache@v2
with:
path: |
C:/postgis.zip
key: postgis-cache
- name: Prepare cache
run: if [ ! -d C:/vcpkg_binary_cache ]; then mkdir C:/vcpkg_binary_cache; fi
shell: bash
- uses: ./.github/actions/win-postgres
- uses: ./.github/actions/win-install
- uses: ./.github/actions/win-getopt
- uses: ./.github/actions/win-cmake
- uses: ./.github/actions/win-build
- uses: ./.github/actions/win-test
- name: Package osm2pgsql
run: |
mkdir c:/artifact/
mkdir c:/artifact/osm2pgsql-bin
cp -r Release/* ../README.md ../COPYING ../*.style ../scripts ../flex-config c:/artifact/osm2pgsql-bin/
shell: bash
working-directory: build
if: matrix.os == 'windows-2022'
- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
with:
name: osm2pgsql-win64
path: c:/artifact
if: matrix.os == 'windows-2022'
windows-package:
needs: windows
runs-on: windows-2022
env:
OSMURL: https://download.geofabrik.de/europe/monaco-latest.osm.bz2
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
C:/postgis.zip
key: postgis-cache
- uses: actions/download-artifact@v2
with:
name: osm2pgsql-win64
- uses: ./.github/actions/win-postgres
- name: Set up database
run: |
& $env:PGBIN\createdb osm
& $env:PGBIN\psql -d osm -c "CREATE EXTENSION hstore; CREATE EXTENSION postgis;"
shell: pwsh
- name: Get test data
run: (new-object net.webclient).DownloadFile($env:OSMURL, "testfile.osm.bz2")
shell: pwsh
- name: Exceute osm2pgsql
run: ./osm2pgsql-bin/osm2pgsql --slim -d osm testfile.osm.bz2
shell: bash