
- Change Python test matrix from 3.8-3.12 to 3.10-3.13 - Update test-install to test on 3.10 and 3.13 (min/max versions) - Keep other Python versions in workflow for comprehensive testing This aligns with the updated minimum Python requirement of 3.10+ to match the mcp package dependency requirements.
134 lines
3.1 KiB
YAML
134 lines
3.1 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, develop ]
|
|
pull_request:
|
|
branches: [ main, develop ]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -e .[dev,test]
|
|
|
|
- name: Run package validation
|
|
run: python run_tests.py --validate
|
|
|
|
- name: Run unit tests
|
|
run: python run_tests.py --type unit --coverage
|
|
|
|
- name: Run integration tests
|
|
run: python run_tests.py --type integration
|
|
|
|
- name: Run MCP tests
|
|
run: python run_tests.py --type mcp
|
|
|
|
- name: Run code quality checks
|
|
run: python run_tests.py --lint
|
|
|
|
- name: Upload coverage to Codecov
|
|
if: matrix.python-version == '3.11'
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
fail_ci_if_error: true
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Install build dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install build twine
|
|
|
|
- name: Build package
|
|
run: python -m build
|
|
|
|
- name: Check package
|
|
run: python -m twine check dist/*
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: dist
|
|
path: dist/
|
|
|
|
test-install:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.10", "3.13"]
|
|
|
|
steps:
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Download build artifacts
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: dist
|
|
path: dist/
|
|
|
|
- name: Install package from wheel
|
|
run: |
|
|
pip install dist/*.whl
|
|
|
|
- name: Test CLI installation
|
|
run: |
|
|
vultr-dns-mcp --help
|
|
vultr-dns-mcp --version
|
|
|
|
- name: Test package imports
|
|
run: |
|
|
python -c "from vultr_dns_mcp import VultrDNSClient, create_mcp_server; print('✅ Package imports successful')"
|
|
python -c "from vultr_dns_mcp.cli import main; print('✅ CLI imports successful')"
|
|
|
|
security:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Install security tools
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install safety bandit
|
|
|
|
- name: Run safety check
|
|
run: safety check
|
|
|
|
- name: Run bandit security scan
|
|
run: bandit -r src/
|