Download .github/workflows/ci.yml from Punit1/Enterprise-AI-Copilot: direct link, hf CLI and curl.
- Browser
- Download file 2.68 kB
-
https://huggingface.co/spaces/Punit1/Enterprise-AI-Copilot/resolve/main/.github/workflows/ci.yml
- Command line
-
hf download hf://spaces/Punit1/Enterprise-AI-Copilot/.github/workflows/ci.yml
-
curl -L -o ci.yml https://huggingface.co/spaces/Punit1/Enterprise-AI-Copilot/resolve/main/.github/workflows/ci.yml
2.68 kB
| name: CI β Enterprise AI Copilot | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| # ββ Lint ββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| lint: | |
| name: Lint (ruff) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| cache: "pip" | |
| - name: Install ruff | |
| run: pip install ruff==0.8.6 | |
| - name: Run ruff check | |
| run: ruff check backend/app/ agents/ services/ | |
| - name: Run ruff format check | |
| run: ruff format --check backend/app/ agents/ services/ | |
| # ββ Backend Tests βββββββββββββββββββββββββββββββββββββββββ | |
| test: | |
| name: Tests (pytest) | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| env: | |
| DEPLOY_MODE: local | |
| LLM_PROVIDER: groq | |
| GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }} | |
| DATABASE_URL: sqlite+aiosqlite:///./test.db | |
| SECRET_KEY: test-secret-key-for-ci-only | |
| DEBUG: "true" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: | | |
| cd backend | |
| pip install -r requirements.txt | |
| - name: Run tests | |
| run: | | |
| cd backend | |
| PYTHONPATH=/backend:/agents:/services pytest ../tests/ -v \ | |
| --cov=app --cov-report=xml --cov-report=term-missing \ | |
| --asyncio-mode=auto | |
| - name: Upload coverage report | |
| uses: codecov/codecov-action@v4 | |
| if: success() | |
| with: | |
| file: ./backend/coverage.xml | |
| # ββ Docker Build ββββββββββββββββββββββββββββββββββββββββββ | |
| docker: | |
| name: Docker Build | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Docker image (HF Spaces) | |
| run: docker build -t enterprise-ai-copilot:latest -f Dockerfile . | |
| - name: Verify container starts | |
| run: | | |
| docker run --rm -d \ | |
| --name test-copilot \ | |
| -e GROQ_API_KEY=test \ | |
| -e SECRET_KEY=test-key \ | |
| -p 7860:7860 \ | |
| enterprise-ai-copilot:latest | |
| sleep 10 | |
| curl -f http://localhost:7860/health || exit 1 | |
| docker stop test-copilot | |