From 99aa459badfd6c7dfaac423a8dd76219bac373ad Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman Date: Thu, 2 Apr 2026 23:20:11 +0000 Subject: [PATCH] chore(ci): consolidate uv cache key across all workflow jobs Replace per-job cache key prefixes (uv-lint-, uv-typecheck-, uv-security-, uv-quality-, uv-tests-, uv-coverage-) with a single shared key uv-${{ hashFiles('pyproject.toml') }} across all jobs in ci.yml. Also add a missing uv cache step to the build job and add uv caching to nightly-quality.yml, which previously had no cache at all. All jobs now share the same cache entry when pyproject.toml is unchanged, eliminating redundant package downloads and reducing CI wall-clock time. ISSUES CLOSED: #1535 --- .forgejo/workflows/ci.yml | 40 +++++++++++++++----------- .forgejo/workflows/nightly-quality.yml | 8 ++++++ 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 712a8231..442a389c 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -31,9 +31,9 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/uv - key: uv-lint-${{ hashFiles('pyproject.toml') }} + key: uv-${{ hashFiles('pyproject.toml') }} restore-keys: | - uv-lint- + uv- - name: Run lint via nox run: | @@ -66,9 +66,9 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/uv - key: uv-typecheck-${{ hashFiles('pyproject.toml') }} + key: uv-${{ hashFiles('pyproject.toml') }} restore-keys: | - uv-typecheck- + uv- - name: Run typecheck via nox run: | @@ -95,9 +95,9 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/uv - key: uv-security-${{ hashFiles('pyproject.toml') }} + key: uv-${{ hashFiles('pyproject.toml') }} restore-keys: | - uv-security- + uv- - name: Run security scan via nox run: | @@ -130,9 +130,9 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/uv - key: uv-quality-${{ hashFiles('pyproject.toml') }} + key: uv-${{ hashFiles('pyproject.toml') }} restore-keys: | - uv-quality- + uv- - name: Run complexity check via nox run: | @@ -172,9 +172,9 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/uv - key: uv-tests-${{ hashFiles('pyproject.toml') }} + key: uv-${{ hashFiles('pyproject.toml') }} restore-keys: | - uv-tests- + uv- - name: Run unit tests via nox run: | @@ -214,9 +214,9 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/uv - key: uv-tests-${{ hashFiles('pyproject.toml') }} + key: uv-${{ hashFiles('pyproject.toml') }} restore-keys: | - uv-tests- + uv- - name: Run integration tests via nox run: | @@ -251,9 +251,9 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/uv - key: uv-tests-${{ hashFiles('pyproject.toml') }} + key: uv-${{ hashFiles('pyproject.toml') }} restore-keys: | - uv-tests- + uv- - name: Run E2E tests via nox run: | @@ -284,9 +284,9 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/uv - key: uv-coverage-${{ hashFiles('pyproject.toml') }} + key: uv-${{ hashFiles('pyproject.toml') }} restore-keys: | - uv-coverage- + uv- - name: Run coverage report via nox (fail-under 97%) id: coverage @@ -460,6 +460,14 @@ jobs: run: | pip install -q uv==${{ env.UV_VERSION }} nox + - name: Cache uv packages + uses: actions/cache@v3 + with: + path: ~/.cache/uv + key: uv-${{ hashFiles('pyproject.toml') }} + restore-keys: | + uv- + - name: Build wheel via nox run: | nox -s build diff --git a/.forgejo/workflows/nightly-quality.yml b/.forgejo/workflows/nightly-quality.yml index 42ec1a04..b5bb0514 100644 --- a/.forgejo/workflows/nightly-quality.yml +++ b/.forgejo/workflows/nightly-quality.yml @@ -28,6 +28,14 @@ jobs: run: | pip install -q uv==${{ env.UV_VERSION }} + - name: Cache uv packages + uses: actions/cache@v3 + with: + path: ~/.cache/uv + key: uv-${{ hashFiles('pyproject.toml') }} + restore-keys: | + uv- + - name: Install all dependencies run: | uv pip install --system -e ".[dev,tests]"