Interview Prep/Python for DevOps/Testing, CI/CD, packaging & services

You want a reusable CI pipeline for 15 Python tool repos. What goes in it?

IntermediateScenarioTesting, CI/CD, packaging & services
Answer

Situation read → Standardize quality gates once.

What I'd do →

  1. A reusable GitHub Actions workflow (workflow_call) with inputs for Python version and package path.
  2. Steps: checkout, actions/setup-python with pip cache (or astral-sh/setup-uv), install from lock, ruff check, ruff format --check, mypy, pytest --cov, pip-audit, build wheel.
  3. Build and scan the Docker image (Trivy) where applicable; push on main with SHA tags.
  4. Pin actions by SHA; least-privilege permissions:.

Why → One pipeline definition means consistent gates and one place to fix things.

Interview tip → Mention pinning third-party actions by commit SHA.

All Python for DevOps questions Roadmap: Python for automation

More on Testing, CI/CD, packaging & services