Skip to content

Commit

Permalink
add wait for database step to the staging-pipeline.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ae2079 committed Aug 1, 2024
1 parent db16aa0 commit 5ed076b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/staging-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@ jobs:
run: yarn install
- name: Run linter
run: yarn lint
- name: Create test database
- name: Wait for PostgreSQL to be ready
run: |
psql -U postgres -c "CREATE DATABASE \"notification-center\";"
until pg_isready -h localhost -p 5432; do
echo "Waiting for PostgreSQL to be ready..."
sleep 1
done
- name: Check and Create Database if it doesn't exist
run: |
psql -U postgres -tc "SELECT 1 FROM pg_database WHERE datname = 'notification-center'" | grep -q 1 || psql -U postgres -c "CREATE DATABASE \"notification-center\";"
- name: Run migrations
run: yarn db:migrate:run:test
- name: Run tests
Expand Down

0 comments on commit 5ed076b

Please sign in to comment.