Spaces:
Running
Running
| name: CI | |
| on: | |
| push: | |
| branches: [main, dev, develop] | |
| pull_request: | |
| branches: [main, dev, develop] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Lint with ruff | |
| run: | | |
| ruff check . --exclude tests | |
| ruff format --check . --exclude tests | |
| continue-on-error: true | |
| - name: Type check with mypy | |
| run: | | |
| mypy src | |
| continue-on-error: true | |
| - name: Install embedding dependencies | |
| run: | | |
| pip install -e ".[embeddings]" | |
| - name: Run unit tests (excluding OpenAI and embedding providers) | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| pytest tests/unit/ -v -m "not openai and not embedding_provider" --tb=short -p no:logfire --cov --cov-branch --cov-report=xml --cov-report=term | |
| - name: Run local embeddings tests | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| pytest tests/ -v -m "local_embeddings" --tb=short -p no:logfire --cov --cov-branch --cov-report=xml --cov-report=term --cov-append || true | |
| continue-on-error: true # Allow failures if dependencies not available | |
| - name: Run HuggingFace integration tests | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| pytest tests/integration/ -v -m "huggingface and not embedding_provider" --tb=short -p no:logfire --cov --cov-branch --cov-report=xml --cov-report=term --cov-append || true | |
| continue-on-error: true # Allow failures if HF_TOKEN not set | |
| - name: Run non-OpenAI integration tests (excluding embedding providers) | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| pytest tests/integration/ -v -m "integration and not openai and not embedding_provider" --tb=short -p no:logfire --cov --cov-branch --cov-report=xml --cov-report=term --cov-append || true | |
| continue-on-error: true # Allow failures if dependencies not available | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| slug: DeepCritical/GradioDemo | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| continue-on-error: true | |
| docs: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/develop') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "latest" | |
| - name: Install dependencies | |
| run: | | |
| uv sync --extra dev | |
| - name: Configure Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git | |
| - name: Deploy to GitHub Pages | |
| run: | | |
| # mkdocs gh-deploy automatically creates .nojekyll, but let's verify | |
| uv run mkdocs gh-deploy --force --message "Deploy docs [skip ci]" --strict | |
| # Verify .nojekyll was created in gh-pages branch | |
| git fetch origin gh-pages:gh-pages || true | |
| git checkout gh-pages || true | |
| if [ -f .nojekyll ]; then | |
| echo "✓ .nojekyll file exists" | |
| else | |
| echo "⚠ .nojekyll file missing, creating it..." | |
| touch .nojekyll | |
| git add .nojekyll | |
| git commit -m "Add .nojekyll to disable Jekyll [skip ci]" || true | |
| git push origin gh-pages || true | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |