Skip to content

Commit e4d53a8

Browse files
committed
wip
1 parent 0e6e4fd commit e4d53a8

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

.github/workflows/ci.yml

+17-6
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,19 @@ jobs:
375375
with: { port: '5412', output-unix-paths: 'yes' }
376376
- name: Checkout sources
377377
uses: actions/checkout@v4
378+
- name: Set Database URL
379+
id: db-url
380+
run: |
381+
if [ "$RUNNER_OS" == "Linux" ]; then
382+
echo "DATABASE_URL=postgres://${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ env.PGPORT }}/${{ env.PGDATABASE }}?sslmode=require" >> $GITHUB_OUTPUT
383+
else
384+
echo "DATABASE_URL=${{ steps.pg.outputs.connection-uri }}" >> $GITHUB_OUTPUT
385+
fi
378386
- name: Init database
379387
env:
380388
PGPORT: ${{ env.PGPORT }}
389+
DATABASE_URL: ${{ steps.db-url.outputs.DATABASE_URL }}
381390
run: |
382-
echo "DATABASE_URL=${{ steps.pg.outputs.connection-uri }}"
383-
echo "Print the same in base64 to bypass Github's obfuscation (uses hardcoded password):"
384-
echo "${{ steps.pg.outputs.connection-uri }}" | base64
385391
tests/fixtures/initdb.sh
386392
387393
- name: Copy static files
@@ -392,6 +398,8 @@ jobs:
392398
name: build-${{ matrix.target }}
393399
path: target/
394400
- name: Integration Tests
401+
env:
402+
DATABASE_URL: ${{ steps.db-url.outputs.DATABASE_URL }}
395403
run: |
396404
export MARTIN_BUILD_ALL=-
397405
export MARTIN_BIN=target/martin${{ matrix.ext }}
@@ -400,9 +408,12 @@ jobs:
400408
if [[ "${{ runner.os }}" != "Windows" ]]; then
401409
chmod +x "$MARTIN_BIN" "$MARTIN_CP_BIN" "$MBTILES_BIN"
402410
fi
411+
if [ "$RUNNER_OS" == "Linux" ]; then
412+
export DATABASE_URL="postgres://${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ env.PGPORT }}/${{ env.PGDATABASE }}?sslmode=require"
413+
else
414+
export DATABASE_URL="${{ steps.pg.outputs.connection-uri }}"
415+
fi
403416
tests/test.sh
404-
env:
405-
DATABASE_URL: ${{ env.DATABASE_URL }}
406417
- name: Compare test output results (Linux)
407418
if: matrix.target == 'x86_64-unknown-linux-gnu'
408419
run: diff --brief --recursive --new-file tests/output tests/expected
@@ -422,7 +433,7 @@ jobs:
422433
export MBTILES_BIN=/usr/bin/mbtiles${{ matrix.ext }}
423434
tests/test.sh
424435
env:
425-
DATABASE_URL: ${{ env.DATABASE_URL }}
436+
DATABASE_URL: ${{ steps.db-url.outputs.DATABASE_URL }}
426437
- name: Save test output (on error)
427438
if: failure()
428439
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)