Code Quality Run on refs/heads/master by @jpcadena #9
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 is the name of the workflow, it appears in the GitHub Actions tab | |
name: Code Quality | |
# The name for workflow runs generated from this workflow | |
run-name: Code Quality Run on ${{ github.ref }} by @${{ github.actor }} | |
# This specifies the events that will trigger the workflow to run | |
on: [push, pull_request] | |
# Jobs define the actual tasks that the workflow will execute | |
jobs: | |
code_quality_check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Setup Python environment | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
- name: Generate requirements.txt from Poetry | |
run: | | |
poetry export -f requirements.txt --output requirements.txt --without-hashes | |
# Install Python dependencies | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
# Check code formatting using isort | |
- name: Run isort | |
uses: isort/isort-action@v1 | |
- name: Auto-format Python code with Black | |
run: | | |
black . | |
# Check code formatting using Black | |
- name: Run Black | |
uses: psf/black@stable | |
with: | |
options: "--check --verbose" | |
# Use Ruff to run additional quality checks | |
- name: Run Ruff | |
uses: chartboost/ruff-action@v1 | |
with: | |
args: --fix | |
- name: Run MyPy | |
run: | | |
mypy --config-file=pyproject.toml --pretty . |