test.yml•2.01 kB
name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12"]
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]
- name: Lint with flake8
run: |
# Stop the build if there are Python syntax errors or undefined names
flake8 newrelic_mcp --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings
flake8 newrelic_mcp --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
- name: Format check with black
run: black --check newrelic_mcp
- name: Type check with mypy
run: mypy newrelic_mcp
continue-on-error: true # Allow mypy to fail for now
- name: Test package import
run: |
python -c "import newrelic_mcp; print('Package import successful')"
python -m newrelic_mcp --help || echo "CLI help test completed"
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- 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: twine check dist/*
- name: Test installation
run: |
pip install dist/*.whl
newrelic-mcp-server --help || echo "CLI installation test completed"
newrelic-mcp-setup --help || echo "Setup CLI test completed"