-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (74 loc) · 2.46 KB
/
compose-smoke-test.yml
File metadata and controls
85 lines (74 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Compose Smoke Test
on:
push:
branches: [ main ]
paths:
- 'packages/**'
- 'installer/compose/**'
- '.github/workflows/compose-smoke-test.yml'
pull_request:
branches: [ main ]
paths:
- 'packages/**'
- 'installer/compose/**'
permissions:
contents: read
jobs:
smoke-test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Start Docker Compose stack
working-directory: installer/compose
run: docker compose up -d
- name: Wait for services to be healthy
working-directory: installer/compose
run: |
echo "Waiting for backend to be ready..."
timeout 120 bash -c 'until curl -f http://localhost:8080/api/health 2>/dev/null; do sleep 2; done' || {
echo "Backend failed to start in time. Logs:"
docker compose logs backend
exit 1
}
- name: Run health check
run: |
RESPONSE=$(curl -s http://localhost:8080/api/health)
echo "Health response: $RESPONSE"
STATUS=$(echo $RESPONSE | jq -r '.status')
if [ "$STATUS" != "UP" ]; then
echo "ERROR: Health check failed. Status: $STATUS"
exit 1
fi
echo "✓ Health check passed"
- name: Check dashboard accessibility
run: |
curl -f http://localhost:3000 || exit 1
echo "✓ Dashboard is accessible"
- name: Check Flyway migrations
run: |
# Wait a bit for migrations to complete
sleep 5
docker compose -f installer/compose/docker-compose.yml logs backend | grep -E "Successfully applied [0-9]+ migration"
if [ $? -eq 0 ]; then
echo "✓ Flyway migrations applied successfully"
else
echo "ERROR: Migrations did not complete as expected"
docker compose -f installer/compose/docker-compose.yml logs backend
exit 1
fi
- name: Show logs on failure
if: failure()
working-directory: installer/compose
run: |
echo "=== Backend logs ==="
docker compose logs backend
echo "=== PostgreSQL logs ==="
docker compose logs postgres
echo "=== Container status ==="
docker compose ps
- name: Cleanup
if: always()
working-directory: installer/compose
run: docker compose down -v