Skip to content

Commit 4090049

Browse files
committed
fail if db is not available
1 parent 172b7c4 commit 4090049

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/ci.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,16 @@ jobs:
3333
run: docker compose run --rm -d db
3434
- name: Wait for db
3535
run: |
36-
for i in {1..30}; do
37-
nc -zv localhost 5432 && break
36+
docker ps -a
37+
for i in {1..60}; do
38+
if nc -zv localhost 5432; then
39+
echo "Database is up!"
40+
exit 0
41+
fi
42+
echo "Waiting for database..."
3843
sleep 1
3944
done
45+
echo "Database is not available."
46+
exit 1
4047
- name: Run tests
4148
run: pdm run pytest

0 commit comments

Comments
 (0)