Skip to content

Commit

Permalink
fail if db is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
wozniakpl committed Sep 16, 2024
1 parent 172b7c4 commit 4090049
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,16 @@ jobs:
run: docker compose run --rm -d db
- name: Wait for db
run: |
for i in {1..30}; do
nc -zv localhost 5432 && break
docker ps -a
for i in {1..60}; do
if nc -zv localhost 5432; then
echo "Database is up!"
exit 0
fi
echo "Waiting for database..."
sleep 1
done
echo "Database is not available."
exit 1
- name: Run tests
run: pdm run pytest

0 comments on commit 4090049

Please sign in to comment.