Skip to content

Commit 5f71c78

Browse files
committed
Improve uv caching in CI
1 parent 229101d commit 5f71c78

File tree

5 files changed

+34
-13
lines changed

5 files changed

+34
-13
lines changed

.github/workflows/changelog.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ jobs:
3535

3636
- name: Install uv
3737
uses: astral-sh/setup-uv@v7
38+
with:
39+
enable-cache: 'false'
3840

3941
- name: Install dependencies
4042
run: |
41-
export UV=$(which uv)
42-
make venv-install
43+
uv sync --frozen --group dev
4344
4445
- name: Check changelog entry exists
4546
run: |

.github/workflows/codeql-analysis.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,22 @@ jobs:
4848
4949
- name: Install uv
5050
uses: astral-sh/setup-uv@v7
51+
with:
52+
enable-cache: 'false'
53+
54+
# astral-sh/setup-uv cannot restore multiple keys
55+
- name: Cache uv
56+
uses: actions/cache/restore@v5
57+
with:
58+
path: ~/.cache/uv
59+
key: ${{ runner.os }}-codeql-${{ hashFiles('uv.lock') }}
60+
restore-keys: |
61+
${{ runner.os }}-codeql-${{ hashFiles('uv.lock') }}
62+
${{ runner.os }}-codeql-
5163
5264
- name: Install dependencies
5365
run: |
54-
export UV=$(which uv)
55-
make venv-install
66+
uv sync --frozen --extra "server" --extra "scheduler" --extra "worker" --group dev
5667
5768
- name: Run mypy
5869
run: uv run mypy syncmaster

.github/workflows/release.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,8 @@ jobs:
3838

3939
- name: Install uv
4040
uses: astral-sh/setup-uv@v7
41-
42-
- name: Install dependencies
43-
run: |
44-
export UV=$(which uv)
45-
make venv-install
41+
with:
42+
enable-cache: 'false'
4643

4744
- name: Generate OpenAPI Schema
4845
run: |

.github/workflows/tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,12 @@ jobs:
114114

115115
- name: Install uv
116116
uses: astral-sh/setup-uv@v7
117+
with:
118+
enable-cache: 'false'
117119

118120
- name: Install dependencies
119121
run: |
120-
export UV=$(which uv)
121-
make venv-install
122+
uv sync --frozen --group test
122123
123124
- name: Download all coverage reports
124125
uses: actions/download-artifact@v7

.github/workflows/unit-test.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,22 @@ jobs:
4343
4444
- name: Install uv
4545
uses: astral-sh/setup-uv@v7
46+
with:
47+
enable-cache: 'false'
48+
49+
# astral-sh/setup-uv cannot restore multiple keys
50+
- name: Cache uv
51+
uses: actions/cache/restore@v5
52+
with:
53+
path: ~/.cache/uv
54+
key: ${{ runner.os }}-test-${{ hashFiles('uv.lock') }}
55+
restore-keys: |
56+
${{ runner.os }}-test-${{ hashFiles('uv.lock') }}
57+
${{ runner.os }}-test-
4658
4759
- name: Install dependencies
4860
run: |
49-
export UV=$(which uv)
50-
make venv-install
61+
uv sync --frozen --extra "server" --group test
5162
5263
- name: Wait for db
5364
run: |

0 commit comments

Comments
 (0)