Files
userbase/.github/workflows/db.test.yaml
T
shishantbiswas a175c790ee
Run Postgres Tests / test-db (push) Successful in 27s
Run Tests / test (pull_request) Failing after 1s
Update .github/workflows/db.test.yaml
2026-09-25 09:46:14 +00:00

30 lines
816 B
YAML

name: Run Postgres Tests
on: [push]
jobs:
test-db:
runs-on: ubuntu-latest
# Define PostgreSQL as a service container
services:
postgres:
image: postgres:17
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
POSTGRES_DB: test_db
# Ensure the runner waits for the database to be fully up and ready
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Connect to Postgres
run: |
sudo apt-get update && sudo apt-get install -y postgresql-client
PGPASSWORD=test_password psql -p 5432 -h postgres -U test_user -d test_db -c "SELECT version();"