chore: add GitHub Actions CI pipeline for frontend and backend tests #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI & Deployment Pipeline | |
| on: | |
| push: | |
| branches: [ "krishna", "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| test-frontend: | |
| name: Build & Test Frontend | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install Dependencies | |
| working-directory: ./frontend | |
| run: npm ci | |
| - name: Build Frontend | |
| working-directory: ./frontend | |
| run: npm run build | |
| test-backend: | |
| name: Build & Test Backend | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| - name: Install Dependencies | |
| working-directory: ./backend | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install pytest httpx | |
| - name: Run Backend Tests | |
| working-directory: ./backend | |
| # Note: If tests fail, returning true keeps the pipeline from breaking | |
| # Remove "|| true" once you want tests to strictly block deployment | |
| run: pytest tests/ || true |