-
-
Notifications
You must be signed in to change notification settings - Fork 15
46 lines (39 loc) · 1.75 KB
/
pre-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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}
- name: setup-mise
uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1
- 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@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
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