Spaces:
Running
Running
| name: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| lint-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install --extra-index-url https://download.pytorch.org/whl/cpu -r requirements-ci.txt | |
| - name: Lint with Ruff | |
| run: ruff check src/ tests/ | |
| - name: Run Unit Tests | |
| env: | |
| SUPABASE_URL: "https://mock-supabase.co" | |
| SUPABASE_ANON_KEY: "mock-key" | |
| SUPABASE_SERVICE_ROLE_KEY: "mock-role-key" | |
| SUPABASE_DB_URL: "postgresql://postgres:postgres@localhost:5432/postgres" | |
| LITELLM_MASTER_KEY: "mock-litellm-key" | |
| OPENROUTER_API_KEY: "mock-openrouter-key" | |
| UPSTASH_REDIS_URL: "redis://localhost:6379" | |
| LANGFUSE_PUBLIC_KEY: "mock-lf-public" | |
| LANGFUSE_SECRET_KEY: "mock-lf-secret" | |
| APP_ENV: "test" | |
| run: | | |
| set -o pipefail | |
| pytest --tb=short -v 2>&1 | tee pytest_failure.log | |
| exit ${PIPESTATUS[0]} | |
| - name: Upload Pytest Failure Log | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pytest-failure-log | |
| path: pytest_failure.log | |
| retention-days: 5 | |