28
28
PGPASSWORD : postgres
29
29
services :
30
30
postgres :
31
- image : postgis/postgis:16 -3.4
31
+ image : postgis/postgis:14 -3.3
32
32
ports :
33
33
# will assign a random free host port
34
34
- 5432/tcp
46
46
--health-timeout 5s
47
47
--health-retries 5
48
48
--entrypoint sh
49
- postgis/postgis:16 -3.4
49
+ postgis/postgis:14 -3.3
50
50
-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"
51
51
steps :
52
52
- uses : taiki-e/install-action@v2
89
89
# TODO: aarch64-unknown-linux-gnu
90
90
services :
91
91
postgres :
92
- image : postgis/postgis:15 -3.3
92
+ image : postgis/postgis:14 -3.3
93
93
ports :
94
94
- 5432/tcp
95
95
options : >-
@@ -104,7 +104,7 @@ jobs:
104
104
--health-timeout 5s
105
105
--health-retries 5
106
106
--entrypoint sh
107
- postgis/postgis:15 -3.3
107
+ postgis/postgis:14 -3.3
108
108
-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"
109
109
110
110
steps :
@@ -324,6 +324,13 @@ jobs:
324
324
name : Test on ${{ matrix.os }}
325
325
runs-on : ${{ matrix.os }}
326
326
needs : [ build ]
327
+ env :
328
+ # PG_* variables are used by psql
329
+ PGDATABASE : test
330
+ PGHOST : localhost
331
+ PGUSER : postgres
332
+ PGPASSWORD : postgres
333
+ PGPORT : 34837
327
334
strategy :
328
335
fail-fast : true
329
336
matrix :
@@ -337,24 +344,48 @@ jobs:
337
344
- target : x86_64-unknown-linux-gnu
338
345
os : ubuntu-latest
339
346
steps :
340
- - name : Install and run Postgis
341
- uses : nyurik/action-setup-postgis@v2
347
+ - name : Install and run Postgis (Windows)
348
+ if : matrix.os == 'windows-latest'
349
+
342
350
id : pg
343
- with : { username: 'test', password: 'test', database: 'test' }
351
+ with : { username: 'postgres', password: 'postgres', database: 'test',postgres-version: 14, port: 34837, postgis_version: 3.3.3}
352
+ - name : Install and run Postgis (Ubuntu)
353
+ if : matrix.os == 'ubuntu-latest'
354
+ run : |
355
+ docker run -d \
356
+ -p 34837:5432 \
357
+ -e POSTGRES_DB=test \
358
+ -e POSTGRES_USER=postgres \
359
+ -e POSTGRES_PASSWORD=postgres \
360
+ -e PGDATABASE=test \
361
+ -e PGUSER=postgres \
362
+ -e PGPASSWORD=postgres \
363
+ --health-cmd="pg_isready" \
364
+ --health-interval=10s \
365
+ --health-timeout=5s \
366
+ --health-retries=5 \
367
+ postgis/postgis:14-3.3 \
368
+ postgres \
369
+ -c ssl=on \
370
+ -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem \
371
+ -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
344
372
- name : Start NGINX
345
373
346
374
id : nginx
347
375
with : { port: '5412', output-unix-paths: 'yes' }
348
376
- name : Checkout sources
349
377
uses : actions/checkout@v4
350
378
- name : Init database
379
+ env :
380
+ PGPORT : ${{ env.PGPORT }}
351
381
run : |
352
- echo "DATABASE_URL=${{ steps.pg.outputs.connection-uri }}"
353
- echo "Print the same in base64 to bypass Github's obfuscation (uses hardcoded password):"
354
- echo "${{ steps.pg.outputs.connection-uri }}" | base64
382
+ if [ "$RUNNER_OS" == "Linux" ]; then
383
+ export DATABASE_URL="postgres://${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ env.PGPORT }}/${{ env.PGDATABASE }}?sslmode=require"
384
+ else
385
+ export PGSERVICE="${{ steps.pg.outputs.service-name }}"
386
+ fi
355
387
tests/fixtures/initdb.sh
356
- env :
357
- PGSERVICE : ${{ steps.pg.outputs.service-name }}
388
+
358
389
- name : Copy static files
359
390
run : cp -r tests/fixtures/pmtiles2/* ${{ steps.nginx.outputs.html-dir }}
360
391
- name : Download build artifact build-${{ matrix.target }}
@@ -371,12 +402,15 @@ jobs:
371
402
if [[ "${{ runner.os }}" != "Windows" ]]; then
372
403
chmod +x "$MARTIN_BIN" "$MARTIN_CP_BIN" "$MBTILES_BIN"
373
404
fi
405
+ if [ "$RUNNER_OS" == "Linux" ]; then
406
+ export DATABASE_URL="postgres://${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ env.PGPORT }}/${{ env.PGDATABASE }}?sslmode=require"
407
+ else
408
+ export DATABASE_URL="${{ steps.pg.outputs.connection-uri }}"
409
+ fi
374
410
tests/test.sh
375
- env :
376
- DATABASE_URL : ${{ steps.pg.outputs.connection-uri }}
377
- # - name: Compare test output results (Linux)
378
- # if: matrix.target == 'x86_64-unknown-linux-gnu'
379
- # run: diff --brief --recursive --new-file tests/output tests/expected
411
+ - name : Compare test output results (Linux)
412
+ if : matrix.target == 'x86_64-unknown-linux-gnu'
413
+ run : diff --brief --recursive --new-file tests/output tests/expected
380
414
- name : Download Debian package (Linux)
381
415
if : matrix.target == 'x86_64-unknown-linux-gnu'
382
416
uses : actions/download-artifact@v4
@@ -393,7 +427,7 @@ jobs:
393
427
export MBTILES_BIN=/usr/bin/mbtiles${{ matrix.ext }}
394
428
tests/test.sh
395
429
env :
396
- DATABASE_URL : ${{ steps.pg.outputs.connection-uri }}
430
+ DATABASE_URL : postgres:// ${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ env.PGPORT }}/${{ env.PGDATABASE }}?sslmode=require
397
431
- name : Save test output (on error)
398
432
if : failure()
399
433
uses : actions/upload-artifact@v4
@@ -420,7 +454,7 @@ jobs:
420
454
args : postgres
421
455
sslmode : disable
422
456
# alpine images don't support SSL, so for this we use the debian images
423
- - img_ver : 15 -3.3
457
+ - img_ver : 14 -3.3
424
458
args : 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
425
459
sslmode : require
426
460
#
0 commit comments