Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkAndshark committed Jan 27, 2025
1 parent 0e6e4fd commit e4d53a8
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,19 @@ jobs:
with: { port: '5412', output-unix-paths: 'yes' }
- name: Checkout sources
uses: actions/checkout@v4
- name: Set Database URL
id: db-url
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
echo "DATABASE_URL=postgres://${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ env.PGPORT }}/${{ env.PGDATABASE }}?sslmode=require" >> $GITHUB_OUTPUT
else
echo "DATABASE_URL=${{ steps.pg.outputs.connection-uri }}" >> $GITHUB_OUTPUT
fi
- name: Init database
env:
PGPORT: ${{ env.PGPORT }}
DATABASE_URL: ${{ steps.db-url.outputs.DATABASE_URL }}
run: |
echo "DATABASE_URL=${{ steps.pg.outputs.connection-uri }}"
echo "Print the same in base64 to bypass Github's obfuscation (uses hardcoded password):"
echo "${{ steps.pg.outputs.connection-uri }}" | base64
tests/fixtures/initdb.sh
- name: Copy static files
Expand All @@ -392,6 +398,8 @@ jobs:
name: build-${{ matrix.target }}
path: target/
- name: Integration Tests
env:
DATABASE_URL: ${{ steps.db-url.outputs.DATABASE_URL }}
run: |
export MARTIN_BUILD_ALL=-
export MARTIN_BIN=target/martin${{ matrix.ext }}
Expand All @@ -400,9 +408,12 @@ jobs:
if [[ "${{ runner.os }}" != "Windows" ]]; then
chmod +x "$MARTIN_BIN" "$MARTIN_CP_BIN" "$MBTILES_BIN"
fi
if [ "$RUNNER_OS" == "Linux" ]; then
export DATABASE_URL="postgres://${{ env.PGUSER }}:${{ env.PGUSER }}@${{ env.PGHOST }}:${{ env.PGPORT }}/${{ env.PGDATABASE }}?sslmode=require"
else
export DATABASE_URL="${{ steps.pg.outputs.connection-uri }}"
fi
tests/test.sh
env:
DATABASE_URL: ${{ env.DATABASE_URL }}
- name: Compare test output results (Linux)
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: diff --brief --recursive --new-file tests/output tests/expected
Expand All @@ -422,7 +433,7 @@ jobs:
export MBTILES_BIN=/usr/bin/mbtiles${{ matrix.ext }}
tests/test.sh
env:
DATABASE_URL: ${{ env.DATABASE_URL }}
DATABASE_URL: ${{ steps.db-url.outputs.DATABASE_URL }}
- name: Save test output (on error)
if: failure()
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit e4d53a8

Please sign in to comment.