Update .github/workflows/db.test.yaml
This commit is contained in:
@@ -8,7 +8,7 @@ jobs:
|
|||||||
# Define PostgreSQL as a service container
|
# Define PostgreSQL as a service container
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16
|
image: postgres:17
|
||||||
env:
|
env:
|
||||||
POSTGRES_USER: test_user
|
POSTGRES_USER: test_user
|
||||||
POSTGRES_PASSWORD: test_password
|
POSTGRES_PASSWORD: test_password
|
||||||
@@ -19,7 +19,7 @@ jobs:
|
|||||||
--health-interval 5s
|
--health-interval 5s
|
||||||
--health-retries 5
|
--health-retries 5
|
||||||
ports:
|
ports:
|
||||||
- 5432:5432
|
- 6969:5432
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -27,8 +27,5 @@ jobs:
|
|||||||
|
|
||||||
- name: Connect to Postgres
|
- name: Connect to Postgres
|
||||||
run: |
|
run: |
|
||||||
# Install postgres-client to test the connection (if using an alpine/ubuntu base runner)
|
|
||||||
sudo apt-get update && sudo apt-get install -y postgresql-client
|
sudo apt-get update && sudo apt-get install -y postgresql-client
|
||||||
|
PGPASSWORD=test_password psql -p 6969 -h postgres -U test_user -d test_db -c "SELECT version();"
|
||||||
# Query the service using the service name 'postgres' as the host
|
|
||||||
PGPASSWORD=test_password psql -h postgres -U test_user -d test_db -c "SELECT version();"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user