diff --git a/.github/workflows/python_static_analysis.yml b/.github/workflows/python_static_analysis.yml new file mode 100644 index 00000000..c44dc591 --- /dev/null +++ b/.github/workflows/python_static_analysis.yml @@ -0,0 +1,37 @@ +name: Python Static Analysis + +on: + pull_request: + push: + branches: [main] + workflow_dispatch: + +jobs: + job: + runs-on: ubuntu-latest + + steps: + + # https://github.com/actions/setup-python + - name: Install Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install Python dependencies + run: | + pip install --upgrade pip + pip install black 'black[jupyter]' flake8 isort + + # https://github.com/actions/checkout + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Run isort + run: isort --check . + + - name: Run flake8 + run: flake8 + + - name: Run black + run: black --check .