Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI Tests

on:
workflow_call:

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
django-version: ["4.2", "5.0", "5.1", "5.2"]
exclude:
# Django 5.0+ requires Python 3.10+
- python-version: "3.8"
django-version: "5.0"
- python-version: "3.8"
django-version: "5.1"
- python-version: "3.8"
django-version: "5.2"
- python-version: "3.9"
django-version: "5.0"
- python-version: "3.9"
django-version: "5.1"
- python-version: "3.9"
django-version: "5.2"

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 Django==${{ matrix.django-version }}
pip install -e .[dev]

- name: Run tests
run: |
pytest --cov=django_odata --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: matrix.python-version == '3.11' && matrix.django-version == '4.2'
with:
file: ./coverage.xml
fail_ci_if_error: false


52 changes: 52 additions & 0 deletions .github/workflows/pr-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Pull Request Quality

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
pip install Django==5.2

- name: Lint with flake8
run: |
flake8 django_odata --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 django_odata --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Format check with black
run: |
black --check django_odata tests

- name: Import sort check with isort
run: |
isort --profile black --check-only django_odata tests

- name: Check Django setup and run migrations
run: |
python -m django check --settings=tests.integration.support.settings
python -m django showmigrations --settings=tests.integration.support.settings

- name: Run security audit (pip-audit)
run: |
pip install pip-audit
pip-audit --desc || echo "Security audit completed with findings"

- name: Run bandit security check
run: |
bandit -r django_odata -f json -o bandit-report.json || true
bandit -r django_odata


11 changes: 11 additions & 0 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Pull Request CI

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
tests:
uses: ./.github/workflows/ci-tests.yml


49 changes: 1 addition & 48 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,54 +12,7 @@ permissions:

jobs:
tests:
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: tests.settings
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
django-version: ["4.2", "5.0", "5.1", "5.2"]
exclude:
# Django 5.0+ requires Python 3.10+
- python-version: "3.8"
django-version: "5.0"
- python-version: "3.8"
django-version: "5.1"
- python-version: "3.8"
django-version: "5.2"
- python-version: "3.9"
django-version: "5.0"
- python-version: "3.9"
django-version: "5.1"
- python-version: "3.9"
django-version: "5.2"

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 Django==${{ matrix.django-version }}
pip install -e .[dev]

- name: Run tests
env:
DJANGO_SETTINGS_MODULE: tests.settings
run: |
pytest --cov=django_odata --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: matrix.python-version == '3.11' && matrix.django-version == '4.2'
with:
file: ./coverage.xml
fail_ci_if_error: false
uses: ./.github/workflows/ci-tests.yml

release-build:
runs-on: ubuntu-latest
Expand Down
120 changes: 0 additions & 120 deletions .github/workflows/test.yml

This file was deleted.