Skip to content

Commit 291daf6

Browse files
authored
Create mvp.yml
1 parent 590c29c commit 291daf6

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

‎.github/workflows/mvp.yml‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: MVP CI Workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test-mvp:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
# 1️⃣ Checkout code
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
20+
# 2️⃣ Setup Node.js
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: 20
25+
26+
# 3️⃣ Install dependencies
27+
- name: Install dependencies
28+
run: npm install
29+
30+
# 4️⃣ Start backend in background
31+
- name: Start backend
32+
run: |
33+
nohup npm run start & # run server.js in background
34+
sleep 5 # wait for backend to be ready
35+
36+
# 5️⃣ Serve frontend in background
37+
- name: Serve frontend
38+
run: |
39+
nohup npx http-server ./app/frontend -p 8081 -c-1 &
40+
sleep 5
41+
42+
# 6️⃣ Test backend endpoints
43+
- name: Test health endpoint
44+
run: |
45+
curl -f http://localhost:8080/health
46+
47+
- name: Test reservations endpoint
48+
run: |
49+
curl -f -X GET http://localhost:8080/reservations
50+
curl -f -X POST http://localhost:8080/reservations \
51+
-H "Content-Type: application/json" \
52+
-d '{"guestName":"Test","roomNumber":"101","fromDate":"2026-01-30","toDate":"2026-02-02"}'
53+
54+
# 7️⃣ Optional: Test frontend served on 8081
55+
- name: Test frontend
56+
run: |
57+
curl -f http://localhost:8081/index.html

0 commit comments

Comments
 (0)