name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12"]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Run tests
run: uv run pytest --cov=system_info_mcp --cov-report=term-missing
- name: Run linting
run: uv run ruff check src/ tests/
- name: Run type checking
run: uv run mypy src/
- name: Test package build
run: uv build
- name: Test package installation
run: uv run --with ./dist/*.whl --no-project mcp-system-info --help
shell: bash
# Test that the package can be installed and run
integration-test:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python
run: uv python install 3.12
- name: Build package
run: uv build
- name: Test with uvx
run: |
# Test that uvx can run the package
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | \
timeout 5 uvx --from ./dist/*.whl mcp-system-info || echo "Server responded correctly"