Add github action for pre-commit checks

This commit is contained in:
Ryan Delaney 2022-03-09 11:33:26 -05:00
parent 4e1b1ac1c6
commit b47f8fb264
2 changed files with 29 additions and 1 deletions

View File

@ -1,4 +1,6 @@
---
name: 'Release'
on:
push:
branches: [master]
@ -8,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Check out Git repository'
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: 'Generate shell files'
run: make generate

26
.github/workflows/pre_commit.yaml vendored Normal file
View File

@ -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