-
Notifications
You must be signed in to change notification settings - Fork 37
72 lines (57 loc) · 2.53 KB
/
makefile.yml
File metadata and controls
72 lines (57 loc) · 2.53 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
name: Makefile CI
on:
push:
branches: [ "add-license-1", "main" ]
pull_request:
branches: [ "add-license-1", "main" ]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y git make maven groovy python3-venv python3-pip curl
curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | sudo gpg --dearmor -o /usr/share/keyrings/mongodb-server-6.0.gpg
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
- name: Build
run: make build
- name: Run
run: |
make run
wait_for_url() {
local url="$1"
local name="$2"
local attempts=18
local delay=5
for ((i=1; i<=attempts; i++)); do
if curl -sf "$url" > /dev/null; then
echo "✓ $name is ready"
return 0
fi
echo "Waiting for $name ($url) to become ready... attempt $i/$attempts"
sleep "$delay"
done
echo "✗ Timed out waiting for $name ($url)"
return 1
}
wait_for_url "http://localhost:4382/" "Main Controller (4382)"
wait_for_url "http://localhost:4390/" "Emulator (4390)"
- name: Health check
run: |
echo "Checking service health..."
curl -sf http://localhost:4382/ > /dev/null && echo "✓ Main Controller (4382) is up" || echo "✗ Main Controller (4382) is down"
curl -sf http://localhost:4390/ > /dev/null && echo "✓ Emulator (4390) is up" || echo "✗ Emulator (4390) is down"
curl -sf http://localhost:10000/ > /dev/null && echo "✓ Tester (10000) is up" || echo "✗ Tester (10000) is down"
curl -sf http://localhost:8000/static/ui_example/staff/visual.html > /dev/null && echo "✓ Service Center (8000) is up" || echo "✗ Service Center (8000) is down"
# Fail the job if any service is not responding
curl -sf http://localhost:4382/ > /dev/null
curl -sf http://localhost:4390/ > /dev/null
curl -sf http://localhost:10000/ > /dev/null
curl -sf http://localhost:8000/static/ui_example/staff/visual.html > /dev/null
- name: Stop
if: always()
run: make stop