mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 15:19:10 +02:00
Co-authored-by: Jeremiah Lowin <jlowin@users.noreply.github.com> Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
80 lines
2.2 KiB
YAML
80 lines
2.2 KiB
YAML
name: Run tests
|
|
|
|
env:
|
|
# enable colored output
|
|
PY_COLORS: 1
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
paths:
|
|
- "src/**"
|
|
- "tests/**"
|
|
- "uv.lock"
|
|
- "pyproject.toml"
|
|
- ".github/workflows/**"
|
|
|
|
# run on all pull requests because these checks are required and will block merges otherwise
|
|
pull_request:
|
|
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
run_tests:
|
|
name: "Run tests: Python ${{ matrix.python-version }} on ${{ matrix.os }}"
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
python-version: ["3.10"]
|
|
fail-fast: false
|
|
timeout-minutes: 5
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v6
|
|
with:
|
|
enable-cache: true
|
|
cache-dependency-glob: "uv.lock"
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install FastMCP
|
|
# run with frozen to use the current lockfile; static checks will determine if it needs updating
|
|
run: uv sync --frozen
|
|
|
|
- name: Run tests (excluding integration and client_process)
|
|
run: uv run pytest tests -m "not integration and not client_process"
|
|
|
|
- name: Run client process tests separately
|
|
run: uv run pytest tests -m "client_process" -x
|
|
|
|
run_integration_tests:
|
|
name: "Run integration tests"
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v6
|
|
with:
|
|
enable-cache: true
|
|
cache-dependency-glob: "uv.lock"
|
|
python-version: "3.10"
|
|
|
|
- name: Install FastMCP
|
|
# run with frozen to use the current lockfile; static checks will determine if it needs updating
|
|
run: uv sync --frozen
|
|
|
|
- name: Run integration tests
|
|
run: uv run pytest tests -m "integration"
|
|
env:
|
|
FASTMCP_GITHUB_TOKEN: ${{ secrets.FASTMCP_GITHUB_TOKEN }}
|
|
FASTMCP_TEST_AUTH_GITHUB_CLIENT_ID: ${{ secrets.FASTMCP_TEST_AUTH_GITHUB_CLIENT_ID }}
|
|
FASTMCP_TEST_AUTH_GITHUB_CLIENT_SECRET: ${{ secrets.FASTMCP_TEST_AUTH_GITHUB_CLIENT_SECRET }}
|