Skip to content

Commit e13653e

Browse files
committed
fix: select a random port for optimizing db
1 parent cce979e commit e13653e

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/custom.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ jobs:
4848
postgres-version: 17
4949
env:
5050
GITHUB_TOKEN: ${{ github.token }}
51-
SOURCE_POSTGRES_URL: postgres://query_doctor@localhost:5432/testing
51+
SOURCE_DATABASE_URL: postgres://query_doctor@localhost:5432/testing
5252
LOG_PATH: /var/log/postgresql/postgres.log
5353
SITE_API_ENDPOINT: ${{ vars.SITE_API_ENDPOINT }}

action.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ runs:
6060
- name: Start PostgreSQL
6161
shell: bash
6262
run: |
63+
PORT=$(shuf -i 10000-65000 -n 1)
64+
echo "PG_PORT=$PORT" >> $GITHUB_ENV
6365
docker run -d \
6466
--name query-doctor-postgres \
65-
-p 5432:5432 \
67+
-p $PORT:5432 \
6668
ghcr.io/query-doctor/postgres:pg-${{ inputs.postgres-version }}
6769
until docker exec query-doctor-postgres pg_isready -U postgres; do
6870
sleep 1
@@ -78,4 +80,4 @@ runs:
7880
CI: "true"
7981
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
8082
SITE_API_ENDPOINT: ${{ env.SITE_API_ENDPOINT }}
81-
POSTGRES_URL: postgresql://postgres@localhost:5432/postgres
83+
POSTGRES_URL: postgresql://postgres@localhost:${{ env.PG_PORT }}/postgres

0 commit comments

Comments
 (0)