ln-732-cicd-generator
L3 Worker - Generates GitHub Actions CI workflow configuration
Main Workflow (4 Phases)
stateDiagram-v2
[*] --> Analyze: Receive Config from ln-730
state Analyze {
[*] --> DetectBackend
DetectBackend --> IsDotNet: .sln/.csproj
DetectBackend --> IsPython: requirements.txt
IsDotNet --> SelectTemplate: .NET Template
IsPython --> SelectTemplate: Python Template
SelectTemplate --> [*]
}
Analyze --> Substitute: Template Selected
state Substitute {
[*] --> NodeVersion
NodeVersion --> BackendVersion
BackendVersion --> FrontendPath
FrontendPath --> [*]
}
Substitute --> CreateDir: Variables Applied
state CreateDir {
[*] --> CheckGitHub
CheckGitHub --> MkDir: .github/ missing
CheckGitHub --> Skip: .github/ exists
MkDir --> CheckWorkflows
Skip --> CheckWorkflows
CheckWorkflows --> [*]
}
CreateDir --> Generate: Directory Ready
state Generate {
[*] --> CheckExisting
CheckExisting --> WriteYAML: No ci.yml
CheckExisting --> WarnOverwrite: ci.yml exists
WarnOverwrite --> WriteYAML
WriteYAML --> ValidateYAML
ValidateYAML --> [*]
}
Generate --> [*]: Workflow Created
Template Selection
flowchart TB
Input([Stack Config]) --> Backend{Backend Type?}
Backend -->|.NET| DotNet[github_ci_dotnet.template.yml]
Backend -->|Python| Python[github_ci_python.template.yml]
DotNet --> Vars1[Variables:
NODE_VERSION
DOTNET_VERSION
FRONTEND_PATH]
Python --> Vars2[Variables:
NODE_VERSION
PYTHON_VERSION
FRONTEND_PATH]
Vars1 --> Output([.github/workflows/ci.yml])
Vars2 --> Output
classDef template fill:#C8E6C9
classDef vars fill:#FFF9C4
class DotNet,Python template
class Vars1,Vars2 vars
Generated Pipeline Structure
flowchart LR
subgraph Trigger["Triggers"]
Push([push: main, develop])
PR([pull_request: main])
end
Push --> Jobs
PR --> Jobs
subgraph Jobs["CI Jobs"]
subgraph Parallel["Parallel Execution"]
Frontend[Frontend Job]
Backend[Backend Job]
end
Frontend --> Docker[Docker Job]
Backend --> Docker
end
subgraph Frontend["Frontend Steps"]
F1[Checkout]
F2[Setup Node.js]
F3[npm ci]
F4[npm run lint]
F5[npm run build]
F6[npm test]
end
subgraph Backend["Backend Steps"]
B1[Checkout]
B2[Setup SDK]
B3[Restore]
B4[Build]
B5[Test]
end
subgraph Docker["Docker Steps"]
D1[Checkout]
D2[docker compose build]
D3[docker compose up -d]
D4[Health checks]
D5[docker compose down]
end
classDef trigger fill:#E3F2FD
classDef job fill:#C8E6C9
class Push,PR trigger
class Frontend,Backend,Docker job
Health Check Flow
sequenceDiagram
participant CI as GitHub Actions
participant D as Docker Compose
participant F as Frontend :3000
participant B as Backend :5000
CI->>D: docker compose up -d
D->>F: Start frontend
D->>B: Start backend
Note over CI: sleep 30
CI->>F: curl http://localhost:3000
F-->>CI: 200 OK
CI->>B: curl http://localhost:5000/health
B-->>CI: 200 OK
alt Health Check Failed
CI->>D: docker compose logs
D-->>CI: Container logs
end
CI->>D: docker compose down