Files
shared-actions/.gitea/workflows/python-quality-gates-github.yml
T
LucaZanni a11fe2af2b ⚡ perf(ci): le action arrivano dai mirror interni, non da gitea.com
- tutti gli uses: puntano a gitea.pzetatouch.it/actions/*, pull mirror che
  risincronizzano dall'upstream e seguono i tag flottanti
- gitea.com ci serviva a ~32 KB/s: un clone a freddo di setup-node ha tenuto
  fermo il runner 26 minuti con 28 run in coda
- dalla rete interna lo stesso clone a freddo costa 3 s (~12,8 MB/s)
- sparisce anche l'incoerenza per cui actions/cache era preso da github.com
  in tutte e 23 le occorrenze, varianti gitea comprese

Fixes #26 @2h
2026-10-19 17:22:55 +02:00

66 lines
1.9 KiB
YAML

name: Python Quality Gates
on:
workflow_call:
inputs:
python-version:
type: string
default: '3.11'
install-extras:
description: 'Extras pip da installare (es: dev, test). Lasciare vuoto per solo requirements.txt'
type: string
default: 'dev'
working-directory:
description: 'Directory di lavoro se il progetto non è in root'
type: string
default: '.'
jobs:
python-quality-gates:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.working-directory }}
steps:
- name: Checkout
uses: https://gitea.pzetatouch.it/actions/checkout@v7
- name: Setup Python
uses: https://gitea.pzetatouch.it/actions/setup-python@v7
with:
python-version: ${{ inputs.python-version || '3.11' }}
- name: Cache pip
uses: https://gitea.pzetatouch.it/actions/cache@v6
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ inputs.python-version }}-${{ hashFiles('**/pyproject.toml', '**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ inputs.python-version }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -n "${{ inputs.install-extras }}" ]; then
pip install -e ".[${{ inputs.install-extras }}]"
elif [ -f requirements-dev.txt ]; then
pip install -r requirements-dev.txt
elif [ -f requirements.txt ]; then
pip install -r requirements.txt
else
pip install -e "."
fi
- name: Lint (ruff)
run: ruff check .
- name: Format check (ruff)
run: ruff format --check .
- name: Type check (mypy)
run: mypy .
- name: Test (pytest)
run: pytest --tb=short -q