-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (69 loc) · 2.42 KB
/
test.yml
File metadata and controls
84 lines (69 loc) · 2.42 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
name: Test
on:
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
test:
name: Test (Node ${{ matrix.node }} - Camunda ${{ matrix.camunda }})
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: true
matrix:
node: [22, 24]
camunda: ['8.8', '8.9']
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm run test:unit
- name: Start Camunda ${{ matrix.camunda }} with Docker Compose
working-directory: assets/c8/${{ matrix.camunda }}
run: docker compose up -d
- name: Wait for Camunda to be ready
run: |
echo "Waiting for Camunda at localhost:8080..."
# First wait for topology endpoint
for i in {1..60}; do
if curl -s -f -u demo:demo http://localhost:8080/v2/topology > /dev/null; then
echo "Topology endpoint is ready!"
break
fi
echo "Attempt $i: Topology not ready yet, waiting..."
sleep 5
done
# Then wait an additional 30 seconds for broker to fully initialize
echo "Waiting additional time for broker to initialize..."
sleep 30
# Verify we can actually deploy
echo "Testing deployment capability..."
for i in {1..30}; do
if curl -s -u demo:demo http://localhost:8080/v2/topology | grep -q '"health":"healthy"'; then
echo "Broker is healthy, ready for deployments!"
exit 0
fi
echo "Attempt $i: Broker not fully ready, waiting..."
sleep 2
done
echo "Camunda may not be fully ready, but continuing with tests..."
- name: Run integration tests
run: npm run test:integration
env:
CAMUNDA_VERSION: ${{ matrix.camunda }}
- name: Stop Camunda
if: always()
working-directory: assets/c8/${{ matrix.camunda }}
run: docker compose down -v
- name: Show Camunda logs on failure
if: failure()
working-directory: assets/c8/${{ matrix.camunda }}
run: docker compose logs