name: Tests on: push: branches-ignore: - 'main' workflow_dispatch: pull_request: types: [opened, synchronize, reopened] branches: - 'main' permissions: contents: read pull-requests: write checks: write env: USE_DJANGO_Q: 'true' jobs: testing: runs-on: ubuntu-latest strategy: fail-fast: false max-parallel: 10 matrix: # The package supports Django 4.2 -> 6.1; each Django series only runs on # a subset of Python versions, so incompatible pairs are excluded below. python-version: ['3.11', '3.12', '3.13'] django-version: ['4.2', '5.2', '6.1'] exclude: # Django 6.x requires Python 3.12+ - python-version: '3.11' django-version: '6.1' # Django 4.2 supports Python 3.8 -> 3.12 - python-version: '3.13' django-version: '4.2' steps: - uses: actions/checkout@v7 with: ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Set up Python ${{ matrix.python-version }} with Django ${{ matrix.django-version }} uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} - name: Install Dependencies run: | python -m pip install --upgrade pip # requirements.txt pins a single Django; install everything else from it so # dependency bumps stay covered, then install the Django for this matrix leg. grep -viE '^django==' requirements.txt > /tmp/requirements-no-django.txt pip install -r /tmp/requirements-no-django.txt pip install "Django~=${{ matrix.django-version }}.0" pip install coverage - name: Debug Coverage Configuration run: | coverage debug sys coverage debug config - name: Setup Database and Migrations env: USE_DJANGO_Q: 'true' run: | python manage.py makemigrations python manage.py migrate - name: Run Tests env: USE_DJANGO_Q: 'true' run: | python manage.py test appointment.tests --parallel=10 --shuffle --verbosity=2 - name: Install tblib for better error reporting if: failure() run: pip install tblib - name: Rerun failed tests with tblib env: USE_DJANGO_Q: 'true' if: failure() run: | python manage.py test appointment.tests --parallel=10 --shuffle --verbosity=2 # Merge Dependabot patch and minor updates once the tests pass. # Major updates stay open for a manual review, except setuptools. # setuptools bumps its major version often and is only a build tool. automerge: needs: testing if: github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]' runs-on: ubuntu-latest permissions: contents: write pull-requests: write steps: - id: meta uses: dependabot/fetch-metadata@v3 - if: (steps.meta.outputs.update-type != 'version-update:semver-major' || steps.meta.outputs.dependency-names == 'setuptools') run: gh pr merge --squash "$PR_URL" env: PR_URL: ${{ github.event.pull_request.html_url }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}