Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions .github/actions/pre-commit-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ description: Prepare pre-commit environment
runs:
using: composite
steps:
- name: Setup Python
id: python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.15'
- name: Identify cache environment
id: environment
shell: bash
# ImageOS identifies the runner OS release, without the image build date.
run: echo "os-release=${ImageOS:?}" >> "$GITHUB_OUTPUT"
# Save on default-branch pushes; other runs only restore shared caches.
# Keep installed environments, but exclude package-manager download/build caches.
# Select entries separately so tar cannot include excluded buckets via a parent.
Expand All @@ -25,9 +35,9 @@ runs:
!~/.cache/prek/cache/go
!~/.cache/prek/cache/cargo
~/.cache/kingfisher
key: ${{ runner.os }}-${{ runner.arch }}-prek-${{ hashFiles('.pre-commit-config.yaml') }}
key: ${{ runner.os }}-${{ runner.arch }}-${{ steps.environment.outputs.os-release }}-python-${{ steps.python.outputs.python-version }}-prek-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-prek-
${{ runner.os }}-${{ runner.arch }}-${{ steps.environment.outputs.os-release }}-python-${{ steps.python.outputs.python-version }}-prek-
- uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
if: github.event_name != 'push' || github.ref != format('refs/heads/{0}', github.event.repository.default_branch)
with:
Expand All @@ -40,14 +50,11 @@ runs:
!~/.cache/prek/cache/go
!~/.cache/prek/cache/cargo
~/.cache/kingfisher
key: ${{ runner.os }}-${{ runner.arch }}-prek-${{ hashFiles('.pre-commit-config.yaml') }}
key: ${{ runner.os }}-${{ runner.arch }}-${{ steps.environment.outputs.os-release }}-python-${{ steps.python.outputs.python-version }}-prek-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-prek-
- name: Setup Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.15'
${{ runner.os }}-${{ runner.arch }}-${{ steps.environment.outputs.os-release }}-python-${{ steps.python.outputs.python-version }}-prek-
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
version: 0.13.8
prune-cache: true
save-cache: ${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
4 changes: 0 additions & 4 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ jobs:
run: |
uv run --only-group pre-commit prek run --all-files --show-diff-on-failure
du -h --max-depth=1 ~/.cache/prek ~/.cache/prek/cache ~/.cache/kingfisher || true
uv run --only-group pre-commit prek cache gc
du -h --max-depth=1 ~/.cache/prek ~/.cache/prek/cache ~/.cache/kingfisher || true
env:
RUFF_OUTPUT_FORMAT: github
REUSE_OUTPUT_FORMAT: github
Expand All @@ -54,8 +52,6 @@ jobs:
run: |
uvx prek run --all-files --show-diff-on-failure
du -h --max-depth=1 ~/.cache/prek ~/.cache/prek/cache ~/.cache/kingfisher || true
uvx prek cache gc
du -h --max-depth=1 ~/.cache/prek ~/.cache/prek/cache ~/.cache/kingfisher || true
env:
RUFF_OUTPUT_FORMAT: github
REUSE_OUTPUT_FORMAT: github
Expand Down
Loading