1+ name : Docker Compose Integration
2+
3+ on :
4+ pull_request :
5+ branches : [ main ]
6+
7+ jobs :
8+ docker-compose-integration :
9+ runs-on : ubuntu-latest
10+
11+ steps :
12+ - name : Checkout code
13+ uses : actions/checkout@v4
14+
15+ - name : Set up Docker Buildx
16+ uses : docker/setup-buildx-action@v3
17+
18+ - name : Start services
19+ run : docker compose up -d
20+
21+ - name : Wait for services to be healthy
22+ run : |
23+ echo "Waiting for all services to be healthy..."
24+ timeout 300 bash -c 'until [ $(docker compose ps --filter "health=healthy" --quiet | wc -l) -eq 6 ]; do sleep 5; done'
25+ docker compose ps
26+
27+ - name : Test health endpoints
28+ run : |
29+ curl -f http://localhost:8080/health || exit 1
30+ curl -f http://localhost:8081/dashboard/ || exit 1
31+ curl -f http://localhost:8082 || exit 1
32+
33+ - name : Test API endpoints
34+ run : |
35+ # Test basic connectivity to services through Traefik
36+ curl -f -X GET "http://localhost:8080/api/award/health" || exit 1
37+ curl -f -X GET "http://localhost:8080/api/users/health" || exit 1
38+
39+ - name : Show service logs on failure
40+ if : failure()
41+ run : |
42+ echo "=== Docker Compose Services Status ==="
43+ docker compose ps
44+ echo "=== Traefik Logs ==="
45+ docker compose logs traefik
46+ echo "=== Sticker Award Logs ==="
47+ docker compose logs sticker-award
48+ echo "=== User Management Logs ==="
49+ docker compose logs user-management
50+ echo "=== Database Logs ==="
51+ docker compose logs sticker-award-db
52+ docker compose logs user-management-db
53+
54+ - name : Cleanup
55+ if : always()
56+ run : docker compose down -v
0 commit comments