Skip to content

Commit 1134da9

Browse files
add flake8 job
Make sure that each new contribution passes flake8 checks only on the diff lines on the actual commit. Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com> Change-Id: I55ef4801c6b51109e6b466507cdc00b7ad462b0c
1 parent ed790a6 commit 1134da9

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

.github/workflows/flake8.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Flake8 Check
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
flake8:
8+
name: Flake8 on changed Python files
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.10'
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install "flake8>=5.0.4,<6"
24+
25+
- name: Run flake8 with diff
26+
run: |
27+
git show HEAD | flake8 -v --diff

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
name: CI
88

99
jobs:
10+
flake8-check:
11+
uses: ./.github/workflows/flake8.yml
1012
build:
1113
name: Tox test
1214
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)