ci(python-app): update python-app.yml #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Format and Lint | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Display Python version | |
run: python -c "import sys; print(sys.version)" | |
- name: Install build dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 black isort flake8-bugbear pylint | |
- name: Install code dependencies | |
run: | | |
pip install . | |
- name: Format with flake8 | |
run: | | |
flake8 . | |
- name: Format with black | |
run: | | |
black . | |
- name: Format with isort | |
run: | | |
isort . | |
- name: Commit changes | |
run: | | |
git add . | |
git commit -m "auto: code formatting" | |
- name: Lint with pylint | |
run: | | |
pylint . |