Skip to content

add husky for pre-commit linting & GH workflows #4

add husky for pre-commit linting & GH workflows

add husky for pre-commit linting & GH workflows #4

Workflow file for this run

name: Build Check
on:
push:
branches: [development, main]
pull_request:
branches: [development, main]
jobs:
frontend-build:
name: Frontend Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js 18
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
working-directory: ./frontend
run: npm ci
- name: Check formatting with Prettier
working-directory: ./frontend
run: npm run format:check
- name: Run linting
working-directory: ./frontend
run: npm run lint:check
- name: Run type checking
working-directory: ./frontend
run: npm run type-check
- name: Build application
working-directory: ./frontend
run: npm run build
- name: Run tests
working-directory: ./frontend
run: npm test --if-present --passWithNoTests
backend-build:
name: Backend Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: backend/requirements.txt
- name: Install dependencies
working-directory: ./backend
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install black flake8 mypy
- name: Check formatting with Black
working-directory: ./backend
run: python -m black --check .
- name: Run linting with flake8
working-directory: ./backend
run: python -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Run type checking with mypy
working-directory: ./backend
run: python -m mypy . --ignore-missing-imports || echo "⚠️ Type checking completed with warnings"
- name: Test import structure
working-directory: ./backend
run: |
python -c "
try:
import main
import scraper
import resume_optimizer
import pdf_utils
print('✅ All main modules import successfully')
except ImportError as e:
print(f'❌ Import error: {e}')
exit(1)
"
docker-build:
name: Docker Build Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build frontend Docker image
run: |
docker build -f frontend/Dockerfile.dev frontend/ -t ats-buddy-frontend:test
echo "✅ Frontend Docker image built successfully"
- name: Build backend Docker image
run: |
docker build -f backend/Dockerfile.dev backend/ -t ats-buddy-backend:test
echo "✅ Backend Docker image built successfully"
- name: Test Docker Compose configuration
run: |
# Test that compose files are valid
docker compose -f compose.dev-groq.yml config > /dev/null
echo "✅ dev-groq compose file is valid"
docker compose -f compose.network.yml -f compose.backend.yml -f compose.frontend.yml config > /dev/null
echo "✅ Full stack compose files are valid"