Skip to content

chore: add integration test to validate docker-compose #2

chore: add integration test to validate docker-compose

chore: add integration test to validate docker-compose #2

name: Docker Compose Integration
on:
pull_request:
branches: [ main ]
jobs:
docker-compose-integration:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Start services
run: docker compose up -d
- name: Wait for services to be healthy
run: |
echo "Waiting for all services to be healthy..."
timeout 300 bash -c 'until [ $(docker compose ps --filter "health=healthy" --quiet | wc -l) -eq 6 ]; do sleep 5; done'
docker compose ps
- name: Test health endpoints
run: |
curl -f http://localhost:8080/health || exit 1
curl -f http://localhost:8081/dashboard/ || exit 1
curl -f http://localhost:8082 || exit 1
- name: Test API endpoints
run: |
# Test basic connectivity to services through Traefik
curl -f -X GET "http://localhost:8080/api/award/health" || exit 1
curl -f -X GET "http://localhost:8080/api/users/health" || exit 1
- name: Show service logs on failure
if: failure()
run: |
echo "=== Docker Compose Services Status ==="
docker compose ps
echo "=== Traefik Logs ==="
docker compose logs traefik
echo "=== Sticker Award Logs ==="
docker compose logs sticker-award
echo "=== User Management Logs ==="
docker compose logs user-management
echo "=== Database Logs ==="
docker compose logs sticker-award-db
docker compose logs user-management-db
- name: Cleanup
if: always()
run: docker compose down -v