name: Test and Build
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build pytest
pip install -e .
- name: Test package build
run: python -m build
- name: Test package installation
run: |
pip install dist/*.whl
python -c "import meta_ads_mcp; print('Package imported successfully')"
validate-version:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Check version bump
run: |
# This is a simple check - you might want to make it more sophisticated
echo "Current version in pyproject.toml:"
grep "version = " pyproject.toml