Skip to content

Commit aceb763

Browse files
authored
Merge pull request #1341 from mathbunnyru/asalikhov/separate_pre_commit
Run pre-commit in separate workflow
2 parents 731c123 + 05f9fb7 commit aceb763

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

.github/workflows/docker.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ on:
77
- "binder/**"
88
- "docs/**"
99
- "examples/**"
10+
- ".pre-commit-config.yaml"
1011
push:
1112
branches:
1213
- master
14+
- main
1315
paths-ignore:
1416
- "*.md"
1517
- "binder/**"
1618
- "docs/**"
1719
- "examples/**"
20+
- ".pre-commit-config.yaml"
1821

1922
jobs:
2023
build:
@@ -43,8 +46,6 @@ jobs:
4346
run: |
4447
python -m pip install --upgrade pip
4548
make -C main dev-env
46-
- name: Run pre-commit hooks
47-
run: make -C main pre-commit-all
4849
- name: Build Docker Images
4950
run: make -C main build-test-all
5051
env:

.github/workflows/pre-commit.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Run pre-commit hooks
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
- main
9+
10+
jobs:
11+
build:
12+
name: Run pre-commit hooks
13+
runs-on: ubuntu-latest
14+
if: >
15+
!contains(github.event.head_commit.message, 'ci skip') &&
16+
!contains(github.event.pull_request.title, 'ci skip')
17+
steps:
18+
- name: Clone Main Repo
19+
uses: actions/checkout@v2
20+
with:
21+
path: main
22+
- name: Set Up Python
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: 3.8
26+
- name: Install Dev Dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install --upgrade pre-commit
30+
- name: Run pre-commit hooks
31+
run: make -C main pre-commit-all

0 commit comments

Comments
 (0)