Skip to content

Commit c5442e2

Browse files
committed
back to postgis/postgis:15-3.3
1 parent e3c929f commit c5442e2

File tree

2 files changed

+49
-15
lines changed

2 files changed

+49
-15
lines changed

.github/workflows/ci.yml

+47-13
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
PGPASSWORD: postgres
2929
services:
3030
postgres:
31-
image: postgis/postgis:16-3.4
31+
image: postgis/postgis:15-3.3
3232
ports:
3333
# will assign a random free host port
3434
- 5432/tcp
@@ -46,7 +46,7 @@ jobs:
4646
--health-timeout 5s
4747
--health-retries 5
4848
--entrypoint sh
49-
postgis/postgis:16-3.4
49+
postgis/postgis:postgis:15-3.3
5050
-c "exec docker-entrypoint.sh postgres -c ssl=on -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key"
5151
steps:
5252
- uses: taiki-e/install-action@v2
@@ -314,6 +314,35 @@ jobs:
314314
name: Test on ${{ matrix.os }}
315315
runs-on: ${{ matrix.os }}
316316
needs: [ build ]
317+
env:
318+
# PG_* variables are used by psql
319+
PGDATABASE: test
320+
PGHOST: localhost
321+
PGUSER: postgres
322+
PGPASSWORD: postgres
323+
services:
324+
if: matrix.os == 'ubuntu-latest'
325+
postgres:
326+
image: postgis/postgis:15-3.3
327+
ports:
328+
# will assign a random free host port
329+
- 5432/tcp
330+
# Sadly there is currently no way to pass arguments to the service image other than this hack
331+
# See also https://stackoverflow.com/a/62720566/177275
332+
options: >-
333+
-e POSTGRES_DB=test
334+
-e POSTGRES_USER=postgres
335+
-e POSTGRES_PASSWORD=postgres
336+
-e PGDATABASE=test
337+
-e PGUSER=postgres
338+
-e PGPASSWORD=postgres
339+
--health-cmd pg_isready
340+
--health-interval 10s
341+
--health-timeout 5s
342+
--health-retries 5
343+
--entrypoint sh
344+
postgis/postgis:postgis:15-3.3
345+
-c "exec docker-entrypoint.sh postgres -c ssl=on -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key"
317346
strategy:
318347
fail-fast: true
319348
matrix:
@@ -327,24 +356,29 @@ jobs:
327356
- target: x86_64-unknown-linux-gnu
328357
os: ubuntu-latest
329358
steps:
330-
- name: Install and run Postgis
331-
uses: nyurik/action-setup-postgis@v2
359+
- name: Install and run Postgis (windows)
360+
if: matrix.os == 'windows-latest'
361+
uses: nyurik/[email protected]
332362
id: pg
333-
with: { username: 'test', password: 'test', database: 'test' }
363+
with: { username: 'test', password: 'test', database: 'test',postgres-version: 15, postgis_version: 3.3.3}
334364
- name: Start NGINX
335365
uses: nyurik/[email protected]
336366
id: nginx
337367
with: { port: '5412', output-unix-paths: 'yes' }
338368
- name: Checkout sources
339369
uses: actions/checkout@v4
340-
- name: Init database
370+
- name: Set DATABASE_URL
371+
id: set-db-url
341372
run: |
342-
echo "DATABASE_URL=${{ steps.pg.outputs.connection-uri }}"
343-
echo "Print the same in base64 to bypass Github's obfuscation (uses hardcoded password):"
344-
echo "${{ steps.pg.outputs.connection-uri }}" | base64
345-
tests/fixtures/initdb.sh
373+
if [[ "${{ runner.os }}" == "Windows" ]]; then
374+
echo "DATABASE_URL=${{ steps.pg.outputs.connection-uri }}" >> $GITHUB_ENV
375+
else
376+
echo "DATABASE_URL=postgres://${{ env.PGUSER }}:${{ env.PGPASSWORD }}@${{ env.PGHOST }}:${{ job.services.postgres.ports[5432] }}/${{ env.PGDATABASE }}?sslmode=require" >> $GITHUB_ENV
377+
fi
378+
- name: Init database
379+
run: tests/fixtures/initdb.sh
346380
env:
347-
PGSERVICE: ${{ steps.pg.outputs.service-name }}
381+
DATABASE_URL: ${{ env.DATABASE_URL }}
348382
- name: Copy static files
349383
run: cp -r tests/fixtures/pmtiles2/* ${{ steps.nginx.outputs.html-dir }}
350384
- name: Download build artifact build-${{ matrix.target }}
@@ -363,7 +397,7 @@ jobs:
363397
fi
364398
tests/test.sh
365399
env:
366-
DATABASE_URL: ${{ steps.pg.outputs.connection-uri }}
400+
DATABASE_URL: ${{ env.DATABASE_URL }}
367401
- name: Compare test output results (Linux)
368402
if: matrix.target == 'x86_64-unknown-linux-gnu'
369403
run: diff --brief --recursive --new-file tests/output tests/expected
@@ -383,7 +417,7 @@ jobs:
383417
export MBTILES_BIN=/usr/bin/mbtiles${{ matrix.ext }}
384418
tests/test.sh
385419
env:
386-
DATABASE_URL: ${{ steps.pg.outputs.connection-uri }}
420+
DATABASE_URL: ${{ env.DATABASE_URL }}
387421
- name: Save test output (on error)
388422
if: failure()
389423
uses: actions/upload-artifact@v4

docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99

1010
db-is-ready:
1111
# This should match the version of postgres used in the CI workflow
12-
image: postgis/postgis:14-3.3-alpine
12+
image: postgis/postgis:15-3.3-alpine
1313
network_mode: host
1414
command:
1515
- 'sh'
@@ -25,7 +25,7 @@ services:
2525

2626
db:
2727
# This should match the version of postgres used in the CI workflow
28-
image: postgis/postgis:14-3.3-alpine
28+
image: postgis/postgis:15-3.3-alpine
2929
restart: unless-stopped
3030
ports:
3131
- '${PGPORT:-5411}:5432'

0 commit comments

Comments
 (0)