-
-
Notifications
You must be signed in to change notification settings - Fork 18
46 lines (39 loc) · 1.75 KB
/
Copy pathpre-commit.yml
File metadata and controls
46 lines (39 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: pre-commit
on:
workflow_call:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}
- name: setup-mise
uses: jdx/mise-action@3c2e0cf82a5b2e5249f0d3635a4d83d0ae861518 # v4.2.5
- name: cache-deps
env:
CACHE_KEY_PREFIX: deps-${{ github.workflow }}-${{ github.job }}-${{ runner.os }}
CACHE_KEY_DEPS: ${{ hashFiles('uv.lock', '.pre-commit-config.yaml') }}
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.cache/pre-commit
~/.cache/ruff
~/.bun/install/cache
~/.local/share/uv
~/.cache/uv
${{ github.workspace }}/.venv
key: ${{ env.CACHE_KEY_PREFIX }}-${{ env.CACHE_KEY_DEPS }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
${{ env.CACHE_KEY_PREFIX }}-${{ env.CACHE_KEY_DEPS }}-${{ github.run_id }}-
${{ env.CACHE_KEY_PREFIX }}-${{ env.CACHE_KEY_DEPS }}-
${{ env.CACHE_KEY_PREFIX }}-
- name: install-dependencies
run: uv sync --all-extras --all-groups --frozen
- name: setup-path
run: echo "${{ github.workspace }}/.venv/bin" >> "$GITHUB_PATH"
- name: run-pre-commit
run: uv run pre-commit run --all-files