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
28 changes: 27 additions & 1 deletion .github/actions/pre-commit-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,35 @@ description: Prepare pre-commit environment
runs:
using: composite
steps:
# 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.
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
if: github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
with:
path: |
~/.cache/prek
~/.cache/prek/*
!~/.cache/prek/cache
~/.cache/prek/cache/*
!~/.cache/prek/cache/uv
!~/.cache/prek/cache/npm
!~/.cache/prek/cache/go
!~/.cache/prek/cache/cargo
~/.cache/kingfisher
key: ${{ runner.os }}-${{ runner.arch }}-prek-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-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:
path: |
~/.cache/prek/*
!~/.cache/prek/cache
~/.cache/prek/cache/*
!~/.cache/prek/cache/uv
!~/.cache/prek/cache/npm
!~/.cache/prek/cache/go
!~/.cache/prek/cache/cargo
~/.cache/kingfisher
key: ${{ runner.os }}-${{ runner.arch }}-prek-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
Expand All @@ -25,3 +50,4 @@ runs:
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
version: 0.12.10
save-cache: ${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
4 changes: 4 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ jobs:
if: steps.detect.outputs.method == 'pep735'
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 @@ -49,7 +51,9 @@ jobs:
if: steps.detect.outputs.method == 'uvx'
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
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ repos:
rev: v2.1.0
hooks:
- id: kingfisher-auto
env:
KINGFISHER_VERSION: v2.1.0
- repo: https://github.com/rvben/rumdl-pre-commit
rev: v0.2.66
hooks:
- id: rumdl
- id: rumdl-fmt
- repo: https://github.com/kjanat/actionlint
rev: v1.14.0
rev: v1.15.1
hooks:
- id: actionlint
ci:
Expand Down
Loading