mirror of
https://github.com/actions/runner.git
synced 2025-12-10 12:36:23 +00:00
Initial Start for FileTable stuff
This commit is contained in:
@@ -402,6 +402,7 @@ namespace GitHub.Runner.Worker
|
||||
Trace.Verbose($"Details: {StringUtil.ConvertToJson(compositeAction.Steps)}");
|
||||
Trace.Info($"Load: {compositeAction.Environment} environment steps");
|
||||
Trace.Info($"Details: {StringUtil.ConvertToJson(compositeAction.Environment)}");
|
||||
Trace.Info($"Composite Action File ID: {compositeAction.FileID.ToString()}");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1288,6 +1289,7 @@ namespace GitHub.Runner.Worker
|
||||
public override bool HasPost => false;
|
||||
public List<Pipelines.ActionStep> Steps { get; set; }
|
||||
public MappingToken Environment { get; set; }
|
||||
public Int32 FileID { get; set; }
|
||||
}
|
||||
|
||||
public abstract class ActionExecutionData
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace GitHub.Runner.Worker
|
||||
|
||||
Dictionary<string, string> EvaluateContainerEnvironment(IExecutionContext executionContext, MappingToken token, IDictionary<string, PipelineContextData> extraExpressionValues);
|
||||
|
||||
public Dictionary<string, string> EvaluateCompositeActionEnvironment(IExecutionContext executionContext, MappingToken token, IDictionary<string, PipelineContextData> extraExpressionValues);
|
||||
public Dictionary<string, string> EvaluateCompositeActionEnvironment(IExecutionContext executionContext, MappingToken token, IDictionary<string, PipelineContextData> extraExpressionValues, Int32 fileID);
|
||||
string EvaluateDefaultInput(IExecutionContext executionContext, string inputName, TemplateToken token);
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace GitHub.Runner.Worker
|
||||
break;
|
||||
|
||||
case "runs":
|
||||
actionDefinition.Execution = ConvertRuns(executionContext, context, actionPair.Value, envComposite);
|
||||
actionDefinition.Execution = ConvertRuns(executionContext, context, actionPair.Value, envComposite, fileId);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -225,7 +225,8 @@ namespace GitHub.Runner.Worker
|
||||
public Dictionary<string, string> EvaluateCompositeActionEnvironment(
|
||||
IExecutionContext executionContext,
|
||||
MappingToken token,
|
||||
IDictionary<string, PipelineContextData> extraExpressionValues)
|
||||
IDictionary<string, PipelineContextData> extraExpressionValues,
|
||||
Int32 fileID)
|
||||
{
|
||||
var result = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
@@ -234,7 +235,7 @@ namespace GitHub.Runner.Worker
|
||||
var context = CreateContext(executionContext, extraExpressionValues);
|
||||
try
|
||||
{
|
||||
var evaluateResult = TemplateEvaluator.Evaluate(context, "runs-env", token, 0, null, omitHeader: true);
|
||||
var evaluateResult = TemplateEvaluator.Evaluate(context, "runs-env", token, 0, fileID, omitHeader: true);
|
||||
context.Errors.Check();
|
||||
|
||||
// Mapping
|
||||
@@ -348,7 +349,8 @@ namespace GitHub.Runner.Worker
|
||||
IExecutionContext executionContext,
|
||||
TemplateContext context,
|
||||
TemplateToken inputsToken,
|
||||
MappingToken envComposite)
|
||||
MappingToken envComposite = null,
|
||||
Int32 fileID = default(Int32))
|
||||
{
|
||||
var runsMapping = inputsToken.AssertMapping("runs");
|
||||
var usingToken = default(StringToken);
|
||||
@@ -415,7 +417,7 @@ namespace GitHub.Runner.Worker
|
||||
{
|
||||
var steps = run.Value.AssertSequence("steps");
|
||||
var evaluator = executionContext.ToPipelineTemplateEvaluator();
|
||||
stepsLoaded = evaluator.LoadCompositeSteps(steps);
|
||||
stepsLoaded = evaluator.LoadCompositeSteps(steps, fileID);
|
||||
break;
|
||||
}
|
||||
throw new Exception("You aren't supposed to be using Composite Actions yet!");
|
||||
@@ -477,7 +479,8 @@ namespace GitHub.Runner.Worker
|
||||
return new CompositeActionExecutionData()
|
||||
{
|
||||
Steps = stepsLoaded,
|
||||
Environment = envComposite
|
||||
Environment = envComposite,
|
||||
FileID = fileID
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace GitHub.Runner.Worker.Handlers
|
||||
// Add the composite action environment variables to each step.
|
||||
// If the key already exists, we override it since the composite action env variables will have higher precedence
|
||||
// Note that for each composite action step, it's environment variables will be set in the StepRunner automatically
|
||||
var compositeEnvData = manifestManager.EvaluateCompositeActionEnvironment(ExecutionContext, Data.Environment, extraExpressionValues);
|
||||
var compositeEnvData = manifestManager.EvaluateCompositeActionEnvironment(ExecutionContext, Data.Environment, extraExpressionValues, Data.FileID);
|
||||
var envData = new Dictionary<string, string>();
|
||||
|
||||
// Copy over parent environment
|
||||
@@ -106,7 +106,7 @@ namespace GitHub.Runner.Worker.Handlers
|
||||
actionRunner.Stage = stage;
|
||||
actionRunner.Condition = aStep.Condition;
|
||||
actionRunner.DisplayName = aStep.DisplayName;
|
||||
|
||||
|
||||
ExecutionContext.RegisterNestedStep(actionRunner, inputsData, location, envData);
|
||||
location++;
|
||||
}
|
||||
|
||||
@@ -160,7 +160,8 @@ namespace GitHub.DistributedTask.Pipelines.ObjectTemplating
|
||||
}
|
||||
|
||||
public List<ActionStep> LoadCompositeSteps(
|
||||
TemplateToken token
|
||||
TemplateToken token,
|
||||
Int32 fileID
|
||||
)
|
||||
{
|
||||
var result = default(List<ActionStep>);
|
||||
@@ -170,7 +171,7 @@ namespace GitHub.DistributedTask.Pipelines.ObjectTemplating
|
||||
// TODO: we might want to to have a bool to prevent it from filling in with missing context w/ dummy variables
|
||||
try
|
||||
{
|
||||
token = TemplateEvaluator.Evaluate(context, PipelineTemplateConstants.StepsInTemplate, token, 0, null, omitHeader: true);
|
||||
token = TemplateEvaluator.Evaluate(context, PipelineTemplateConstants.StepsInTemplate, token, 0, fileID, omitHeader: true);
|
||||
context.Errors.Check();
|
||||
result = PipelineTemplateConverter.ConvertToSteps(context, token);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user