Skip to content

Минин Антон Дмитриевич #299

Минин Антон Дмитриевич

Минин Антон Дмитриевич #299

Workflow file for this run

name: Docker Compose Test
on:
pull_request:
branches: [ main ]
jobs:
test-compose:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Start services
run: docker compose up -d
- name: Wait for web to be ready
run: |
timeout=60
while ! curl -f http://localhost:5000 >/dev/null 2>&1; do
((timeout--))
if [ $timeout -eq 0 ]; then
echo "Web service failed to start"
exit 1
fi
sleep 1
done
- name: Test web response
run: |
response=$(curl -s http://localhost:5000/ping)
if [[ "$response" != "pong" ]]; then
echo "Expected 'pong', got: $response"
exit 1
fi
echo "Web test passed!"
- name: Test PostgreSQL connection
run: |
docker compose exec -T db pg_isready -U user -d app
- name: Show logs on failure
if: failure()
run: docker compose logs