-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (39 loc) · 1.11 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
38
39
40
41
42
43
44
45
46
47
48
49
name: pre-commit
on:
pull_request:
push:
branches: [master]
env:
CI: true
PYTHON_VERSION: 3.8.12
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use cached node_modules
uses: actions/cache@v1
with:
path: node_modules
key: node_modules+${{ hashFiles('**/yarn.lock') }}
- name: Install
run: yarn install --immutable
- name: Set up pre-commit environment
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Get pip cache dir
id: get-pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Use cached pre-commit environment
uses: actions/cache@v3
with:
path: |
~/.cache/pre-commit
${{ steps.get-pip-cache.outputs.dir }}
key: py-lints+${{ env.PYTHON_VERSION }}+${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure --color=always