Monorepo for Tangled — https://tangled.org
at spindle-workflow 53 lines 933 B view raw
1package models 2 3type Pipeline struct { 4 RepoOwner string 5 RepoName string 6 Workflows map[Engine][]Workflow 7} 8 9type Step interface { 10 Name() string 11 Command() string 12 Kind() StepKind 13 Environment() map[string]string 14} 15 16// DefaultStep provides a basic implementation of the models.Step interface 17type DefaultStep struct { 18 StepName string 19 StepCommand string 20 StepKind StepKind 21 StepEnvironment map[string]string 22} 23 24func (s DefaultStep) Name() string { 25 return s.StepName 26} 27 28func (s DefaultStep) Command() string { 29 return s.StepCommand 30} 31 32func (s DefaultStep) Kind() StepKind { 33 return s.StepKind 34} 35 36func (s DefaultStep) Environment() map[string]string { 37 return s.StepEnvironment 38} 39 40type StepKind int 41 42const ( 43 // steps injected by the CI runner 44 StepKindSystem StepKind = iota 45 // steps defined by the user in the original pipeline 46 StepKindUser 47) 48 49type Workflow struct { 50 Steps []Step 51 Name string 52 Data any 53}