Skip to content

chore: add Claude MPM configuration file #61

chore: add Claude MPM configuration file

chore: add Claude MPM configuration file #61

name: Comprehensive Test Suite
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
test-category: ["unit", "integration", "tui", "cli", "config"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev,test,tui]"
pip install pytest-asyncio pytest-timeout pytest-cov
# Install spaCy model for ML tests
python -m spacy download en_core_web_sm || true
- name: Install system dependencies for TUI testing
run: |
# Install virtual display for headless TUI testing
sudo apt-get update
sudo apt-get install -y xvfb
- name: Run linting and formatting checks
if: matrix.test-category == 'unit' && matrix.python-version == '3.12'
run: |
python -m ruff check src/
python -m black --check src/
python -m mypy src/gitflow_analytics --ignore-missing-imports
- name: Run ${{ matrix.test-category }} tests
env:
DISPLAY: ":99"
run: |
# Start virtual display for TUI tests
if [ "${{ matrix.test-category }}" = "tui" ]; then
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
sleep 2
fi
python run_all_tests.py --categories ${{ matrix.test-category }} --coverage --verbose
- name: Upload coverage reports
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: ${{ matrix.test-category }}
name: codecov-${{ matrix.test-category }}
ml-tests:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev,test,ml]"
python -m spacy download en_core_web_sm
- name: Run ML and qualitative tests
run: |
python run_all_tests.py --categories ml --verbose
- name: Run report generation tests
run: |
python run_all_tests.py --categories reports --verbose
integration-tests:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev,test,tui]"
python -m spacy download en_core_web_sm
- name: Create test repository
run: |
git config --global user.email "test@example.com"
git config --global user.name "Test User"
mkdir test-repo
cd test-repo
git init
echo "# Test" > README.md
git add README.md
git commit -m "Initial commit"
- name: Run integration tests with test data
env:
DISPLAY: ":99"
run: |
# Start virtual display for TUI integration tests
sudo apt-get update
sudo apt-get install -y xvfb
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
sleep 2
# Run comprehensive integration tests
python run_all_tests.py --categories integration --verbose
performance-tests:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev,test]"
pip install pytest-benchmark
- name: Run performance tests
run: |
python -m pytest tests/ -m "slow" --benchmark-only --verbose