name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
test:
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
requirements.txt
pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev,test]
- name: Run tests with coverage
run: |
python run_tests.py --type essential
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
basic-functionality-test:
name: Basic Functionality Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev,test]
- name: Test package import
run: |
python -c "import conceptnet_mcp; print('Package import successful')"
- name: Test server help
run: |
timeout 30s python -m conceptnet_mcp.server --help || test $? = 124
build:
name: Build Package
runs-on: ubuntu-latest
needs: [test, basic-functionality-test]
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: 'pip'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: |
python -m build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 7
production-readiness:
name: Production Readiness Check
runs-on: ubuntu-latest
needs: [test, basic-functionality-test]
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev,test]
- name: Run production readiness validation
run: |
python validate_production_readiness.py
- name: Test complete workflow with run_tests.py
run: |
python run_tests.py --type essential