name: Build Integration Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
workflow_dispatch: # Allow manual trigger
jobs:
build-test:
name: Test Build & Installation
# runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
python-version: ["3.12"]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history including tags
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build pytest pytest-cov packaging
- name: Install package dependencies
run: |
pip install -e .[dev]
timeout-minutes: 5
- name: Run all tests that don't require Stata
run: |
# Run all tests except those marked as requiring Stata
# This includes discovery, parsing, and build integration tests
pytest -v -m "not requires_stata"
timeout-minutes: 15
continue-on-error: false
- name: Build package
run: |
python -m build
timeout-minutes: 5
- name: Test installation in clean environment
shell: bash
run: |
# Create fresh venv
python -m venv test_venv
# Activate and install
if [[ "$RUNNER_OS" == "Windows" ]]; then
source test_venv/Scripts/activate
else
source test_venv/bin/activate
fi
# Install built wheel
pip install dist/*.whl
# Test critical imports
python -c "from mcp_stata.server import main; print('[OK] Import successful')"
# Verify entry point
which mcp-stata || where mcp-stata
echo "[OK] Entry point installed"
timeout-minutes: 10
- name: Upload build artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-artifacts-${{ matrix.os }}-py${{ matrix.python-version }}
path: |
dist/
*.log
retention-days: 7