fix: move to bookworm #608
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: Run pytest | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| pytest: | |
| name: Run Pytest | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: ['3.11', '3.12'] | |
| services: | |
| postgres: | |
| image: postgres:latest | |
| env: | |
| POSTGRES_USER: scram | |
| POSTGRES_PASSWORD: '' | |
| POSTGRES_DB: test_scram_${{ matrix.python-version }} | |
| POSTGRES_HOST_AUTH_METHOD: trust | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U scram" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| redis: | |
| image: redis:5.0 | |
| ports: | |
| - 6379:6379 | |
| steps: | |
| - name: Check out the code | |
| uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_PULL_AUTH_USER }} | |
| password: ${{ secrets.DOCKER_HUB_PULL_AUTH_PAT }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install uv | |
| uv pip install --system -r requirements/local.txt | |
| # https://github.com/pytest-dev/pytest-github-actions-annotate-failures/pull/68 isn't yet in a release | |
| uv pip install --system git+https://github.com/pytest-dev/pytest-github-actions-annotate-failures.git@6e66cd895fe05cd09be8bad58f5d79110a20385f | |
| - name: Apply migrations | |
| env: | |
| DATABASE_URL: "postgres://scram:@localhost:5432/test_scram_${{ matrix.python-version }}" | |
| run: | | |
| python manage.py makemigrations --noinput | |
| python manage.py migrate --noinput | |
| - name: Check for missing migrations | |
| env: | |
| DATABASE_URL: "postgres://scram:@localhost:5432/test_scram_${{ matrix.python-version }}" | |
| run: python manage.py makemigrations --check | |
| - name: Run Pytest | |
| env: | |
| DATABASE_URL: "postgres://scram:@localhost:5432/test_scram_${{ matrix.python-version }}" | |
| REDIS_HOST: "localhost" | |
| run: pytest |