From a6d35b905248eed0941bb85a49f180eaa4e89afb Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Thu, 6 Aug 2026 20:14:12 +0200 Subject: [PATCH 01/15] Optimize cache for `pre-commit` workflow --- .github/workflows/pre-commit.yml | 5 ++++ .github/workflows/warm-cache.yml | 43 ++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/warm-cache.yml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index e119bbb1424c4..4aa780332126d 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -7,6 +7,7 @@ permissions: {} env: # Forks and Dependabot don't have access to secrets HAS_SECRETS: ${{ secrets.PRE_COMMIT != '' }} + UV_NO_SYNC: true jobs: pre-commit: @@ -48,6 +49,10 @@ jobs: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.18" + cache-suffix: dev-all + # Cache written by workflow triggered by pull_request is PR-scoped and almost useless. + # Disable saving here, it will be populated by `warm-cache.yml`. + save-cache: false cache-dependency-glob: | pyproject.toml uv.lock diff --git a/.github/workflows/warm-cache.yml b/.github/workflows/warm-cache.yml new file mode 100644 index 0000000000000..bf3a38ba42253 --- /dev/null +++ b/.github/workflows/warm-cache.yml @@ -0,0 +1,43 @@ +name: Warm Cache + +# Populates the `dev-all` uv cache at default-branch scope so that it could be used by +# `pre-commit.yml` (it has `pull_request` trigger and can't write cache available across PRs) +# and some others that use subset of dev dependencies. + +on: + push: + branches: + - master + schedule: + - cron: "0 4 * * *" + workflow_dispatch: + +permissions: {} + +jobs: + warm-cache: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Set up Python + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version-file: ".python-version" + - name: Setup uv + id: setup-uv + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + with: + # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. + # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 + version: "0.11.18" + enable-cache: true + cache-suffix: dev-all + cache-dependency-glob: | + pyproject.toml + uv.lock + - name: Populate the cache + if: steps.setup-uv.outputs.cache-hit != 'true' + run: uv sync --locked --extra all From 546c1d0865b6cb58a2c650f24b17f289f67d7a15 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Thu, 6 Aug 2026 20:23:02 +0200 Subject: [PATCH 02/15] Optimize cache for `test` workflow --- .github/workflows/test.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1a8a7868f2223..49fd730acb3c0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -121,6 +121,7 @@ jobs: # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.18" enable-cache: true + cache-suffix: tests cache-dependency-glob: | pyproject.toml uv.lock @@ -185,6 +186,7 @@ jobs: # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.18" enable-cache: true + cache-suffix: tests cache-dependency-glob: | pyproject.toml uv.lock @@ -255,6 +257,13 @@ jobs: # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.18" enable-cache: true + cache-suffix: tests + # This job checks out into `base/`, so the glob must point there. + cache-dependency-glob: | + base/pyproject.toml + base/uv.lock + # Only ever runs on pull requests, so anything it saved would be PR-scoped and useless. + save-cache: false - name: Run the changed tests against the base code if: steps.changed-tests.outputs.found == 'true' working-directory: base @@ -296,6 +305,7 @@ jobs: # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.18" enable-cache: true + cache-suffix: tests cache-dependency-glob: | pyproject.toml uv.lock From 64a149949380dc3ab0de3b35ae1f86705ef593e9 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Thu, 6 Aug 2026 20:25:21 +0200 Subject: [PATCH 03/15] Optimize cache for `build-docs` and `deploy-docs` workflows --- .github/workflows/build-docs.yml | 5 +++++ .github/workflows/deploy-docs.yml | 3 +++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 599406e964505..4a652fceafa45 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -6,6 +6,9 @@ on: pull_request: permissions: {} +env: + UV_NO_SYNC: true + jobs: changes: runs-on: ubuntu-latest @@ -57,6 +60,7 @@ jobs: # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.18" enable-cache: true + cache-suffix: docs cache-dependency-glob: | pyproject.toml uv.lock @@ -96,6 +100,7 @@ jobs: # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.18" enable-cache: true + cache-suffix: docs cache-dependency-glob: | pyproject.toml uv.lock diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index dcc2033c42b80..28898c3ebeae9 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -8,6 +8,9 @@ on: permissions: {} +env: + UV_NO_SYNC: true + jobs: deploy-docs: runs-on: ubuntu-latest From 5d9a14e7be8391a63eef81f84cf1eee48842da8e Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Thu, 6 Aug 2026 20:47:10 +0200 Subject: [PATCH 04/15] Optimize cache for 3 workflows by reading `dev-all` cache --- .github/workflows/bump-pre-commit-hooks.yml | 8 ++++++++ .github/workflows/create-draft-release.yml | 11 +++++++++++ .github/workflows/prepare-release.yml | 11 +++++++++++ 3 files changed, 30 insertions(+) diff --git a/.github/workflows/bump-pre-commit-hooks.yml b/.github/workflows/bump-pre-commit-hooks.yml index 0c7eb1ae4847e..83ce498a5794f 100644 --- a/.github/workflows/bump-pre-commit-hooks.yml +++ b/.github/workflows/bump-pre-commit-hooks.yml @@ -7,6 +7,9 @@ on: permissions: {} +env: + UV_NO_SYNC: true + jobs: bump-pre-commit-hooks: if: github.repository_owner == 'fastapi' @@ -34,6 +37,11 @@ jobs: cache-dependency-glob: | pyproject.toml uv.lock + cache-suffix: dev-all + # Disable saving cache as we install narrower set of dependencies than dev-all has. + save-cache: false + - name: Install dependencies + run: uv sync --locked --group dev - name: Bump pre-commit hooks run: uv run prek auto-update --freeze --cooldown-days 7 - name: Create pull request diff --git a/.github/workflows/create-draft-release.yml b/.github/workflows/create-draft-release.yml index 560ebd5ce4ace..6025a41ce0097 100644 --- a/.github/workflows/create-draft-release.yml +++ b/.github/workflows/create-draft-release.yml @@ -7,6 +7,9 @@ on: permissions: {} +env: + UV_NO_SYNC: true + jobs: create-draft-release: if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release') @@ -36,6 +39,14 @@ jobs: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.18" + cache-dependency-glob: | + pyproject.toml + uv.lock + cache-suffix: dev-all + # Disable saving cache as we install narrower set of dependencies than dev-all has. + save-cache: false + - name: Install dependencies + run: uv sync --locked --group dev - name: Extract release details id: release-details run: | diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 2dd7cfb0a4485..9417d247e4835 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -18,6 +18,9 @@ on: permissions: {} +env: + UV_NO_SYNC: true + jobs: prepare-release: runs-on: ubuntu-latest @@ -48,6 +51,14 @@ jobs: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.18" + cache-dependency-glob: | + pyproject.toml + uv.lock + cache-suffix: dev-all + # Disable saving cache as we install narrower set of dependencies than dev-all has. + save-cache: false + - name: Install dependencies + run: uv sync --locked --group dev - name: Prepare release env: PREPARE_RELEASE_BUMP: ${{ inputs.bump }} From 938d2e695f5d7deb89c14a8b98e7124e58311d52 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Thu, 6 Aug 2026 20:48:39 +0200 Subject: [PATCH 05/15] Optimize cache for GH-actions-related workflows --- .github/workflows/label-approved.yml | 4 ++++ .github/workflows/notify-translations.yml | 4 ++++ .github/workflows/smokeshow.yml | 4 ++++ .github/workflows/sponsors.yml | 4 ++++ .github/workflows/topic-repos.yml | 4 ++++ .github/workflows/translate.yml | 5 +++++ 6 files changed, 25 insertions(+) diff --git a/.github/workflows/label-approved.yml b/.github/workflows/label-approved.yml index ce518a588fb50..c73fe1d4b3907 100644 --- a/.github/workflows/label-approved.yml +++ b/.github/workflows/label-approved.yml @@ -7,6 +7,9 @@ on: permissions: {} +env: + UV_NO_SYNC: true + jobs: label-approved: if: github.repository_owner == 'fastapi' @@ -33,6 +36,7 @@ jobs: # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.18" enable-cache: true + cache-suffix: github-actions cache-dependency-glob: | pyproject.toml uv.lock diff --git a/.github/workflows/notify-translations.yml b/.github/workflows/notify-translations.yml index 6703d16c3264f..45cf89a847044 100644 --- a/.github/workflows/notify-translations.yml +++ b/.github/workflows/notify-translations.yml @@ -19,6 +19,9 @@ on: permissions: {} +env: + UV_NO_SYNC: true + jobs: job: runs-on: ubuntu-latest @@ -45,6 +48,7 @@ jobs: # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.18" enable-cache: true + cache-suffix: github-actions cache-dependency-glob: | pyproject.toml uv.lock diff --git a/.github/workflows/smokeshow.yml b/.github/workflows/smokeshow.yml index 68c9676f2cdbd..9a31d96c123df 100644 --- a/.github/workflows/smokeshow.yml +++ b/.github/workflows/smokeshow.yml @@ -7,6 +7,9 @@ on: permissions: {} +env: + UV_NO_SYNC: true + jobs: smokeshow: runs-on: ubuntu-latest @@ -31,6 +34,7 @@ jobs: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.18" + cache-suffix: github-actions cache-dependency-glob: | pyproject.toml uv.lock diff --git a/.github/workflows/sponsors.yml b/.github/workflows/sponsors.yml index 37b01b052f650..745f0e9c9cc2e 100644 --- a/.github/workflows/sponsors.yml +++ b/.github/workflows/sponsors.yml @@ -12,6 +12,9 @@ on: permissions: {} +env: + UV_NO_SYNC: true + jobs: job: if: github.repository_owner == 'fastapi' @@ -38,6 +41,7 @@ jobs: # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.18" enable-cache: true + cache-suffix: github-actions cache-dependency-glob: | pyproject.toml uv.lock diff --git a/.github/workflows/topic-repos.yml b/.github/workflows/topic-repos.yml index f315626854eaf..8ba6abc8d2757 100644 --- a/.github/workflows/topic-repos.yml +++ b/.github/workflows/topic-repos.yml @@ -7,6 +7,9 @@ on: permissions: {} +env: + UV_NO_SYNC: true + jobs: topic-repos: if: github.repository_owner == 'fastapi' @@ -33,6 +36,7 @@ jobs: # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.18" enable-cache: true + cache-suffix: github-actions cache-dependency-glob: | pyproject.toml uv.lock diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index cb738f3a342fb..3308bc1574fbf 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -43,6 +43,9 @@ on: permissions: {} +env: + UV_NO_SYNC: true + jobs: langs: runs-on: ubuntu-latest @@ -63,6 +66,7 @@ jobs: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.18" + cache-suffix: github-actions cache-dependency-glob: | pyproject.toml uv.lock @@ -106,6 +110,7 @@ jobs: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.18" + cache-suffix: github-actions cache-dependency-glob: | pyproject.toml uv.lock From ae8a2a7cd0fbebf0069c8bef3da57115d85715e5 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Thu, 6 Aug 2026 21:02:58 +0200 Subject: [PATCH 06/15] Add `UV_NO_SYNC: true` in `publish` workflow --- .github/workflows/publish.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index de57ce5fd2d82..bbada571cbfc9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,6 +5,9 @@ on: types: - published +env: + UV_NO_SYNC: true + permissions: {} jobs: From 8806a3bb6133d5fb0b25801c33d250728c148f50 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Thu, 6 Aug 2026 21:50:38 +0200 Subject: [PATCH 07/15] Bump uv version in workflows --- .github/workflows/build-docs.yml | 4 ++-- .github/workflows/bump-pre-commit-hooks.yml | 2 +- .github/workflows/create-draft-release.yml | 2 +- .github/workflows/deploy-docs.yml | 2 +- .github/workflows/label-approved.yml | 2 +- .github/workflows/notify-translations.yml | 2 +- .github/workflows/pre-commit.yml | 2 +- .github/workflows/prepare-release.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/smokeshow.yml | 2 +- .github/workflows/sponsors.yml | 2 +- .github/workflows/test.yml | 8 ++++---- .github/workflows/topic-repos.yml | 2 +- .github/workflows/translate.yml | 4 ++-- .github/workflows/warm-cache.yml | 2 +- 15 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 4a652fceafa45..7b0dce83c878c 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -58,7 +58,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" enable-cache: true cache-suffix: docs cache-dependency-glob: | @@ -98,7 +98,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" enable-cache: true cache-suffix: docs cache-dependency-glob: | diff --git a/.github/workflows/bump-pre-commit-hooks.yml b/.github/workflows/bump-pre-commit-hooks.yml index 83ce498a5794f..b43d9dcfbed15 100644 --- a/.github/workflows/bump-pre-commit-hooks.yml +++ b/.github/workflows/bump-pre-commit-hooks.yml @@ -33,7 +33,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" cache-dependency-glob: | pyproject.toml uv.lock diff --git a/.github/workflows/create-draft-release.yml b/.github/workflows/create-draft-release.yml index 6025a41ce0097..ba9966b63bb5e 100644 --- a/.github/workflows/create-draft-release.yml +++ b/.github/workflows/create-draft-release.yml @@ -38,7 +38,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" cache-dependency-glob: | pyproject.toml uv.lock diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 28898c3ebeae9..6c2c1e0c5b3e9 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -37,7 +37,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" enable-cache: false - name: Install GitHub Actions dependencies run: uv sync --locked --no-dev --group github-actions diff --git a/.github/workflows/label-approved.yml b/.github/workflows/label-approved.yml index c73fe1d4b3907..0e225a9b520b6 100644 --- a/.github/workflows/label-approved.yml +++ b/.github/workflows/label-approved.yml @@ -34,7 +34,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" enable-cache: true cache-suffix: github-actions cache-dependency-glob: | diff --git a/.github/workflows/notify-translations.yml b/.github/workflows/notify-translations.yml index 45cf89a847044..0760569300a80 100644 --- a/.github/workflows/notify-translations.yml +++ b/.github/workflows/notify-translations.yml @@ -46,7 +46,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" enable-cache: true cache-suffix: github-actions cache-dependency-glob: | diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 4aa780332126d..f2669b07d8122 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -48,7 +48,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" cache-suffix: dev-all # Cache written by workflow triggered by pull_request is PR-scoped and almost useless. # Disable saving here, it will be populated by `warm-cache.yml`. diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 9417d247e4835..5e608fa289f78 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -50,7 +50,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" cache-dependency-glob: | pyproject.toml uv.lock diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bbada571cbfc9..6f2ab5a5c0484 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,7 +34,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" enable-cache: "false" - name: Build distribution run: uv build diff --git a/.github/workflows/smokeshow.yml b/.github/workflows/smokeshow.yml index 9a31d96c123df..6cf16f6259106 100644 --- a/.github/workflows/smokeshow.yml +++ b/.github/workflows/smokeshow.yml @@ -33,7 +33,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" cache-suffix: github-actions cache-dependency-glob: | pyproject.toml diff --git a/.github/workflows/sponsors.yml b/.github/workflows/sponsors.yml index 745f0e9c9cc2e..796f611004b0c 100644 --- a/.github/workflows/sponsors.yml +++ b/.github/workflows/sponsors.yml @@ -39,7 +39,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" enable-cache: true cache-suffix: github-actions cache-dependency-glob: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 49fd730acb3c0..bffb125517207 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -119,7 +119,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" enable-cache: true cache-suffix: tests cache-dependency-glob: | @@ -184,7 +184,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" enable-cache: true cache-suffix: tests cache-dependency-glob: | @@ -255,7 +255,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" enable-cache: true cache-suffix: tests # This job checks out into `base/`, so the glob must point there. @@ -303,7 +303,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" enable-cache: true cache-suffix: tests cache-dependency-glob: | diff --git a/.github/workflows/topic-repos.yml b/.github/workflows/topic-repos.yml index 8ba6abc8d2757..28d986784e7a2 100644 --- a/.github/workflows/topic-repos.yml +++ b/.github/workflows/topic-repos.yml @@ -34,7 +34,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" enable-cache: true cache-suffix: github-actions cache-dependency-glob: | diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 3308bc1574fbf..385124a661eaa 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -65,7 +65,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" cache-suffix: github-actions cache-dependency-glob: | pyproject.toml @@ -109,7 +109,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" cache-suffix: github-actions cache-dependency-glob: | pyproject.toml diff --git a/.github/workflows/warm-cache.yml b/.github/workflows/warm-cache.yml index bf3a38ba42253..0f06ef41870cf 100644 --- a/.github/workflows/warm-cache.yml +++ b/.github/workflows/warm-cache.yml @@ -32,7 +32,7 @@ jobs: with: # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.18" + version: "0.11.30" enable-cache: true cache-suffix: dev-all cache-dependency-glob: | From fbaaa005c0ac0fe1caa394418acf685b3430465d Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Thu, 6 Aug 2026 23:25:07 +0200 Subject: [PATCH 08/15] Fix possible cache collision for highest and lowest uv resolutions --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bffb125517207..a095f515d53f7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -121,7 +121,7 @@ jobs: # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.30" enable-cache: true - cache-suffix: tests + cache-suffix: tests-${{ matrix.uv-resolution }} cache-dependency-glob: | pyproject.toml uv.lock @@ -186,7 +186,7 @@ jobs: # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.30" enable-cache: true - cache-suffix: tests + cache-suffix: tests-highest cache-dependency-glob: | pyproject.toml uv.lock @@ -257,7 +257,7 @@ jobs: # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.30" enable-cache: true - cache-suffix: tests + cache-suffix: tests-highest # This job checks out into `base/`, so the glob must point there. cache-dependency-glob: | base/pyproject.toml @@ -305,7 +305,7 @@ jobs: # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.30" enable-cache: true - cache-suffix: tests + cache-suffix: tests-highest cache-dependency-glob: | pyproject.toml uv.lock From ac671da87c954fc29274cdecec412bb2234dc095 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Thu, 6 Aug 2026 23:38:41 +0200 Subject: [PATCH 09/15] Add `.python-version` to `build-docs` workflow's filters --- .github/workflows/build-docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 7b0dce83c878c..f88a20061ad41 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -32,6 +32,7 @@ jobs: - README.md - docs/** - docs_src/** + - .python-version - pyproject.toml - uv.lock - .github/workflows/build-docs.yml From 472429bc757a39ed16ea2107cb9072ea473530e8 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Fri, 7 Aug 2026 10:23:56 +0200 Subject: [PATCH 10/15] Add path filters and if `org=fastapi` for `warm-cache` workflow --- .github/workflows/warm-cache.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/warm-cache.yml b/.github/workflows/warm-cache.yml index 0f06ef41870cf..35acdec33aee3 100644 --- a/.github/workflows/warm-cache.yml +++ b/.github/workflows/warm-cache.yml @@ -8,6 +8,11 @@ on: push: branches: - master + paths: + - pyproject.toml + - uv.lock + - .python-version + - .github/workflows/warm-cache.yml schedule: - cron: "0 4 * * *" workflow_dispatch: @@ -16,6 +21,7 @@ permissions: {} jobs: warm-cache: + if: github.repository_owner == 'fastapi' runs-on: ubuntu-latest timeout-minutes: 10 steps: From 79c30a9d8f68925c427d8c6f48f510137c55a193 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Fri, 7 Aug 2026 12:24:55 +0200 Subject: [PATCH 11/15] Allow `pre-commit` save cache --- .github/workflows/pre-commit.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index f2669b07d8122..e56bc6b224ef2 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -50,9 +50,6 @@ jobs: # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 version: "0.11.30" cache-suffix: dev-all - # Cache written by workflow triggered by pull_request is PR-scoped and almost useless. - # Disable saving here, it will be populated by `warm-cache.yml`. - save-cache: false cache-dependency-glob: | pyproject.toml uv.lock From 91444904f09689e4718888b7cd6b8e0f21128f97 Mon Sep 17 00:00:00 2001 From: Yurii Motov <109919500+YuriiMotov@users.noreply.github.com> Date: Fri, 7 Aug 2026 12:49:19 +0200 Subject: [PATCH 12/15] Specify `--group dev` explicitly in `warm-cache.yml` Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/warm-cache.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/warm-cache.yml b/.github/workflows/warm-cache.yml index 35acdec33aee3..2163e73432c4a 100644 --- a/.github/workflows/warm-cache.yml +++ b/.github/workflows/warm-cache.yml @@ -46,4 +46,4 @@ jobs: uv.lock - name: Populate the cache if: steps.setup-uv.outputs.cache-hit != 'true' - run: uv sync --locked --extra all + run: uv sync --locked --group dev --extra all From e803afcafd18ea70ae23237faec7646802f47626 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Wed, 26 Aug 2026 17:34:30 +0200 Subject: [PATCH 13/15] Revert "Add `.python-version` to `build-docs` workflow's filters" This reverts commit ac671da87c954fc29274cdecec412bb2234dc095. --- .github/workflows/build-docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index dd79c0cd84329..a83ca513ed47f 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -32,7 +32,6 @@ jobs: - README.md - docs/** - docs_src/** - - .python-version - pyproject.toml - uv.lock - .github/workflows/build-docs.yml From 4ebedc9a2a413cd74fff16f779a5cdd5acb746ed Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Wed, 26 Aug 2026 18:30:45 +0200 Subject: [PATCH 14/15] =?UTF-8?q?=F0=9F=91=B7=20Give=20`translate`=20workf?= =?UTF-8?q?low=20its=20own=20uv=20cache=20suffix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/translate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml index 136ccfa483659..0a0d773391c85 100644 --- a/.github/workflows/translate.yml +++ b/.github/workflows/translate.yml @@ -59,7 +59,7 @@ jobs: uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 with: version: "latest-known" - cache-suffix: github-actions + cache-suffix: translations cache-dependency-glob: | pyproject.toml uv.lock @@ -102,7 +102,7 @@ jobs: uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 with: version: "latest-known" - cache-suffix: github-actions + cache-suffix: translations cache-dependency-glob: | pyproject.toml uv.lock From da3bf339214f95978687be89013ebb734a2fe4f6 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Wed, 26 Aug 2026 18:44:18 +0200 Subject: [PATCH 15/15] Bump `astral-sh/setup-uv` to 10.0.1 in `warm-cache` --- .github/workflows/warm-cache.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/warm-cache.yml b/.github/workflows/warm-cache.yml index 2163e73432c4a..b682190c6a648 100644 --- a/.github/workflows/warm-cache.yml +++ b/.github/workflows/warm-cache.yml @@ -34,11 +34,9 @@ jobs: python-version-file: ".python-version" - name: Setup uv id: setup-uv - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 with: - # Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. - # See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 - version: "0.11.30" + version: "latest-known" enable-cache: true cache-suffix: dev-all cache-dependency-glob: |