Skip to content

Add GitHub Actions CI workflow to generated projects #521

@lbedner

Description

@lbedner

Summary

Every project generated by aegis init should include GitHub Actions workflow files out of the box so that CI runs automatically on push/PR.

What to include

Workflow: .github/workflows/ci.yml

A single CI workflow triggered on push to main and all PRs that runs:

  • Lint (ruff check)
  • Type check (ty check or mypy)
  • Tests (pytest)
  • Format check (ruff format --check)

Considerations

  • Use uv for dependency installation (match the project's toolchain)
  • Matrix strategy for Python versions if applicable (at minimum the project's target version)
  • Cache uv and pip dependencies for faster runs
  • The workflow should be a Jinja template so it respects component flags (e.g., only set up PostgreSQL service if include_database is true, only set up Redis if include_redis is true)
  • Docker service containers for PostgreSQL and Redis when those components are enabled
  • Environment variables from .env.example should be templated in
  • Consider a separate deploy.yml later (out of scope for this issue)

Template structure

{{ project_slug }}/.github/workflows/ci.yml.jinja

Example steps

- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- run: uv sync --all-extras
- run: uv run ruff check .
- run: uv run ruff format --check .
- run: uv run ty check
- run: uv run pytest

Acceptance criteria

  • aegis init generates .github/workflows/ci.yml
  • Workflow passes on a fresh generated project
  • PostgreSQL/Redis service containers are conditionally included based on component flags
  • post_gen_tasks.py updated to register/remove the workflow files based on components
  • Template tested with make test-template and make test-template-full

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions