Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
128 changes: 128 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Build, Check Formatting
on:
push:
branches: ['*']
pull_request:
branches: ['*']

jobs:
frontend:
name: Frontend Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

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

- name: Check Formatting
working-directory: frontend
run: npm run format:check

- name: Formatting Check Passed
if: success()
run: echo "Prettier formatting check passed ✅"

- name: Lint Check
working-directory: frontend
run: npm run lint

- name: Lint Check Passed
if: success()
run: echo "Linting successful ✅"

- name: Run Frontend Tests
working-directory: frontend
run: npm test

- name: Frontend Tests Passed
if: success()
run: echo "Frontend tests passed ✅"

- name: Build
working-directory: frontend
run: npm run build

- name: Frontend Build Successful
if: success()
run: echo "Frontend build successful ✅"

- name: Run Frontend
working-directory: frontend
run: |
echo "Starting Frontend Server..."
npm run dev &

- name: ✅ Frontend Server Started
if: success()
run: echo "Frontend server started successfully ✅"

backend:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, we don't have to emphasize to seperate frontend and backend, just focus on build/test for both of them.

name: Backend Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

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

- name: ✅ Dependencies Installed
if: success()
run: echo "Backend dependencies installed successfully ✅"

- name: Check Formatting (if you have prettier/eslint)
working-directory: backend
run: |
if npm run format:check > /dev/null 2>&1; then
npm run format:check
else
echo "No format:check script found, skipping formatting check"
fi

- name: ✅ Formatting Check Passed
if: success()
run: echo "Backend formatting check passed ✅"

- name: Lint Check (if you have linting)
working-directory: backend
run: |
if npm run lint > /dev/null 2>&1; then
npm run lint
else
echo "No lint script found, skipping lint check"
fi

- name: ✅ Lint Check Passed
if: success()
run: echo "Backend linting successful ✅"

- name: Build Backend
working-directory: backend
run: npm run build

- name: ✅ Backend Build Successful
if: success()
run: echo "Backend build successful ✅"

- name: Run Backend Server
working-directory: backend
run: |
echo "Starting Backend Server..."
npm run dev &
sleep 5
echo "Backend server started"

- name: ✅ Backend Server Started
if: success()
run: echo "Backend server started successfully ✅"
25 changes: 25 additions & 0 deletions backend/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Dependencies
node_modules

# Build output
dist
build

# Logs
*.log
npm-debug.log*

# Coverage
coverage

# Package files
package-lock.json
yarn.lock

# IDE
.vscode
.idea

# OS
.DS_Store
Thumbs.db
Loading