-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (43 loc) · 1.15 KB
/
pre-commit.yaml
File metadata and controls
50 lines (43 loc) · 1.15 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
47
48
49
50
---
name: Pre-Commit
on:
merge_group:
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
push:
branches:
- main
schedule:
# Run once a week (see https://crontab.guru)
- cron: "0 0 * * 0"
workflow_dispatch:
concurrency:
cancel-in-progress: true
group: pre-commit-${{ github.workflow }}-${{ github.ref }}
env:
PYTHON_VERSION: 3.12.6
jobs:
pre-commit:
name: Pre-commit
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv
uses: astral-sh/setup-uv@6ee6290f1cbc4156c0bdd66691b2c144ef8df19a # v7.4.0
with:
version: "latest"
python-version: ${{ env.PYTHON_VERSION }}
- name: Sync packages
run: uv sync --all-extras
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PYTHON_VERSION }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: uv run pre-commit run --all-files