forked from microsoft/AIOpsLab
-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (45 loc) · 1.47 KB
/
main.yml
File metadata and controls
55 lines (45 loc) · 1.47 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
name: MVP CI Workflow
on:
push:
branches:
- sc-mvp/app-deploy # Your branch
pull_request:
branches:
- sc-mvp/app-deploy
jobs:
test-mvp:
runs-on: ubuntu-latest
steps:
# 1️⃣ Checkout repo
- name: Checkout repository
uses: actions/checkout@v3
# 2️⃣ Setup Node.js
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
# 3️⃣ Install dependencies
- name: Install dependencies
run: npm install
# 4️⃣ Start backend in background
- name: Start backend
run: |
nohup npm run start & # run server.js in background
sleep 5 # wait for backend to start
# 5️⃣ Serve frontend in background
- name: Serve frontend
run: |
nohup npx http-server ./app/frontend -p 8081 -c-1 &
sleep 5
# 6️⃣ Test backend endpoints
- name: Test health endpoint
run: curl -f http://localhost:8080/health
- name: Test reservations endpoint
run: |
curl -f -X GET http://localhost:8080/reservations
curl -f -X POST http://localhost:8080/reservations \
-H "Content-Type: application/json" \
-d '{"guestName":"Test","roomNumber":"101","fromDate":"2026-01-30","toDate":"2026-02-02"}'
# 7️⃣ Optional: Test frontend
- name: Test frontend
run: curl -f http://localhost:8081/index.html