Workflows Overview
Workflows are an optional layer on top of the base build system. They let you define how your targets map to CI/CD jobs and automatically generate the platform-specific YAML files for GitHub Actions and Azure DevOps Pipelines. Read this before the rest of the workflow pages.
When Do You Need Workflows?
Use workflows when you want Atom to generate your CI/CD configuration. If you only run builds locally or maintain
your YAML by hand, stick with IBuildDefinition.
Enabling Workflows
Extend
IWorkflowBuildDefinitioninstead ofIBuildDefinition:[BuildDefinition] [GenerateEntryPoint] internal interface IBuild : IWorkflowBuildDefinition { // ... }The alternative partial-class form derives from
WorkflowBuildDefinition.Define the
Workflowsproperty to declare your pipelines. Interface builds explicitly implementIWorkflowBuildDefinition.Workflows; partial classes override it.Add a platform module (
Invex.Atom.Module.GitHubWorkflowsorInvex.Atom.Module.DevOpsWorkflows) so Atom knows which YAML format to emit.Run
dotnet run -- Gento write the files.
What workflow builds add
Both IWorkflowBuildDefinition and WorkflowBuildDefinition provide:
| Feature | Description |
|---|---|
Workflows property |
An IReadOnlyList<WorkflowDefinition> describing each CI/CD pipeline. |
IGen |
The Gen target that writes YAML. |
WorkflowGenerator |
Resolves the build model into a platform-neutral workflow model. |
WorkflowResolver |
Analyses target dependencies, artifacts, and variables to build the job graph. |
WorkflowLifecycleHook |
A lifecycle hook that regenerates files locally and fails the build in headless mode when generated files are outdated. |
How Generation Works
- The
WorkflowResolverexamines yourWorkflowsdefinitions and your target dependency graph. - It groups targets into jobs, splitting on artifact/variable boundaries (since those require separate CI jobs).
- The
WorkflowGeneratormaps each job to aWorkflowModel. - A platform-specific
WorkflowFileWriter(e.g. for GitHub Actions or Azure DevOps) renders the model to YAML and writes it to disk.
Next steps
- Workflow Definitions: declare workflows, targets, and platforms.
- Base vs Workflow Build: choose the right base contract.
- IWorkflowBuildDefinition
- WorkflowBuildDefinition