-
Notifications
You must be signed in to change notification settings - Fork 16
45 lines (35 loc) · 991 Bytes
/
Copy pathpre-commit.yml
File metadata and controls
45 lines (35 loc) · 991 Bytes
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
name: "pre-commit checks"
permissions:
contents: read
on:
push:
branches: ["main", "master"]
pull_request:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0 # pre-commit sometimes needs full history
- name: Set up Python environment
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install Python dependencies for pyright
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Set up Node.js for pyright
uses: actions/setup-node@v5
with:
node-version: '20'
- name: Install pyright
run: |
npm install -g pyright
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit hooks
run: pre-commit run --all-files --show-diff-on-failure