-
-
Notifications
You must be signed in to change notification settings - Fork 90
33 lines (27 loc) · 984 Bytes
/
validate.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
name: Pre-commit checks
on: pull_request
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: "pip" # caching pip dependencies
- name: Install pre-commit
run: |
pip install 'pre-commit==3.3.2'
pre-commit install
- name: Set env variables
run: |
echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
echo "PRECOMMIT=$(pip list | grep pre-commit)" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ env.PRECOMMIT }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run all pre-commit checks
# TODO: remove skip once files are clean
run: SKIP=isort pre-commit run --all-files --hook-stage manual -c .pre-commit-config.yaml