(step step, stage stepStage, executor common.Executor)
| 92 | } |
| 93 | |
| 94 | func runStepExecutor(step step, stage stepStage, executor common.Executor) common.Executor { |
| 95 | return func(ctx context.Context) error { |
| 96 | logger := common.Logger(ctx) |
| 97 | rc := step.getRunContext() |
| 98 | stepModel := step.getStepModel() |
| 99 | |
| 100 | ifExpression := step.getIfExpression(ctx, stage) |
| 101 | rc.CurrentStep = stepModel.ID |
| 102 | |
| 103 | stepResult := &model.StepResult{ |
| 104 | Outcome: model.StepStatusSuccess, |
| 105 | Conclusion: model.StepStatusSuccess, |
| 106 | Outputs: make(map[string]string), |
| 107 | } |
| 108 | if stage == stepStageMain { |
| 109 | rc.StepResults[rc.CurrentStep] = stepResult |
| 110 | } |
| 111 | |
| 112 | err := setupEnv(ctx, step) |
| 113 | if err != nil { |
| 114 | return err |
| 115 | } |
| 116 | |
| 117 | cctx := common.JobCancelContext(ctx) |
| 118 | rc.Cancelled = cctx != nil && cctx.Err() != nil |
| 119 | |
| 120 | runStep, err := isStepEnabled(ctx, ifExpression, step, stage) |
| 121 | if err != nil { |
| 122 | stepResult.Conclusion = model.StepStatusFailure |
| 123 | stepResult.Outcome = model.StepStatusFailure |
| 124 | return err |
| 125 | } |
| 126 | |
| 127 | if !runStep { |
| 128 | stepResult.Conclusion = model.StepStatusSkipped |
| 129 | stepResult.Outcome = model.StepStatusSkipped |
| 130 | logger.WithField("stepResult", stepResult.Outcome).Debugf("Skipping step '%s' due to '%s'", stepModel, ifExpression) |
| 131 | return nil |
| 132 | } |
| 133 | |
| 134 | stepString := rc.ExprEval.Interpolate(ctx, stepModel.String()) |
| 135 | if strings.Contains(stepString, "::add-mask::") { |
| 136 | stepString = "add-mask command" |
| 137 | } |
| 138 | logger.Infof("\u2B50 Run %s %s", stage, stepString) |
| 139 | |
| 140 | // Prepare and clean Runner File Commands |
| 141 | actPath := rc.JobContainer.GetActPath() |
| 142 | |
| 143 | outputFileCommand := path.Join("workflow", "outputcmd.txt") |
| 144 | (*step.getEnv())["GITHUB_OUTPUT"] = path.Join(actPath, outputFileCommand) |
| 145 | |
| 146 | stateFileCommand := path.Join("workflow", "statecmd.txt") |
| 147 | (*step.getEnv())["GITHUB_STATE"] = path.Join(actPath, stateFileCommand) |
| 148 | |
| 149 | pathFileCommand := path.Join("workflow", "pathcmd.txt") |
| 150 | (*step.getEnv())["GITHUB_PATH"] = path.Join(actPath, pathFileCommand) |
| 151 |
no test coverage detected
searching dependent graphs…