Skip to content

Commit bb6a880

Browse files
committed
Improve CI action performance by using uv + cache
1 parent 5f744dd commit bb6a880

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,24 @@ jobs:
3838
uses: actions/setup-python@v6
3939
with:
4040
python-version: ${{ matrix.python-version }}
41-
- name: Install dependencies
41+
- name: Install uv
42+
uses: astral-sh/setup-uv@v4
43+
with:
44+
enable-cache: true
45+
cache-dependency-glob: "pyproject.toml"
46+
- name: Cache hatch environments
47+
uses: actions/cache@v4
48+
with:
49+
path: |
50+
~/.local/share/hatch
51+
~/.cache/hatch
52+
key: hatch-${{ runner.os }}-py${{ matrix.python-version }}-django${{ matrix.django-version }}-${{ hashFiles('pyproject.toml') }}
53+
restore-keys: |
54+
hatch-${{ runner.os }}-py${{ matrix.python-version }}-django${{ matrix.django-version }}-
55+
hatch-${{ runner.os }}-py${{ matrix.python-version }}-
56+
- name: Install hatch with uv
4257
run: |
43-
python -m pip install --upgrade hatch
58+
uv tool install hatch
4459
- name: Run tests for Python ${{ matrix.python-version }} and Django ${{ matrix.django-version }} on ${{ matrix.os }} with coverage report
4560
run: |
4661
hatch run test.py${{ matrix.python-version }}-${{ matrix.django-version }}:cov

0 commit comments

Comments
 (0)