-
-
Notifications
You must be signed in to change notification settings - Fork 474
133 lines (115 loc) · 4.26 KB
/
test-install.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: Test install
on: [ push, pull_request ]
jobs:
ubuntu-test-install:
runs-on: ubuntu-22.04
strategy:
matrix:
flavour: [public, middle_schema]
include:
- flavour: public
options: ""
schema: ""
- flavour: middle_schema
options: "--middle-schema=myschema"
schema: "myschema"
env:
LUA_VERSION: 5.3
POSTGRESQL_VERSION: 14
POSTGIS_VERSION: 3
BUILD_TYPE: Release
CXXFLAGS: -pedantic -Wextra -Wno-stringop-overread -Werror
PREFIX: /usr/local
OSMURL: https://download.geofabrik.de/europe/monaco-latest.osm.pbf
OSMFILE: monaco-latest.osm.pbf
steps:
- uses: actions/checkout@v4
- name: Show installed PostgreSQL packages
run: apt-cache search postgresql | sort
- name: Install prerequisites
run: |
sudo apt-get purge -yq postgresql*
sudo apt-get update -qq
sudo apt-get install -yq --no-install-suggests --no-install-recommends \
libboost-dev \
libbz2-dev \
libexpat1-dev \
liblua${LUA_VERSION}-dev \
libluajit-5.1-dev \
libopencv-core-dev \
libopencv-imgcodecs-dev \
libopencv-imgproc-dev \
libpotrace-dev \
libpq-dev \
libproj-dev \
nlohmann-json3-dev \
lua${LUA_VERSION} \
pandoc \
postgresql-${POSTGRESQL_VERSION} \
postgresql-${POSTGRESQL_VERSION}-postgis-${POSTGIS_VERSION} \
postgresql-${POSTGRESQL_VERSION}-postgis-${POSTGIS_VERSION}-scripts \
postgresql-client-${POSTGRESQL_VERSION} \
python3-pyosmium \
python3-psycopg2 \
zlib1g-dev
- name: Run CMake
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build osm2pgsql
working-directory: build
run: make -j3 all man
- name: Install osm2pgsql
working-directory: build
run: sudo make install
- name: Check osm2pgsql install
run: |
test -d $PREFIX/bin
test -e $PREFIX/bin/osm2pgsql
test -e $PREFIX/bin/osm2pgsql-replication
test -d $PREFIX/share/man/man1
test -f $PREFIX/share/man/man1/osm2pgsql.1
test -f $PREFIX/share/man/man1/osm2pgsql-replication.1
test -d $PREFIX/share/osm2pgsql
test -f $PREFIX/share/osm2pgsql/default.style
test -f $PREFIX/share/osm2pgsql/empty.style
- name: Set up test databases
run: |
sudo systemctl start postgresql
sudo -u postgres createuser runner
sudo -u postgres createdb -O runner o2ptest
sudo -u postgres psql o2ptest -c "CREATE EXTENSION postgis"
sudo -u postgres psql o2ptest -c "CREATE EXTENSION hstore"
- name: Set up schema
run: |
sudo -u postgres psql o2ptest -c "CREATE SCHEMA $SCHEMANAME"
sudo -u postgres psql o2ptest -c "GRANT ALL ON SCHEMA $SCHEMANAME TO runner"
if: ${{ matrix.schema }}
env:
SCHEMANAME: ${{ matrix.schema }}
- name: Remove repository
# Remove contents of workspace to be sure the install runs independently
working-directory: /
run: rm -fr "${{github.workspace}}"/*
- name: Show man pages
run: |
man -P cat osm2pgsql
man -P cat osm2pgsql-replication
- name: Download test file
run: wget --quiet $OSMURL
working-directory: /tmp
- name: Test run of osm2pgsql (no schema)
run: $PREFIX/bin/osm2pgsql $EXTRAOPTS -d o2ptest --slim $OSMFILE
working-directory: /tmp
env:
EXTRAOPTS: ${{ matrix.options }}
- name: Test run osm2pgsql-replication (no schema)
run: |
$PREFIX/bin/osm2pgsql-replication init $EXTRAOPTS -v -d o2ptest
$PREFIX/bin/osm2pgsql-replication status $EXTRAOPTS -v -d o2ptest
$PREFIX/bin/osm2pgsql-replication update $EXTRAOPTS -v -d o2ptest --once --max-diff-size=1
$PREFIX/bin/osm2pgsql-replication status $EXTRAOPTS -v -d o2ptest --json
working-directory: /tmp
env:
EXTRAOPTS: ${{ matrix.options }}