Skip to content

Commit c231f3e

Browse files
committed
add static analysis GitHub Action of python files using black, flake8, and isort
1 parent bfad674 commit c231f3e

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Python Static Analysis
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
workflow_dispatch:
8+
9+
jobs:
10+
job:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
15+
# https://github.com/actions/setup-python
16+
- name: Install Python 3.10
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.10'
20+
21+
- name: Install Python dependencies
22+
run: |
23+
pip install --upgrade pip
24+
pip install black
25+
pip install flake8
26+
pip install isort
27+
28+
# https://github.com/actions/checkout
29+
- name: Checkout repository
30+
uses: actions/checkout@v3
31+
32+
- name: Run isort
33+
run: isort --check .
34+
35+
- name: Run flake8
36+
run: flake8
37+
38+
- name: Run black
39+
run: black --check .

0 commit comments

Comments
 (0)