Update from RegioHelden's modulesync-config-django #233
Workflow file for this run
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: Test | |
| on: | |
| # code pushed to pull request branch | |
| push: | |
| branches-ignore: | |
| - main | |
| # when draft state is removed (needed as automatically created PRs are not triggering this action) | |
| pull_request: | |
| types: [ready_for_review] | |
| jobs: | |
| # lint code for errors | |
| # see https://github.com/RegioHelden/github-reusable-workflows/blob/main/.github/workflows/python-ruff.yaml | |
| lint: | |
| name: Lint | |
| permissions: | |
| contents: read | |
| uses: RegioHelden/github-reusable-workflows/.github/workflows/python-ruff.yaml@v2.4.0 | |
| with: | |
| ruff-version: "0.11.5" | |
| test: | |
| name: Unit tests | |
| runs-on: ubuntu-latest | |
| needs: | |
| - lint | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: | |
| - "3.9" | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| - "3.13" | |
| django: | |
| - "4.2" | |
| - "5.0" | |
| - "5.1" | |
| - "5.2" | |
| exclude: | |
| - django: "4.2" | |
| python-version: "3.13" | |
| - django: "5.0" | |
| python-version: "3.9" | |
| - django: "5.0" | |
| python-version: "3.13" | |
| - django: "5.1" | |
| python-version: "3.9" | |
| - django: "5.2" | |
| python-version: "3.9" | |
| # Service containers to run with `runner-job` | |
| services: | |
| # Label used to access the service container | |
| postgres: | |
| # Docker Hub image | |
| image: postgres:17-alpine | |
| # Provide the password for postgres | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: postgres | |
| # Set health checks to wait until postgres has started | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| # Maps tcp port 5432 on service container to the host | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Install database drivers | |
| run: uv pip install --system psycopg==3.2.6 | |
| - name: Install Django 4.2 | |
| if: matrix.django == 4.2 | |
| run: uv pip install --system "Django>=4.2,<5.0" | |
| - name: Install Django 5.0 | |
| if: matrix.django == 5.0 | |
| run: uv pip install --system "Django>=5.0,<5.1" | |
| - name: Install Django 5.1 | |
| if: matrix.django == 5.1 | |
| run: uv pip install --system "Django>=5.1,<5.2" | |
| - name: Install Django 5.2 | |
| if: matrix.django == 5.2 | |
| run: uv pip install --system "Django>=5.2,<6.0" | |
| - name: Install requirements | |
| run: uv pip install --system -r requirements-ci.txt | |
| - name: Install package | |
| run: uv pip install --system -e . | |
| - name: Run tests | |
| run: python manage.py test |