Skip to content

Commit 139f539

Browse files
authored
Fix ubuntu ci and start testing PG18 (#2892)
* Update ubuntu.yml Add PG 18 to testing * Update ubuntu.yml Change to use pgdg snapshot so can test in-development and weekly stable * Update ubuntu.yml Purge old PostgreSQL install so new one is already 5432 * Update ubuntu.yml specify version of PostgreSQL in snapshot repo * Update ubuntu.yml remove 20.04, that is no longer available and use testing postgresql repo instead of snapshot (to be able to get older versions)
1 parent 849c833 commit 139f539

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

.github/workflows/ubuntu.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,28 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
psql: [13,14,15,16,17]
32+
psql: [13,14,15,16,17,18]
3333
postgis: [3]
34-
os: [ubuntu-latest, ubuntu-22.04, ubuntu-20.04]
34+
os: [ubuntu-latest, ubuntu-22.04]
3535

3636
steps:
3737
- uses: actions/checkout@v4
3838

39-
- name: get postgres version
39+
- name: 'Raise Priority for apt.postgresql.org'
4040
run: |
41-
sudo service postgresql start
42-
pgver=$(psql --version | grep -Po '(?<=psql \(PostgreSQL\) )[^;]+(?=\.\d+ \()')
43-
echo "PGVER=${pgver}" >> $GITHUB_ENV
44-
PGP=5433
45-
if [ "${{ matrix.psql }}" == "${pgver}" ]; then PGP=5432; fi
46-
echo "PGPORT=${PGP}" >> $GITHUB_ENV
47-
41+
cat << EOF >> ./pgdg.pref
42+
Package: *
43+
Pin: release o=apt.postgresql.org
44+
Pin-Priority: 600
45+
EOF
46+
sudo mv ./pgdg.pref /etc/apt/preferences.d/
47+
sudo apt update
48+
4849
- name: Add PostgreSQL APT repository
4950
run: |
50-
sudo apt-get install curl ca-certificates gnupg
51-
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
52-
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ \
53-
$(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
51+
sudo apt-get purge postgresql-*
52+
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg-testing main ${{ matrix.psql }}" > /etc/apt/sources.list.d/pgdg.list'
53+
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null
5454
5555
- name: Install dependencies
5656
run: |
@@ -81,6 +81,7 @@ jobs:
8181
run: |
8282
sudo service postgresql start
8383
export PG_RUNNER_USER=`whoami`
84+
export PGPORT=5432
8485
sudo -u postgres psql -p ${PGPORT} -c "DROP DATABASE IF EXISTS ___pgr___test___;"
8586
sudo -u postgres psql -p ${PGPORT} -c "DROP DATABASE IF EXISTS \"${PG_RUNNER_USER}\";"
8687
sudo -u postgres psql -p ${PGPORT} -c "DROP ROLE IF EXISTS \"${PG_RUNNER_USER}\";"

0 commit comments

Comments
 (0)