|
| 1 | +--- |
| 2 | +name: build |
| 3 | + |
| 4 | +# yamllint disable-line rule:truthy |
| 5 | +on: [push, pull_request] |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + name: >- |
| 10 | + build (Python ${{ matrix.python-version }}, |
| 11 | + Django ${{ matrix.django-version }}, |
| 12 | + ${{ matrix.database }}) |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + python-version: ['3.12', '3.13', '3.14'] |
| 19 | + django-version: ['5.2', '6.0', 'dev'] |
| 20 | + database: ['mysql', 'postgres'] |
| 21 | + |
| 22 | + services: |
| 23 | + mysql: |
| 24 | + image: mysql:latest |
| 25 | + env: |
| 26 | + MYSQL_DATABASE: mysql |
| 27 | + # pragma: allowlist secret |
| 28 | + MYSQL_ROOT_PASSWORD: root |
| 29 | + ports: |
| 30 | + - 3306:3306 |
| 31 | + options: >- |
| 32 | + --health-cmd="mysqladmin ping" |
| 33 | + --health-interval=10s |
| 34 | + --health-timeout=5s |
| 35 | + --health-retries=3 |
| 36 | +
|
| 37 | + postgres: |
| 38 | + image: postgres:latest |
| 39 | + env: |
| 40 | + POSTGRES_DB: test_db |
| 41 | + # pragma: allowlist secret |
| 42 | + POSTGRES_PASSWORD: postgres |
| 43 | + ports: |
| 44 | + - 5432:5432 |
| 45 | + options: >- |
| 46 | + --health-cmd pg_isready |
| 47 | + --health-interval 10s |
| 48 | + --health-timeout 5s |
| 49 | + --health-retries 5 |
| 50 | +
|
| 51 | + steps: |
| 52 | + - name: Install pycups and words dependency |
| 53 | + run: | |
| 54 | + sudo sed -i 's/azure\.//' /etc/apt/sources.list |
| 55 | + sudo apt-get -y update |
| 56 | + sudo apt-get install libcups2-dev wamerican |
| 57 | +
|
| 58 | + - uses: actions/checkout@v4 |
| 59 | + |
| 60 | + - name: Install uv and set the python version |
| 61 | + uses: astral-sh/setup-uv@v6 |
| 62 | + with: |
| 63 | + python-version: ${{ matrix.python-version }} |
| 64 | + enable-cache: true |
| 65 | + |
| 66 | + - name: Install dependencies |
| 67 | + run: | |
| 68 | + uv sync --dev --no-sources |
| 69 | + if [ "${{ matrix.django-version }}" = "dev" ]; then |
| 70 | + uv pip install \ |
| 71 | + "django @ git+https://github.com/django/django.git@main" |
| 72 | + else |
| 73 | + uv pip install \ |
| 74 | + "django~=${{ matrix.django-version }}.0" |
| 75 | + fi |
| 76 | +
|
| 77 | + - name: Run tests |
| 78 | + env: |
| 79 | + SELECTED_DATABASE: ${{ matrix.database }} |
| 80 | + run: | |
| 81 | + uv run --dev --no-sources runtests.py |
0 commit comments