Setup Python GitHub Workflows
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Scaffolds or updates the CI/CD and security pipeline for a Python web repository of either flavor — a FastAPI service
or a Django project — driving everything through the uv commands that the matching iru-setup-python-* scaffold
defines.
Purpose
iru-setup-python-github-workflows writes the GitHub Actions files a FastAPI or Django repository needs, matched to
its flavor and to cost-aware choices made up front:
-
build.yml— runs on pushes to the integration/stable branches, pull requests, andworkflow_dispatch. It usesastral-sh/setup-uvwithuv sync --locked, Ruff lint and format checks, mypy, and (for Django)manage.py check,makemigrations --check --dry-runand the DRF or Ninja schema validation. Fast tests run with Cobertura coverage (80% floor) and JUnit XML, across a Python matrix only forci-tests: fullon a public repository. Amigrationsjob runs against a PostgreSQL service container (or a SQLite file): Alembic upgrade/check/single-head/downgrade for FastAPI,check --deploywith production settings plusmigrate --checkfor Django. Withci-tests: fullanddatabase: postgresqlit adds a testcontainers-backed integration job — for a Django project with the scaffold’s browser UI tier (tests/ui/and theuimarker) that same job also installs Chromium, runspytest -m ui(Playwright + axe-core at the.ui-quality.ymllevel) and uploads.ui-screenshots/as a 7-dayui-screenshots-integrationartifact; no extra job is added. FastAPI, SQLite andci-tests: unitvariants run no UI tier in CI (it stays a localuv run pytest -m ui). When.ui-quality.ymlhasaccessibility: none, no accessibility report is collected or uploaded and any accessibility-only step is dropped. It also builds the container image without pushing it, adds an optional SonarCloud/SonarQube job (skipped on fork pull requests), and a docs job (Antora plus Sphinx API docs and the OpenAPI document) deployed to GitHub Pages or uploaded as an artifact. -
release.ymlperdistribution— on a published GitHub Release: version check against the tag,uv buildsdist and wheel attached to the release, and the rootDockerfilepushed to GHCR (private forinternal, public forstore). Not written withdistribution: none. There is deliberately no PyPI publishing. -
sync.ymlplus.github/scripts/python_version.pyand.github/scripts/sync_versions.py— after a release from the stable branch, a pull request merges it back into the integration branch with the next PEP 440X.(Y+1).0.dev0version and a refresheduv.lock, the conventioniru-python-bump-versionandiru-releaseuse. -
The shared security block —
security.yml(dependency-review, CodeQL forpythonandactions, OSV-Scanner overuv.lock, gitleaks, plus this stack’spip-auditjob) and.github/dependabot.yml(uv or pip, github-actions, docker, docker-compose, npm for the Antora toolchain).
It announces whether it is creating the pipeline from scratch or updating an existing one, and asks per workflow file
whether to Update, Keep as is, Replace, or Stop. Templates are validated with actionlint, and the commands the
workflows contain are run locally first, so nothing is a guess.
Plugin
Shipped by the iru-python plugin of the ai-catalog marketplace (install with /plugin install iru-python@ai-catalog; see Plugins).
Invocation
/iru-setup-python-github-workflows
/iru-setup-python-github-workflows <args>
args is a block of key: value lines, one per line.
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
|
Detected from |
|
No |
Branch that receives development work and the |
|
|
No |
Branch releases are cut from; docs deploy from it. |
|
|
No |
The primary CI Python version; the matrix runs from the |
|
|
No |
|
Detected from dependencies |
|
No |
|
Detected from the project |
|
No |
|
|
|
No |
|
Asked; |
|
No |
|
|
|
No |
|
Asked; |
|
No |
|
Asked; |
|
No |
|
None |
|
No |
|
|
|
No |
Each |
|
Any other key (including ci and publish) is ignored — invoking the skill means CI is wanted.
Outputs
-
.github/workflows/build.yml, andrelease.ymlunlessdistribution: none. -
.github/workflows/sync.ymlwith.github/scripts/python_version.pyand.github/scripts/sync_versions.py(made executable). -
.github/workflows/security.ymland.github/dependabot.yml. -
In the Django
build.ymlintegration job, whentests/ui/exists: the# uisteps (Chromium install, UI test run,pytest-ui.xmlreport and the.ui-screenshots/artifact upload). See Building user interfaces. -
A report with the required secrets (
SONAR_TOKENwhen Sonar is enabled), repository settings to check (workflow permissions for pull requests, Pages source, code scanning, GHCR package visibility), the choices made, per-unit created / updated / replaced / kept as is, and every open gap (missing contract tooling, no Antora setup, noDockerfile, unverified Docker-based jobs, whether the integration job runs the UI tier and uploads screenshots or why not, and the UI steps being unverified without a browser).
The generated files' bytes come from template files under templates/ (and, where a template needs variant-specific notes, reference/) in .claude/skills/iru-setup-python-github-workflows/; the skill reads only the files for the variant it resolved, not the whole set, which keeps its SKILL.md small.
Execution flow
Dependencies
Invokes
None — this skill calls no other skill. It only mentions iru-setup-antora (the Antora toolchain the docs job builds),
iru-explore (flavor detection markers), iru-python-bump-version and iru-release (the version convention
sync.yml follows), and the iru-setup-python-fastapi / iru-setup-python-django scaffolds (which define the uv
commands) as prerequisites to recommend, not to run.
Invoked by
-
Setup Python Repository — Step 8, CI/CD and security workflows, skipped when ci is no, via the
iru-isolated-skill-executoragent.
Related agents
-
iru-gate-runner— Step 5, runs the workflows' own commands locally (uv sync --locked, Ruff, mypy, tests with coverage, Django checks, Sphinx build,uv build, pip-audit, the version helper) and returns compact results.
Source
SKILL.md on GitHub — the file this page was generated from.