forked from MobilityDB/MobilityDB
-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (105 loc) · 3.59 KB
/
pgversion.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
name: Main Build
# Test for supported PosgreSQL/PostGIS versions
# 5 (PosgreSQL) * 1 (PostGIS) * 1 (Linux) + 1 (coverage) = 6 jobs are triggered
# Allow manual trigger
on:
workflow_dispatch:
push:
paths:
- '.github/workflows/pgversion.yml'
- 'cmake/**'
- 'meos/**'
- 'mobilitydb/**'
- 'postgis/**'
- 'CMakeLists.txt'
branch_ignore: gh-pages
pull_request:
paths:
- '.github/workflows/pgversion.yml'
- 'cmake/**'
- 'meos/**'
- 'mobilitydb/**'
- 'postgis/**'
- 'CMakeLists.txt'
branch_ignore: gh-pages
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
psql: [13,14,15,16]
postgis: [3]
os: [ubuntu-latest]
coverage: [0]
include:
- psql: 16
postgis: 3
os: ubuntu-latest
coverage: 1
steps:
- uses: actions/checkout@v4
- name: get postgres version
run: |
sudo service postgresql start
pgver=$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d+ \()')
echo "PGVER=${pgver}" >> $GITHUB_ENV
PGP=5433
if [ "${{ matrix.psql }}" == "${pgver}" ]; then PGP=5432; fi
echo "PGPORT=${PGP}" >> $GITHUB_ENV
- name: Add PostgreSQL APT repository
run: |
sudo apt-get install curl ca-certificates gnupg
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ \
$(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgeos++-dev \
libproj-dev \
libjson-c-dev \
libgsl-dev \
postgresql-${{ matrix.psql }} \
postgresql-${{ matrix.psql }}-postgis-${{ matrix.postgis }} \
postgresql-server-dev-${{ matrix.psql }}
ls /usr/lib/postgresql/${{ matrix.psql }}/lib/
xzcat --version
- name: Install coverall dependencies
if: matrix.coverage == '1'
run: |
sudo apt-get -y install lcov
- name: Configure for gcc
run: |
export PATH=/usr/lib/postgresql/${{ matrix.psql }}/bin:$PATH
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_COVERAGE=${{ matrix.coverage }} ..
- name: Build
run: |
cd build
make -j 4
sudo make install
- name: test install
run: |
sudo service postgresql start
sudo -u postgres createdb -p ${PGPORT} ___mobdb___test___
sudo -u postgres psql -p ${PGPORT} -d ___mobdb___test___ -c "CREATE EXTENSION mobilitydb CASCADE; SELECT postgis_full_version(); SELECT mobilitydb_full_version();"
- name: Test
run: |
cd build
make test
- name: Generate coverage
if: matrix.coverage == '1'
run: |
cd build
# Excluding MEOS-specific and other miscellaneous files
lcov --capture --directory . --exclude *_meos.c --exclude */geo_constructors.c --exclude */tpoint_datagen.c --include */MobilityDB/meos/src/* --include */MobilityDB/mobilitydb/src/* --output-file=lcov.info
- name: Coveralls
if: matrix.coverage == '1'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "./build/lcov.info"