Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/server-health-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Server Health Check

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test-servers:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

# -------------------------
# Backend DB Setup
# -------------------------
- name: Create backend db directory
run: cmd /c "mkdir backend\db"

- name: Create backend database file
run: cmd /c "type nul > backend\db\progress-dashboard.db"

# -------------------------
# Install wait-on
# -------------------------
- name: Install wait-on
run: npm install -g wait-on

# -------------------------
# Install Dependencies
# -------------------------
- name: Install backend dependencies
run: npm ci
working-directory: backend

- name: Install frontend dependencies
run: npm ci
working-directory: frontend

# -------------------------
# Build
# -------------------------
- name: Build backend (TypeScript)
run: npx tsc
working-directory: backend

- name: Build frontend (Vite)
run: npm run build
working-directory: frontend

# -------------------------
# Start Backend
# -------------------------
- name: Start backend
run: |
cd backend
start /B node dist/index.js
shell: cmd

- name: Wait for backend
run: wait-on http://localhost:4000

# -------------------------
# Start Frontend (Vite Preview)
# -------------------------
- name: Start frontend
run: |
cd frontend
start /B npm run preview
shell: cmd

- name: Wait for frontend
run: wait-on http://localhost:5173

# -------------------------
# ✅ Basic Health Check Tests
# -------------------------
- name: Test backend API
run: curl http://localhost:4000

- name: Test frontend
run: curl http://localhost:5173
Loading