Add github action for pre-commit checks
This commit is contained in:
parent
4e1b1ac1c6
commit
b47f8fb264
|
@ -1,4 +1,6 @@
|
||||||
|
---
|
||||||
name: 'Release'
|
name: 'Release'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
branches: [master]
|
||||||
|
@ -8,7 +10,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 'Check out Git repository'
|
- name: 'Check out Git repository'
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: 'Generate shell files'
|
- name: 'Generate shell files'
|
||||||
run: make generate
|
run: make generate
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
---
|
||||||
|
name: pre-commit
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pre-commit:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install pre-commit
|
||||||
|
run: pip install pre-commit
|
||||||
|
|
||||||
|
- name: cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
key: pre-commit-dot-cache-{{ checksum ".pre-commit-config.yaml" }}
|
||||||
|
path: ~/.cache/pre-commit
|
||||||
|
|
||||||
|
- name: Pre-commit checks
|
||||||
|
run: pre-commit run --all-files --show-diff-on-failure
|
Loading…
Reference in New Issue