Files
fastapi/.github/workflows/warm-cache.yml
T

50 lines
1.5 KiB
YAML

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
paths:
- pyproject.toml
- uv.lock
- .python-version
- .github/workflows/warm-cache.yml
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
permissions: {}
jobs:
warm-cache:
if: github.repository_owner == 'fastapi'
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.30"
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