6161 strategy :
6262 max-parallel : 1
6363 matrix :
64- python-version : [ "3.11 ", "3.12", "3.13 " ]
65- django-version : [ "4.2", "5.1" ]
64+ cfg : [ "d52-py310 ", "d42-py39 " ]
65+
6666 fail-fast : true
6767 needs : [ changes ]
6868 if : needs.changes.outputs.run_tests || needs.changes.outputs.lint
7272 DB_PORT : 15432
7373 DB_USER : " postgres"
7474 DB_PASSWORD : " postgres"
75+ DATABASE_URL : " postgres://postgres:postgres@localhost:5432/celery_model"
7576 steps :
7677 - name : Checkout code
7778 uses : actions/checkout@v4
@@ -87,40 +88,39 @@ jobs:
8788 path : |
8889 .cache-uv/
8990 .venv/
90- key : ${{ matrix.python-version }}-${{matrix.django-version }}-${{ hashFiles('pyproject.toml') }}-venv
91+ key : ${{ matrix.cfg }}-${{ hashFiles('pyproject.toml') }}-venv
9192
9293 - uses : yezz123/setup-uv@v4
93- with :
94- python : ${{ matrix.python-version }}
9594
96- - name : Test
97- # if: needs.changes.outputs.run_tests
98- run : |
99- uv add "django==${{ matrix.django-version }}.*"
100- uv run --cache-dir .cache-uv/ \
101- python -m pytest tests/ \
102- --junit-xml junit-${{ matrix.python-version }}-${{matrix.django-version}}.xml \
103- --cov --cov-report xml
104- - name : Cache venv
105- if : steps.cache-venv-restore.outputs.cache-hit != 'true'
106- id : cache-venv-save
107- uses : actions/cache/save@v4
95+ - name : Install the latest version of uv
96+ uses : astral-sh/setup-uv@v5
10897 with :
109- path : |
110- .cache-uv/
111- .venv/
112- key : ${{ matrix.python-version }}-${{matrix.django-version}}-${{ hashFiles('pyproject.toml') }}-venv
98+ version : " latest"
99+ enable-cache : true
100+ cache-dependency-glob : |
101+ pyproject.toml
102+ uv.lock
103+ cache-suffix : ${{ matrix.cfg }}
104+ github-token : ${{ secrets.GITHUB_TOKEN }}
105+
106+ - name : Install tox
107+ run : uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv --with tox-gh-actions
108+
109+ - name : Setup test suite
110+ run : tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.cfg }}
111+
112+ - name : Run test suite ${{ matrix.cfg }}
113+ run : tox -e ${{ matrix.cfg }}
113114
114115 - name : Upload pytest test results
115116 uses : actions/upload-artifact@v4
116117 with :
117- name : pytest-results-${{ matrix.python-version }}-${{matrix.django-version }}
118- path : junit-${{ matrix.python-version }}-${{matrix.django-version }}.xml
118+ name : pytest-results-${{ matrix.cfg }}
119+ path : junit-${{ matrix.cfg }}.xml
119120 if : ${{ always() }}
120121
121122 - name : Upload coverage to Codecov
122123 uses : codecov/codecov-action@v5
123- if : matrix.python-version == 3.12
124124 continue-on-error : true
125125 with :
126126 env_vars : OS,PYTHON
0 commit comments