36 lines
845 B
YAML
36 lines
845 B
YAML
name: Python Linting
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**' # Match all branches
|
|
pull_request:
|
|
branches:
|
|
- '**' # Match all branches
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.12' # Specify the exact Python version
|
|
|
|
- name: Install Flake8
|
|
run: |
|
|
python -m venv venv # Create a virtual environment in the project root
|
|
source venv/bin/activate
|
|
pip install --upgrade pip
|
|
pip install flake8==7.1.1 # Install specific flake8 version
|
|
|
|
- name: Run Flake8
|
|
run: |
|
|
source venv/bin/activate
|
|
flake8 . --config=.flake8 # Run flake8 using the configuration in .flake8
|
|
|