chore(frontend): remove frontend #26
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/CD Pipeline | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| lint-and-typecheck: | |
| runs-on: ubuntu-latest | |
| name: Lint and Type Check | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| run: uv python install 3.13 | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Run Ruff linter | |
| id: ruff | |
| run: | | |
| echo "## 🔍 Ruff Linter Results" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| uv run ruff check . --output-format=github 2>&1 | tee ruff-results.txt || true | |
| cat ruff-results.txt >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| - name: Run MyPy type checker | |
| id: mypy | |
| run: | | |
| echo "## 🔬 MyPy Type Checker Results" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| uv run mypy --strict app/ 2>&1 | tee mypy-results.txt || true | |
| cat mypy-results.txt >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| - name: Run Pyright type checker | |
| id: pyright | |
| run: | | |
| echo "## ⚡ Pyright Type Checker Results" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| uv run pyright ./app/ 2>&1 | tee pyright-results.txt || true | |
| cat pyright-results.txt >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| - name: Run Ruff formatter check | |
| id: ruff-format | |
| run: | | |
| echo "## 🎨 Ruff Formatter Results" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| uv run ruff format --check --diff . 2>&1 | tee format-results.txt || true | |
| cat format-results.txt >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| - name: Check for critical issues | |
| run: | | |
| # Check if there are any critical ruff issues | |
| RUFF_ERRORS=$(uv run ruff check . --output-format=github 2>&1 || true) | |
| # Check if there are any mypy errors | |
| MYPY_ERRORS=$(uv run mypy --strict app/ 2>&1 || true) | |
| # Check if there are any pyright errors | |
| PYRIGHT_ERRORS=$(uv run pyright ./app/ 2>&1 || true) | |
| # Count actual errors (not just warnings) | |
| RUFF_ERROR_COUNT=$(echo "$RUFF_ERRORS" | grep -c "error:" || true) | |
| MYPY_ERROR_COUNT=$(echo "$MYPY_ERRORS" | grep -c "error:" || true) | |
| PYRIGHT_ERROR_COUNT=$(echo "$PYRIGHT_ERRORS" | grep -c "error:" || true) | |
| echo "## 📊 Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Ruff errors found:** $RUFF_ERROR_COUNT" >> $GITHUB_STEP_SUMMARY | |
| echo "- **MyPy errors found:** $MYPY_ERROR_COUNT" >> $GITHUB_STEP_SUMMARY | |
| echo "- **Pyright errors found:** $PYRIGHT_ERROR_COUNT" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| if [ "$RUFF_ERROR_COUNT" -gt 0 ] || [ "$MYPY_ERROR_COUNT" -gt 0 ] || [ "$PYRIGHT_ERROR_COUNT" -gt 0 ]; then | |
| echo "❌ **CI Failed:** Critical issues found that need to be fixed." >> $GITHUB_STEP_SUMMARY | |
| exit 1 | |
| else | |
| echo "✅ **CI Passed:** No critical issues found!" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Upload lint results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: lint-results | |
| path: | | |
| ruff-results.txt | |
| mypy-results.txt | |
| pyright-results.txt | |
| format-results.txt | |
| retention-days: 30 | |
| tests: | |
| runs-on: ubuntu-latest | |
| name: Run Tests | |
| needs: lint-and-typecheck | |
| services: | |
| postgres: | |
| image: pgvector/pgvector:pg16 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_USER: postgres | |
| POSTGRES_DB: agent_template | |
| POSTGRES_HOST_AUTH_METHOD: trust | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| run: uv python install 3.13 | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Set up test environment | |
| run: | | |
| echo "DATABASE_URL=postgresql://postgres:postgres@localhost:5432/agent_template" >> $GITHUB_ENV | |
| echo "TESTING=true" >> $GITHUB_ENV | |
| - name: Run database migrations | |
| run: | | |
| echo "Setting up test database..." | |
| - name: Run pytest with coverage | |
| id: pytest | |
| run: | | |
| echo "## 🧪 Pytest Results" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| uv run pytest -v --tb=short --cov=app --cov-report=term --cov-report=html --cov-report=xml 2>&1 | tee pytest-results.txt || true | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| cat pytest-results.txt >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| - name: Generate coverage badge | |
| if: always() | |
| run: | | |
| if [ -f coverage.xml ]; then | |
| COVERAGE=$(python -c "import xml.etree.ElementTree as ET; tree = ET.parse('coverage.xml'); root = tree.getroot(); print(f\"{float(root.attrib['line-rate']) * 100:.1f}\")") | |
| echo "## 📊 Coverage Report" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Code Coverage:** ${COVERAGE}%" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| if (( $(echo "$COVERAGE > 80" | bc -l) )); then | |
| COLOR="brightgreen" | |
| elif (( $(echo "$COVERAGE > 60" | bc -l) )); then | |
| COLOR="yellow" | |
| else | |
| COLOR="red" | |
| fi | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Upload coverage reports | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: coverage-reports | |
| path: | | |
| htmlcov/ | |
| coverage.xml | |
| .coverage | |
| retention-days: 30 | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: | | |
| pytest-results.txt | |
| retention-days: 30 | |
| - name: Check test results | |
| run: | | |
| if grep -q "FAILED" pytest-results.txt; then | |
| FAILED_COUNT=$(grep -c "FAILED" pytest-results.txt || echo "0") | |
| echo "## ❌ Test Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Failed tests:** $FAILED_COUNT" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Please check the test results above and fix failing tests." >> $GITHUB_STEP_SUMMARY | |
| exit 1 | |
| else | |
| PASSED_COUNT=$(grep -c "PASSED" pytest-results.txt || echo "0") | |
| echo "## ✅ Test Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**All tests passed!** ($PASSED_COUNT tests)" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| fi |