···15 Command string
16 Name string
17 Environment map[string]string
18+ Kind StepKind
19}
20+21+type StepKind int
22+23+const (
24+ // steps injected by the CI runner
25+ StepKindSystem StepKind = iota
26+ // steps defined by the user in the original pipeline
27+ StepKindUser
28+)
2930type Workflow struct {
31 Steps []Step
···56 sstep.Environment = stepEnvToMap(tstep.Environment)
57 sstep.Command = tstep.Command
58 sstep.Name = tstep.Name
59+ sstep.Kind = StepKindUser
60 swf.Steps = append(swf.Steps, sstep)
61 }
62 swf.Name = twf.Name
···70 setup.addStep(nixConfStep())
71 setup.addStep(cloneStep(*twf, *pl.TriggerMetadata.Repo, cfg.Server.Dev))
72 setup.addStep(checkoutStep(*twf, *pl.TriggerMetadata))
73+ // this step could be empty
74+ if s := dependencyStep(*twf); s != nil {
75+ setup.addStep(*s)
76+ }
7778 // append setup steps in order to the start of workflow steps
79 swf.Steps = append(*setup, swf.Steps...)
+3-3
spindle/models/setup_steps.go
···83// For dependencies using a custom registry (i.e. not nixpkgs), it collects
84// all packages and adds a single 'nix profile install' step to the
85// beginning of the workflow's step list.
86-func dependencyStep(twf tangled.Pipeline_Workflow) Step {
87 var customPackages []string
8889 for _, d := range twf.Dependencies {
···111 "NIX_SHOW_DOWNLOAD_PROGRESS": "0",
112 },
113 }
114- return installStep
115 }
116- return Step{}
117}
···83// For dependencies using a custom registry (i.e. not nixpkgs), it collects
84// all packages and adds a single 'nix profile install' step to the
85// beginning of the workflow's step list.
86+func dependencyStep(twf tangled.Pipeline_Workflow) *Step {
87 var customPackages []string
8889 for _, d := range twf.Dependencies {
···111 "NIX_SHOW_DOWNLOAD_PROGRESS": "0",
112 },
113 }
114+ return &installStep
115 }
116+ return nil
117}