name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
test:
name: Test on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- 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 -e ".[dev]"
- name: Check code formatting with Black
run: |
black --check prestashop_mcp/ tests/
- name: Lint with Flake8
run: |
flake8 prestashop_mcp/ tests/ --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 prestashop_mcp/ tests/ --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
- name: Run tests with pytest
run: |
pytest tests/ -v --cov=prestashop_mcp --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
build:
name: Build distribution
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build distribution
run: python -m build
- name: Check distribution
run: |
pip install twine
twine check dist/*
- name: Store distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/