Python / FastAPI CI Standard
Required stages
Section titled “Required stages”uv sync --locked --all-groupsusing a committeduv.lock.ruff format --checkandruff check.- MyPy, initially scoped to application modules if legacy typing debt exists.
- Pytest with pytest-cov and JUnit/Cobertura output.
- SonarQube analysis.
- Semgrep, Gitleaks, Trivy filesystem/config.
- Multi-stage image build; optional
ciDocker target for native dependencies. - Trivy image scan, SBOM, signing, and publish.
Bandit may run during migration for comparison, but Semgrep is the authoritative cross-language SAST control. Duplicate scanners are retired after rule and finding comparison.
Dependency management
Section titled “Dependency management”uv 0.11.28 is the standard Python package manager. CI runs project commands through uv run, for example uv run pytest --cov. Existing Poetry or requirements-file repositories are migration exceptions only: convert and review their dependency metadata and uv.lock, then validate tests, Docker builds, and deployed smoke behavior before removing the legacy workflow.
Example caller
Section titled “Example caller”jobs: ci: uses: dataready-ai/nexa-ci/.github/workflows/python-ci.yml@v1 with: python-version: '3.12' image-name: nexa-databricks-api docker-ci-target: ci docker-runtime-target: runtime ecr-repository: aws-iac-nexa-databricks-api acr-repository: nexa-databricks-api spcs-repository: NEXA_DATABRICKS_API_REPO run-terraform-scan: false secrets: inherit