
Merge pull request implementing complete PyPI query MCP server with comprehensive features and CI/CD pipeline.
105 lines
2.4 KiB
YAML
105 lines
2.4 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, develop ]
|
|
pull_request:
|
|
branches: [ main, develop ]
|
|
|
|
jobs:
|
|
test:
|
|
strategy:
|
|
max-parallel: 6
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
python-version: ["3.10", "3.11", "3.12"]
|
|
fail-fast: false
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
cache: 'pip'
|
|
cache-dependency-path: '**/pyproject.toml'
|
|
|
|
# Cache Poetry dependencies
|
|
- name: Cache Poetry dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cache/pypoetry
|
|
key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-poetry-${{ matrix.python-version }}-
|
|
|
|
# Cache nox environments
|
|
- name: Cache nox environments
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: .nox
|
|
key: ${{ runner.os }}-nox-${{ matrix.python-version }}-${{ hashFiles('**/noxfile.py') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-nox-${{ matrix.python-version }}-
|
|
|
|
- name: Install uv
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install uv
|
|
uv --version
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
uvx poetry install
|
|
|
|
- name: Lint with ruff
|
|
run: |
|
|
uvx nox -s lint
|
|
|
|
- name: Type check with mypy
|
|
run: |
|
|
uvx nox -s mypy
|
|
|
|
- name: Run tests
|
|
run: |
|
|
uvx nox -s pytest
|
|
|
|
- name: Upload coverage to Codecov
|
|
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
name: codecov-umbrella
|
|
fail_ci_if_error: false
|
|
|
|
security:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Install uv
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install uv
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
uvx poetry install
|
|
|
|
- name: Run security checks
|
|
run: |
|
|
uvx nox -s safety
|