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
|
name: Test install
on: [ push, pull_request ]
jobs:
ubuntu-test-install:
runs-on: ubuntu-20.04
env:
LUA_VERSION: 5.3
POSTGRESQL_VERSION: 12
POSTGIS_VERSION: 3
BUILD_TYPE: Release
CXXFLAGS: -pedantic -Wextra -Werror
PREFIX: /usr/local
OSMURL: https://download.geofabrik.de/europe/monaco-latest.osm.pbf
OSMFILE: monaco-latest.osm.pbf
steps:
- uses: actions/checkout@v3
- name: Show installed PostgreSQL packages
run: apt-cache search postgresql | sort
- name: Install prerequisites
run: |
sudo apt-get purge -yq postgresql*
sudo apt-get install -yq --no-install-suggests --no-install-recommends \
libboost-filesystem-dev \
libboost-system-dev \
libbz2-dev \
libexpat1-dev \
liblua${LUA_VERSION}-dev \
libluajit-5.1-dev \
libpq-dev \
libproj-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: 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
run: $PREFIX/bin/osm2pgsql -d o2ptest --slim $OSMFILE
working-directory: /tmp
- name: Test run osm2pgsql-replication
run: |
$PREFIX/bin/osm2pgsql-replication init -v -d o2ptest
$PREFIX/bin/osm2pgsql-replication status -v -d o2ptest
$PREFIX/bin/osm2pgsql-replication update -v -d o2ptest --once --max-diff-size=1
$PREFIX/bin/osm2pgsql-replication status -v -d o2ptest --json
working-directory: /tmp
|