Skip to content

Fix dependency conflict with simple-ddl-generator (issue #46) #140

Fix dependency conflict with simple-ddl-generator (issue #46)

Fix dependency conflict with simple-ddl-generator (issue #46) #140

Workflow file for this run

name: Tests Pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
flake8_py3:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
- name: Run flake8
run: |
flake8 omymodels/ --count --show-source --statistics
# Unit and functional tests
tests:
runs-on: ubuntu-latest
needs: [flake8_py3]
strategy:
matrix:
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
env:
POETRY_VIRTUALENVS_CREATE: false
- name: Run unit and functional tests
run: |
pytest tests/unit tests/functional -vv --cov=omymodels --cov-report=term-missing --cov-report=xml
- name: Upload coverage to Codecov
if: matrix.python == '3.11'
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
fail_ci_if_error: false
verbose: true
# Integration tests with SQLAlchemy 2.0 (pydantic, pydantic_v2, dataclass, sqlalchemy, sqlalchemy_v2, openapi3)
integration-sqlalchemy:
runs-on: ubuntu-latest
needs: [flake8_py3]
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest simple-ddl-parser Jinja2 py-models-parser 'pydantic>=1.8.2,<2.0.0' table-meta 'sqlalchemy>=2.0'
pip install -e .
- name: Run SQLAlchemy integration tests
run: |
pytest tests/integration/pydantic tests/integration/pydantic_v2 tests/integration/dataclass tests/integration/sqlalchemy tests/integration/sqlalchemy_v2 tests/integration/openapi3 -vv
# Integration tests with Gino (requires SQLAlchemy<1.4)
# Tests use pre-generated code fixtures, no omymodels dependency at runtime
integration-gino:
runs-on: ubuntu-latest
needs: [flake8_py3]
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest 'gino>=1.0.0'
- name: Run Gino integration tests
run: |
pytest tests/integration/gino -vv
# Integration tests with SQLModel (requires Pydantic>=2.0)
# Tests use pre-generated code fixtures, no omymodels dependency at runtime
integration-sqlmodel:
runs-on: ubuntu-latest
needs: [flake8_py3]
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest 'sqlmodel>=0.0.22'
- name: Run SQLModel integration tests
run: |
pytest tests/integration/sqlmodel -vv
deploy-pages:
runs-on: ubuntu-latest
needs: [tests]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4