|
| 1 | +name: Run tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths-ignore: |
| 6 | + - 'docs/**' |
| 7 | + pull_request: |
| 8 | + paths-ignore: |
| 9 | + - 'docs/**' |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +permissions: |
| 16 | + contents: read |
| 17 | + |
| 18 | +jobs: |
| 19 | + test-postgres: |
| 20 | + runs-on: ubuntu-latest |
| 21 | + strategy: |
| 22 | + matrix: |
| 23 | + include: |
| 24 | + - python: '3.9' |
| 25 | + django: 'Django>=4.2,<4.3' |
| 26 | + wagtail: 'wagtail>=7.0,<7.1' |
| 27 | + postgres: 'postgres:15' |
| 28 | + - python: '3.9' |
| 29 | + django: 'Django>=5.2,<5.3' |
| 30 | + wagtail: 'wagtail>=7.0,<7.1' |
| 31 | + postgres: 'postgres:15' |
| 32 | + - python: '3.10' |
| 33 | + django: 'Django>=5.2,<5.3' |
| 34 | + wagtail: 'wagtail>=7.0,<7.1' |
| 35 | + postgres: 'postgres:15' |
| 36 | + - python: '3.11' |
| 37 | + django: 'Django>=5.2,<5.3' |
| 38 | + wagtail: 'wagtail>=7.0,<7.1' |
| 39 | + postgres: 'postgres:15' |
| 40 | + - python: '3.12' |
| 41 | + django: 'Django>=5.2,<5.3' |
| 42 | + wagtail: 'wagtail>=7.0,<7.1' |
| 43 | + postgres: 'postgres:15' |
| 44 | + - python: '3.13' |
| 45 | + django: 'Django>=5.2,<5.3' |
| 46 | + wagtail: 'wagtail>=7.0,<7.1' |
| 47 | + postgres: 'postgres:15' |
| 48 | + |
| 49 | + services: |
| 50 | + postgres: |
| 51 | + image: ${{ matrix.postgres || 'postgres:15' }} |
| 52 | + env: |
| 53 | + POSTGRES_PASSWORD: postgres |
| 54 | + ports: |
| 55 | + - 5432:5432 |
| 56 | + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 |
| 57 | + |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@v4 |
| 60 | + with: |
| 61 | + persist-credentials: false |
| 62 | + - name: Set up Python ${{ matrix.python }} |
| 63 | + uses: actions/setup-python@v5 |
| 64 | + with: |
| 65 | + python-version: ${{ matrix.python }} |
| 66 | + # cache: 'pip' # we can have this back if we add pyproject.toml |
| 67 | + - name: Install dependencies |
| 68 | + run: | |
| 69 | + python -m pip install --upgrade pip |
| 70 | + pip install -e '.[testing]' --config-settings editable_mode=strict |
| 71 | + pip install "${{ matrix.django }}" |
| 72 | + pip install "${{ matrix.wagtail }}" |
| 73 | + ${{ matrix.install_extras }} |
| 74 | + - name: Test |
| 75 | + run: | |
| 76 | + coverage run --parallel-mode --source wagtail runtests.py ${{ matrix.parallel }} |
| 77 | + env: |
| 78 | + DATABASE_ENGINE: django.db.backends.postgresql |
| 79 | + DATABASE_HOST: localhost |
| 80 | + DATABASE_USER: postgres |
| 81 | + DATABASE_PASSWORD: postgres |
| 82 | + - name: Upload coverage data |
| 83 | + uses: actions/upload-artifact@v4 |
| 84 | + with: |
| 85 | + name: coverage-data-${{ github.job }}-${{ strategy.job-index }} |
| 86 | + path: .coverage.* |
| 87 | + include-hidden-files: true |
0 commit comments