mirror of
https://github.com/actions/runner.git
synced 2025-12-13 00:36:29 +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.Verbose($"Details: {StringUtil.ConvertToJson(compositeAction.Steps)}");
|
||||||
Trace.Info($"Load: {compositeAction.Environment} environment steps");
|
Trace.Info($"Load: {compositeAction.Environment} environment steps");
|
||||||
Trace.Info($"Details: {StringUtil.ConvertToJson(compositeAction.Environment)}");
|
Trace.Info($"Details: {StringUtil.ConvertToJson(compositeAction.Environment)}");
|
||||||
|
Trace.Info($"Composite Action File ID: {compositeAction.FileID.ToString()}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1288,6 +1289,7 @@ namespace GitHub.Runner.Worker
|
|||||||
public override bool HasPost => false;
|
public override bool HasPost => false;
|
||||||
public List<Pipelines.ActionStep> Steps { get; set; }
|
public List<Pipelines.ActionStep> Steps { get; set; }
|
||||||
public MappingToken Environment { get; set; }
|
public MappingToken Environment { get; set; }
|
||||||
|
public Int32 FileID { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class ActionExecutionData
|
public abstract class ActionExecutionData
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace GitHub.Runner.Worker
|
|||||||
|
|
||||||
Dictionary<string, string> EvaluateContainerEnvironment(IExecutionContext executionContext, MappingToken token, IDictionary<string, PipelineContextData> extraExpressionValues);
|
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);
|
string EvaluateDefaultInput(IExecutionContext executionContext, string inputName, TemplateToken token);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ namespace GitHub.Runner.Worker
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "runs":
|
case "runs":
|
||||||
actionDefinition.Execution = ConvertRuns(executionContext, context, actionPair.Value, envComposite);
|
actionDefinition.Execution = ConvertRuns(executionContext, context, actionPair.Value, envComposite, fileId);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -225,7 +225,8 @@ namespace GitHub.Runner.Worker
|
|||||||
public Dictionary<string, string> EvaluateCompositeActionEnvironment(
|
public Dictionary<string, string> EvaluateCompositeActionEnvironment(
|
||||||
IExecutionContext executionContext,
|
IExecutionContext executionContext,
|
||||||
MappingToken token,
|
MappingToken token,
|
||||||
IDictionary<string, PipelineContextData> extraExpressionValues)
|
IDictionary<string, PipelineContextData> extraExpressionValues,
|
||||||
|
Int32 fileID)
|
||||||
{
|
{
|
||||||
var result = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
var result = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
@@ -234,7 +235,7 @@ namespace GitHub.Runner.Worker
|
|||||||
var context = CreateContext(executionContext, extraExpressionValues);
|
var context = CreateContext(executionContext, extraExpressionValues);
|
||||||
try
|
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();
|
context.Errors.Check();
|
||||||
|
|
||||||
// Mapping
|
// Mapping
|
||||||
@@ -348,7 +349,8 @@ namespace GitHub.Runner.Worker
|
|||||||
IExecutionContext executionContext,
|
IExecutionContext executionContext,
|
||||||
TemplateContext context,
|
TemplateContext context,
|
||||||
TemplateToken inputsToken,
|
TemplateToken inputsToken,
|
||||||
MappingToken envComposite)
|
MappingToken envComposite = null,
|
||||||
|
Int32 fileID = default(Int32))
|
||||||
{
|
{
|
||||||
var runsMapping = inputsToken.AssertMapping("runs");
|
var runsMapping = inputsToken.AssertMapping("runs");
|
||||||
var usingToken = default(StringToken);
|
var usingToken = default(StringToken);
|
||||||
@@ -415,7 +417,7 @@ namespace GitHub.Runner.Worker
|
|||||||
{
|
{
|
||||||
var steps = run.Value.AssertSequence("steps");
|
var steps = run.Value.AssertSequence("steps");
|
||||||
var evaluator = executionContext.ToPipelineTemplateEvaluator();
|
var evaluator = executionContext.ToPipelineTemplateEvaluator();
|
||||||
stepsLoaded = evaluator.LoadCompositeSteps(steps);
|
stepsLoaded = evaluator.LoadCompositeSteps(steps, fileID);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
throw new Exception("You aren't supposed to be using Composite Actions yet!");
|
throw new Exception("You aren't supposed to be using Composite Actions yet!");
|
||||||
@@ -477,7 +479,8 @@ namespace GitHub.Runner.Worker
|
|||||||
return new CompositeActionExecutionData()
|
return new CompositeActionExecutionData()
|
||||||
{
|
{
|
||||||
Steps = stepsLoaded,
|
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.
|
// 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
|
// 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
|
// 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>();
|
var envData = new Dictionary<string, string>();
|
||||||
|
|
||||||
// Copy over parent environment
|
// Copy over parent environment
|
||||||
|
|||||||
@@ -160,7 +160,8 @@ namespace GitHub.DistributedTask.Pipelines.ObjectTemplating
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<ActionStep> LoadCompositeSteps(
|
public List<ActionStep> LoadCompositeSteps(
|
||||||
TemplateToken token
|
TemplateToken token,
|
||||||
|
Int32 fileID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
var result = default(List<ActionStep>);
|
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
|
// TODO: we might want to to have a bool to prevent it from filling in with missing context w/ dummy variables
|
||||||
try
|
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();
|
context.Errors.Check();
|
||||||
result = PipelineTemplateConverter.ConvertToSteps(context, token);
|
result = PipelineTemplateConverter.ConvertToSteps(context, token);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user