Skip to content

edited flake requirements #3

edited flake requirements

edited flake requirements #3

Workflow file for this run

name: python_lint
on:
push:
branches: "**"
pull_request:
types: [opened, reopened, synchronize, closed]
branches: "**"
jobs:
flake8_py3:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
architecture: x64
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install lint dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Check for Python file changes
id: file_check
uses: tj-actions/changed-files@v44
with:
sha: ${{ github.event.pull_request.head.sha }}
files: |
**.py
- name: Run flake8
if: steps.file_check.outputs.any_changed == 'true'
run: flake8 --config tox.ini
- name: No Python files changed
if: steps.file_check.outputs.any_changed != 'true'
run: echo "No Python files have been changed."
black_lint:
runs-on: ubuntu-latest
steps:
- name: Setup
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install black
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Check for Python file changes
id: file_check
uses: tj-actions/changed-files@v44
with:
sha: ${{ github.event.pull_request.head.sha }}
files: '**.py'
- name: Check code lints with Black
if: steps.file_check.outputs.any_changed == 'true'
uses: psf/black@stable
- name: No Python files changed
if: steps.file_check.outputs.any_changed != 'true'
run: echo "No Python files have been changed."