4141
4242 ci :
4343 runs-on : ubuntu-latest
44- name : Test py ${{ matrix.python-version }}/dj${{matrix.django-version }}
44+ name : Test ${{ matrix.cfg }}
4545 services :
4646 redis :
4747 image : redis
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
7575 steps :
7676 - name : Checkout code
7777 uses : actions/checkout@v4
78- - name : Set up Python ${{ matrix.python-version }}
78+ - name : Set up Python
7979 uses : actions/setup-python@v5
8080 with :
8181 python-version : ${{ matrix.python-version }}
@@ -87,40 +87,39 @@ jobs:
8787 path : |
8888 .cache-uv/
8989 .venv/
90- key : ${{ matrix.python-version }}-${{matrix.django-version }}-${{ hashFiles('pyproject.toml') }}-venv
90+ key : ${{ matrix.cfg }}-${{ hashFiles('pyproject.toml') }}-venv
9191
9292 - uses : yezz123/setup-uv@v4
93- with :
94- python : ${{ matrix.python-version }}
9593
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
94+ - name : Install the latest version of uv
95+ uses : astral-sh/setup-uv@v5
10896 with :
109- path : |
110- .cache-uv/
111- .venv/
112- key : ${{ matrix.python-version }}-${{matrix.django-version}}-${{ hashFiles('pyproject.toml') }}-venv
97+ version : " latest"
98+ enable-cache : true
99+ cache-dependency-glob : |
100+ pyproject.toml
101+ uv.lock
102+ cache-suffix : ${{ matrix.cfg }}
103+ github-token : ${{ secrets.GITHUB_TOKEN }}
104+
105+ - name : Install tox
106+ run : uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv --with tox-gh-actions
107+
108+ - name : Setup test suite
109+ run : tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.cfg }}
110+
111+ - name : Run test suite ${{ matrix.cfg }}
112+ run : tox -e ${{ matrix.cfg }}
113113
114114 - name : Upload pytest test results
115115 uses : actions/upload-artifact@v4
116116 with :
117- name : pytest-results-${{ matrix.python-version }}-${{matrix.django-version }}
118- path : junit-${{ matrix.python-version }}-${{matrix.django-version }}.xml
117+ name : pytest-results-${{ matrix.cfg }}
118+ path : junit-${{ matrix.cfg }}.xml
119119 if : ${{ always() }}
120120
121121 - name : Upload coverage to Codecov
122122 uses : codecov/codecov-action@v5
123- if : matrix.python-version == 3.12
124123 continue-on-error : true
125124 with :
126125 env_vars : OS,PYTHON
0 commit comments