-
Notifications
You must be signed in to change notification settings - Fork 34
74 lines (65 loc) · 2.19 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
# GitHub Actions for OGR-FDW
#
# Paul Ramsey <pramsey at cleverelephant dot ca>
name: "CI"
on:
push:
# branches-ignore:
# - 'master'
pull_request: ~
jobs:
linux:
name: "CI"
strategy:
fail-fast: false
matrix:
ci:
- { PGVER: 11 }
- { PGVER: 12 }
- { PGVER: 13 }
- { PGVER: 14 }
- { PGVER: 15 }
- { PGVER: 16 }
- { PGVER: 17 }
runs-on: ubuntu-latest
steps:
- name: 'Check Out'
uses: actions/checkout@v4
- name: 'Raise Priority for apt.postgresql.org'
run: |
cat << EOF >> ./pgdg.pref
Package: *
Pin: release o=apt.postgresql.org
Pin-Priority: 600
EOF
sudo mv ./pgdg.pref /etc/apt/preferences.d/
sudo apt update
- name: 'Install GDAL'
run: |
sudo apt-get install libgdal-dev
- name: 'Install PostgreSQL'
run: |
sudo apt-get purge postgresql-*
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg-snapshot main ${{ matrix.ci.PGVER }}" > /etc/apt/sources.list.d/pgdg.list'
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null
sudo apt-get update
sudo apt-get -y install postgresql-${{ matrix.ci.PGVER }} postgresql-server-dev-${{ matrix.ci.PGVER }}
- name: 'Start PostgreSQL'
run: |
export PGVER=${{ matrix.ci.PGVER }}
export PGDATA=/var/lib/postgresql/$PGVER/main
export PGETC=/etc/postgresql/$PGVER/main
export PGBIN=/usr/lib/postgresql/$PGVER/bin
export RUNNER_USER=`whoami`
# make sure postgres user can access data files
sudo chmod -R 755 /home/${RUNNER_USER}
sudo cp ./ci/pg_hba.conf $PGETC/pg_hba.conf
sudo systemctl stop postgresql
sudo pg_ctlcluster $PGVER main start
sudo pg_lsclusters
- name: 'Build & Test'
run: |
export PATH=/usr/lib/postgresql/${{ matrix.ci.PGVER }}/bin/:$PATH
PG_CFLAGS=-Werror make
sudo make install
PGUSER=postgres make installcheck || (cat regression.diffs && /bin/false)