@@ -326,25 +326,46 @@ jobs:
326
326
ext : ' .exe'
327
327
- target : x86_64-unknown-linux-gnu
328
328
os : ubuntu-latest
329
+ env :
330
+ # PG_* variables are used by psql
331
+ PGDATABASE : test
332
+ PGHOST : localhost
333
+ PGUSER : postgres
334
+ PGPASSWORD : postgres
335
+ services :
336
+ postgres :
337
+ image : postgis/postgis:15-3.3
338
+ ports :
339
+ - 5432/tcp
340
+ options : >-
341
+ -e POSTGRES_DB=test
342
+ -e POSTGRES_USER=postgres
343
+ -e POSTGRES_PASSWORD=postgres
344
+ -e PGDATABASE=test
345
+ -e PGUSER=postgres
346
+ -e PGPASSWORD=postgres
347
+ --health-cmd pg_isready
348
+ --health-interval 10s
349
+ --health-timeout 5s
350
+ --health-retries 5
351
+ --entrypoint sh
352
+ postgis/postgis:15-3.3
353
+ -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"
329
354
steps :
330
- - name : Install and run Postgis
331
- uses : nyurik/action-setup-postgis@v2
332
- id : pg
333
- with : { username: 'test', password: 'test', database: 'test' }
355
+ # - name: Install and run Postgis
356
+ # uses: nyurik/action-setup-postgis@v2
357
+ # id: pg
358
+ # with: { username: 'test', password: 'test', database: 'test' }
334
359
- name : Start NGINX
335
360
336
361
id : nginx
337
362
with : { port: '5412', output-unix-paths: 'yes' }
338
363
- name : Checkout sources
339
364
uses : actions/checkout@v4
340
365
- name : Init database
341
- 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
366
+ run : tests/fixtures/initdb.sh
346
367
env :
347
- PGSERVICE : ${{ steps.pg.outputs.service-name }}
368
+ PGPORT : ${{ job.services.postgres.ports[5432] }}
348
369
- name : Copy static files
349
370
run : cp -r tests/fixtures/pmtiles2/* ${{ steps.nginx.outputs.html-dir }}
350
371
- name : Download build artifact build-${{ matrix.target }}
@@ -363,7 +384,7 @@ jobs:
363
384
fi
364
385
tests/test.sh
365
386
env :
366
- DATABASE_URL : ${{ steps.pg.outputs.connection-uri }}
387
+ DATABASE_URL : postgres:// ${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ job.services.postgres.ports[5432] }}/${{ env.PGDATABASE }}?sslmode=require
367
388
- name : Compare test output results (Linux)
368
389
if : matrix.target == 'x86_64-unknown-linux-gnu'
369
390
run : diff --brief --recursive --new-file tests/output tests/expected
@@ -383,7 +404,7 @@ jobs:
383
404
export MBTILES_BIN=/usr/bin/mbtiles${{ matrix.ext }}
384
405
tests/test.sh
385
406
env :
386
- DATABASE_URL : ${{ steps.pg.outputs.connection-uri }}
407
+ DATABASE_URL : postgres:// ${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ job.services.postgres.ports[5432] }}/${{ env.PGDATABASE }}?sslmode=require
387
408
- name : Save test output (on error)
388
409
if : failure()
389
410
uses : actions/upload-artifact@v4
0 commit comments