ci: add postgres health-check options, remove fragile /dev/tcp wait
Some checks failed
Build and Push / Build and Push Docker Image (push) Failing after 18m2s
Some checks failed
Build and Push / Build and Push Docker Image (push) Failing after 18m2s
This commit is contained in:
parent
1ceb932321
commit
db6d231887
1 changed files with 5 additions and 14 deletions
|
|
@ -29,6 +29,11 @@ jobs:
|
|||
POSTGRES_PASSWORD: postgres
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
|
@ -77,20 +82,6 @@ jobs:
|
|||
mix assets.setup && \
|
||||
mix compile --warnings-as-errors'
|
||||
|
||||
- name: Wait for PostgreSQL
|
||||
run: |
|
||||
set -euo pipefail
|
||||
for i in $(seq 1 30); do
|
||||
if echo >/dev/tcp/localhost/5432 2>/dev/null; then
|
||||
echo "PostgreSQL ready"
|
||||
exit 0
|
||||
fi
|
||||
echo "Waiting for PostgreSQL ($i/30)..."
|
||||
sleep 2
|
||||
done
|
||||
echo "PostgreSQL did not become ready" >&2
|
||||
exit 1
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue