fix: Add conftest.py and set PYTHONPATH in CI to fix pytest-django im… #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| django-version: ["4.2", "5.0", "5.1"] | |
| exclude: | |
| # Django 5.0+ requires Python 3.10+, but some features need 3.11+ | |
| - python-version: "3.10" | |
| django-version: "5.1" | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| 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,drf]" | |
| - name: Run tests | |
| env: | |
| PYTHONPATH: ${{ github.workspace }} | |
| DJANGO_SETTINGS_MODULE: tests.settings | |
| run: | | |
| pytest tests/ -v | |
| - name: Run Security Audit | |
| env: | |
| PYTHONPATH: ${{ github.workspace }} | |
| DJANGO_SETTINGS_MODULE: tests.settings | |
| run: | | |
| python tests/security_audit.py |