|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +jobs: |
| 10 | + lint: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v3 |
| 14 | + - name: Set up Python 3.11 |
| 15 | + uses: actions/setup-python@v4 |
| 16 | + with: |
| 17 | + python-version: "3.11" |
| 18 | + - name: Install dependencies |
| 19 | + run: | |
| 20 | + python -m pip install --upgrade pip |
| 21 | + pip install ruff |
| 22 | + - name: Lint with ruff |
| 23 | + run: | |
| 24 | + ruff check . |
| 25 | + - name: Format check with ruff |
| 26 | + run: | |
| 27 | + ruff format --check . |
| 28 | +
|
| 29 | + unit-tests: |
| 30 | + needs: lint |
| 31 | + runs-on: ubuntu-latest |
| 32 | + strategy: |
| 33 | + matrix: |
| 34 | + python-version: ["3.11", "3.12"] |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v3 |
| 37 | + - name: Set up Python ${{ matrix.python-version }} |
| 38 | + uses: actions/setup-python@v4 |
| 39 | + with: |
| 40 | + python-version: ${{ matrix.python-version }} |
| 41 | + - name: Install dependencies |
| 42 | + run: | |
| 43 | + python -m pip install --upgrade pip |
| 44 | + pip install .[dev,anthropic,openai,search,e2b] |
| 45 | + - name: Test with pytest |
| 46 | + run: | |
| 47 | + pytest tests/unit |
| 48 | +
|
| 49 | + transport-tests: |
| 50 | + needs: lint |
| 51 | + name: "transport/${{ matrix.transport }}" |
| 52 | + runs-on: ubuntu-latest |
| 53 | + strategy: |
| 54 | + fail-fast: false |
| 55 | + matrix: |
| 56 | + transport: [stdio, sse, streamableHttp] |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@v3 |
| 59 | + - name: Set up Python 3.11 |
| 60 | + uses: actions/setup-python@v4 |
| 61 | + with: |
| 62 | + python-version: "3.11" |
| 63 | + - name: Install uv |
| 64 | + run: | |
| 65 | + pip install uv |
| 66 | + - name: Install dependencies |
| 67 | + run: | |
| 68 | + uv pip install --system .[dev,anthropic,openai,search,e2b] |
| 69 | + - name: Run integration tests for ${{ matrix.transport }} transport |
| 70 | + run: | |
| 71 | + pytest tests/integration/transports/${{ matrix.transport }} |
| 72 | +
|
| 73 | + primitive-tests: |
| 74 | + needs: lint |
| 75 | + name: "primitive/${{ matrix.primitive }}" |
| 76 | + runs-on: ubuntu-latest |
| 77 | + strategy: |
| 78 | + fail-fast: false |
| 79 | + matrix: |
| 80 | + primitive: [sampling, tools, resources, prompts, elicitation] |
| 81 | + steps: |
| 82 | + - uses: actions/checkout@v3 |
| 83 | + - name: Set up Python 3.11 |
| 84 | + uses: actions/setup-python@v4 |
| 85 | + with: |
| 86 | + python-version: "3.11" |
| 87 | + - name: Install uv |
| 88 | + run: | |
| 89 | + pip install uv |
| 90 | + - name: Install dependencies |
| 91 | + run: | |
| 92 | + uv pip install --system .[dev,anthropic,openai,search,e2b] |
| 93 | + - name: Run integration tests for ${{ matrix.primitive }} primitive |
| 94 | + run: | |
| 95 | + pytest tests/integration/primitives/test_${{ matrix.primitive }}.py |
0 commit comments