fastmcp/.github/workflows/run-tests.yml
2025-04-13 21:18:38 -04:00

63 lines
1.3 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/**"
pull_request:
paths:
- "src/**"
- "tests/**"
- "uv.lock"
- "pyproject.toml"
- ".github/workflows/**"
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@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install FastMCP
run: uv sync --dev
- name: Fix pyreadline on Windows
if: matrix.os == 'windows-latest'
run: |
uv pip uninstall -y pyreadline
uv pip install pyreadline3
- name: Run tests
run: uv run pytest -vv
if: ${{ !(github.event.pull_request.head.repo.fork) }}