Skip to content

Commit 16c9994

Browse files
committed
refactor: optimize and standardize caching strategy in CI workflow
- Add cache-dependency-glob: 'uv.lock' to all uv setup actions for consistent cache keys - Remove redundant Python cache from lint job (uv's built-in cache is sufficient) - Remove duplicate Codecov upload from coverage-report job - Standardize caching across all jobs for better performance and consistency Benefits: - Faster CI runs with improved cache hit rates - Consistent caching strategy across all jobs - Reduced workflow complexity and duplication
1 parent 4c86956 commit 16c9994

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,9 @@ jobs:
2424
uses: astral-sh/setup-uv@v6
2525
with:
2626
enable-cache: true
27-
cache-dependency-glob: "uv.lock" # More specific cache key
27+
cache-dependency-glob: "uv.lock"
2828

29-
# Cache Python installations
30-
- name: Cache Python
31-
uses: actions/cache@v4
32-
with:
33-
path: ~/.cache/uv
34-
key: python-${{ env.PRIMARY_PYTHON_VERSION }}-${{ runner.os }}
35-
36-
# Cache pre-commit hooks
29+
# Cache pre-commit hooks (only needed for lint job)
3730
- name: Cache pre-commit
3831
uses: actions/cache@v4
3932
with:
@@ -65,6 +58,7 @@ jobs:
6558
uses: astral-sh/setup-uv@v6
6659
with:
6760
enable-cache: true
61+
cache-dependency-glob: "uv.lock"
6862

6963
- name: Set up Python ${{ env.PRIMARY_PYTHON_VERSION }}
7064
run: uv python install ${{ env.PRIMARY_PYTHON_VERSION }}
@@ -90,6 +84,7 @@ jobs:
9084
uses: astral-sh/setup-uv@v6
9185
with:
9286
enable-cache: true
87+
cache-dependency-glob: "uv.lock"
9388

9489
- name: Set up Python ${{ env.PRIMARY_PYTHON_VERSION }}
9590
run: uv python install ${{ env.PRIMARY_PYTHON_VERSION }}
@@ -149,6 +144,7 @@ jobs:
149144
uses: astral-sh/setup-uv@v6
150145
with:
151146
enable-cache: true
147+
cache-dependency-glob: "uv.lock"
152148

153149
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
154150
run: uv python install ${{ matrix.python-version }}
@@ -210,6 +206,7 @@ jobs:
210206
uses: astral-sh/setup-uv@v6
211207
with:
212208
enable-cache: true
209+
cache-dependency-glob: "uv.lock"
213210

214211
- name: Set up Python ${{ env.PRIMARY_PYTHON_VERSION }}
215212
run: uv python install ${{ env.PRIMARY_PYTHON_VERSION }}
@@ -273,14 +270,6 @@ jobs:
273270
coverage.xml
274271
htmlcov/
275272
276-
- name: Upload to Codecov
277-
uses: codecov/codecov-action@v5
278-
with:
279-
token: ${{ secrets.CODECOV_TOKEN }}
280-
slug: codcod/smppai
281-
file: ./coverage.xml
282-
fail_ci_if_error: false
283-
284273
build:
285274
runs-on: ubuntu-latest
286275
name: Build package
@@ -293,6 +282,7 @@ jobs:
293282
uses: astral-sh/setup-uv@v6
294283
with:
295284
enable-cache: true
285+
cache-dependency-glob: "uv.lock"
296286

297287
- name: Set up Python ${{ env.PRIMARY_PYTHON_VERSION }}
298288
run: uv python install ${{ env.PRIMARY_PYTHON_VERSION }}

0 commit comments

Comments
 (0)