Run pre-commit in separate workflow

This commit is contained in:
Ayaz Salikhov
2021-06-01 12:29:04 +03:00
parent 710cfa5626
commit 05f9fb7fb6
2 changed files with 34 additions and 2 deletions

View File

@@ -7,14 +7,17 @@ on:
- "binder/**"
- "docs/**"
- "examples/**"
- ".pre-commit-config.yaml"
push:
branches:
- master
- main
paths-ignore:
- "*.md"
- "binder/**"
- "docs/**"
- "examples/**"
- ".pre-commit-config.yaml"
jobs:
build:
@@ -43,8 +46,6 @@ jobs:
run: |
python -m pip install --upgrade pip
make -C main dev-env
- name: Run pre-commit hooks
run: make -C main pre-commit-all
- name: Build Docker Images
run: make -C main build-test-all
env:

31
.github/workflows/pre-commit.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Run pre-commit hooks
on:
pull_request:
push:
branches:
- master
- main
jobs:
build:
name: Run pre-commit hooks
runs-on: ubuntu-latest
if: >
!contains(github.event.head_commit.message, 'ci skip') &&
!contains(github.event.pull_request.title, 'ci skip')
steps:
- name: Clone Main Repo
uses: actions/checkout@v2
with:
path: main
- name: Set Up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Dev Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pre-commit
- name: Run pre-commit hooks
run: make -C main pre-commit-all