fix(ci): wait for postgres readiness before migration + tests
Some checks failed
ci/woodpecker/pr/ci Pipeline failed
ci/woodpecker/push/ci Pipeline failed

This commit is contained in:
Jarvis
2026-03-30 20:41:46 -05:00
parent 85d4527701
commit 3321d4575a

View File

@@ -48,7 +48,18 @@ steps:
DATABASE_URL: postgresql://mosaic:mosaic@postgres:5432/mosaic
commands:
- *enable_pnpm
- pnpm --filter @mosaic/db run db:migrate 2>/dev/null || true
# Install postgresql-client for pg_isready
- apk add --no-cache postgresql-client
# Wait up to 30s for postgres to be ready
- |
for i in $(seq 1 30); do
pg_isready -h postgres -p 5432 -U mosaic && break
echo "Waiting for postgres ($i/30)..."
sleep 1
done
# Run migrations (DATABASE_URL is set in environment above)
- pnpm --filter @mosaic/db run db:migrate
# Run all tests
- pnpm test
depends_on:
- typecheck