|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +jobs: |
| 10 | + ruff: |
| 11 | + name: Ruff |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Install uv |
| 17 | + uses: astral-sh/setup-uv@v5 |
| 18 | + with: |
| 19 | + version: "0.6.12" |
| 20 | + enable-cache: true |
| 21 | + cache-dependency-glob: "uv.lock" |
| 22 | + |
| 23 | + - name: Set up Python |
| 24 | + uses: actions/setup-python@v5 |
| 25 | + with: |
| 26 | + python-version-file: ".python-version" |
| 27 | + |
| 28 | + - name: Install dependencies |
| 29 | + run: uv sync --all-extras --dev |
| 30 | + |
| 31 | + - name: Lint with Ruff |
| 32 | + run: uv run ruff check . |
| 33 | + |
| 34 | + mypy: |
| 35 | + name: MyPy |
| 36 | + runs-on: ubuntu-latest |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + |
| 40 | + - name: Install uv |
| 41 | + uses: astral-sh/setup-uv@v5 |
| 42 | + with: |
| 43 | + version: "0.6.12" |
| 44 | + enable-cache: true |
| 45 | + cache-dependency-glob: "uv.lock" |
| 46 | + |
| 47 | + - name: Set up Python |
| 48 | + uses: actions/setup-python@v5 |
| 49 | + with: |
| 50 | + python-version-file: ".python-version" |
| 51 | + |
| 52 | + - name: Install dependencies |
| 53 | + run: uv sync --all-extras --dev |
| 54 | + |
| 55 | + - name: Type check with MyPy |
| 56 | + run: uv run mypy . |
| 57 | + |
| 58 | + test: |
| 59 | + name: Test Python ${{ matrix.python-version }} |
| 60 | + runs-on: ubuntu-latest |
| 61 | + strategy: |
| 62 | + fail-fast: false |
| 63 | + matrix: |
| 64 | + python-version: ["3.10", "3.11", "3.12"] |
| 65 | + |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v4 |
| 68 | + |
| 69 | + - name: Install uv |
| 70 | + uses: astral-sh/setup-uv@v5 |
| 71 | + with: |
| 72 | + version: "0.6.12" |
| 73 | + python-version: ${{ matrix.python-version }} |
| 74 | + enable-cache: true |
| 75 | + cache-dependency-glob: "uv.lock" |
| 76 | + |
| 77 | + - name: Install dependencies |
| 78 | + run: uv sync --all-extras --dev |
| 79 | + |
| 80 | + - name: Run tests |
| 81 | + run: uv run pytest --cov=fastapi_mcp --cov-report=xml |
| 82 | + |
| 83 | + - name: Upload coverage to Codecov |
| 84 | + uses: codecov/codecov-action@v5 |
| 85 | + with: |
| 86 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 87 | + fail_ci_if_error: false |
0 commit comments