| 1 |
name: tox |
| 2 |
|
| 3 |
on: [push, pull_request] |
| 4 |
|
| 5 |
jobs: |
| 6 |
tox: |
| 7 |
|
| 8 |
runs-on: ubuntu-latest |
| 9 |
|
| 10 |
strategy: |
| 11 |
matrix: |
| 12 |
python: ["3.9", "3.10", "3.11", "3.12"] |
| 13 |
django: ["42", "50", "51", "52"] |
| 14 |
suffix: [std, clocale, postgres] |
| 15 |
exclude: |
| 16 |
- python: "3.9" |
| 17 |
django: "50" |
| 18 |
- python: "3.9" |
| 19 |
django: "51" |
| 20 |
- python: "3.9" |
| 21 |
django: "52" |
| 22 |
|
| 23 |
services: |
| 24 |
postgres: |
| 25 |
image: postgres:latest |
| 26 |
env: |
| 27 |
POSTGRES_USER: postgres |
| 28 |
POSTGRES_PASSWORD: postgres |
| 29 |
POSTGRES_DB: django_webtest_tests_${{ matrix.python }} |
| 30 |
ports: |
| 31 |
# will assign a random free host port |
| 32 |
- 5432/tcp |
| 33 |
# needed because the postgres container does not provide a healthcheck |
| 34 |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 |
| 35 |
|
| 36 |
steps: |
| 37 |
- uses: actions/checkout@v4 |
| 38 |
- name: Setup Python |
| 39 |
uses: actions/setup-python@v5 |
| 40 |
with: |
| 41 |
python-version: ${{ matrix.python }} |
| 42 |
- name: Install Tox and any other packages |
| 43 |
run: pip install tox |
| 44 |
- name: Run Tox |
| 45 |
env: |
| 46 |
POSTGRES_HOST: localhost |
| 47 |
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} |
| 48 |
POSTGRES_USER: postgres |
| 49 |
POSTGRES_PASSWORD: postgres |
| 50 |
POSTGRES_DB: django_webtest_tests_${{ matrix.python }} |
| 51 |
run: tox -e py$(echo ${{ matrix.python }} | sed 's/\.//')-django${{ matrix.django }}-${{ matrix.suffix }} |