-
Notifications
You must be signed in to change notification settings - Fork 165
37 lines (35 loc) · 1.07 KB
/
pre-commit.yml
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
name: Pre-commit
on:
push:
pull_request:
jobs:
pre-commit:
runs-on: ubuntu-latest
name: pre-commit
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.13
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: poetry-${{ hashFiles('poetry.lock') }}
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Lock dependencies
run: poetry lock --no-update
- name: Install dependencies
run: poetry install --with=dev --no-interaction
- name: Run black
run: poetry run black --check --diff $(git ls-files "*.py")
- name: Run pre-commit checks
run: poetry run pre-commit run -a