mirror of
https://github.com/actions/runner.git
synced 2025-12-29 21:07:42 +08:00
Starting framework
This commit is contained in:
@@ -325,7 +325,7 @@ namespace GitHub.Runner.Worker
|
||||
var postToken = default(StringToken);
|
||||
var postEntrypointToken = default(StringToken);
|
||||
var postIfToken = default(StringToken);
|
||||
var stepsLoaded = default(List<Pipelines.ActionStep>);
|
||||
var stepsLoaded = default(List<Pipelines.Step>);
|
||||
|
||||
foreach (var run in runsMapping)
|
||||
{
|
||||
|
||||
@@ -48,50 +48,68 @@ namespace GitHub.Runner.Worker.Handlers
|
||||
// Add each composite action step to the front of the queue
|
||||
int location = 0;
|
||||
|
||||
|
||||
|
||||
// While loop till we have reached the last layer?
|
||||
Stack<Pipelines.Step> stepsToAppend = new Stack<Pipelines.Step>();
|
||||
// TODO: Assume that each step is not an actionStep
|
||||
// How do we handle all types of steps?????
|
||||
|
||||
foreach (Pipelines.ActionStep aStep in actionSteps)
|
||||
|
||||
// Append in reverse order since we are using a stack
|
||||
for (int i = actionSteps.Count - 1; i --> 0; )
|
||||
{
|
||||
// Ex:
|
||||
// runs:
|
||||
// using: "composite"
|
||||
// steps:
|
||||
// - uses: example/test-composite@v2 (a)
|
||||
// - run echo hello world (b)
|
||||
// - run echo hello world 2 (c)
|
||||
//
|
||||
// ethanchewy/test-composite/action.yaml
|
||||
// runs:
|
||||
// using: "composite"
|
||||
// steps:
|
||||
// - run echo hello world 3 (d)
|
||||
// - run echo hello world 4 (e)
|
||||
//
|
||||
// Steps processed as follow:
|
||||
// | a |
|
||||
// | a | => | d |
|
||||
// (Run step d)
|
||||
// | a |
|
||||
// | a | => | e |
|
||||
// (Run step e)
|
||||
// | a |
|
||||
// (Run step a)
|
||||
// | b |
|
||||
// (Run step b)
|
||||
// | c |
|
||||
// (Run step c)
|
||||
// Done.
|
||||
|
||||
var actionRunner = HostContext.CreateService<IActionRunner>();
|
||||
actionRunner.Action = aStep;
|
||||
actionRunner.Stage = stage;
|
||||
actionRunner.Condition = aStep.Condition;
|
||||
actionRunner.DisplayName = aStep.DisplayName;
|
||||
|
||||
ExecutionContext.RegisterNestedStep(actionRunner, inputsData, location, Environment);
|
||||
location++;
|
||||
stepsToAppend.Append(actionSteps[i]);
|
||||
}
|
||||
while (stepsToAppend != null)
|
||||
{
|
||||
var currentStep = stepsToAppend.Pop();
|
||||
}
|
||||
|
||||
// foreach (Pipelines.Step aStep in actionSteps)
|
||||
// {
|
||||
// // Ex:
|
||||
// // runs:
|
||||
// // using: "composite"
|
||||
// // steps:
|
||||
// // - uses: example/test-composite@v2 (a)
|
||||
// // - run echo hello world (b)
|
||||
// // - run echo hello world 2 (c)
|
||||
// //
|
||||
// // ethanchewy/test-composite/action.yaml
|
||||
// // runs:
|
||||
// // using: "composite"
|
||||
// // steps:
|
||||
// // - run echo hello world 3 (d)
|
||||
// // - run echo hello world 4 (e)
|
||||
// //
|
||||
// // Steps processed as follow:
|
||||
// // | a |
|
||||
// // | a | => | d |
|
||||
// // (Run step d)
|
||||
// // | a |
|
||||
// // | a | => | e |
|
||||
// // (Run step e)
|
||||
// // | a |
|
||||
// // (Run step a)
|
||||
// // | b |
|
||||
// // (Run step b)
|
||||
// // | c |
|
||||
// // (Run step c)
|
||||
// // Done.
|
||||
|
||||
// // TODO: how are we going to order each step?
|
||||
// // How is this going to look in the UI (will we have a bunch of nesting)
|
||||
// // ^ We need to focus on how we are going to get the steps to run in the right order.
|
||||
|
||||
// var actionRunner = HostContext.CreateService<IActionRunner>();
|
||||
// actionRunner.Action = aStep;
|
||||
// actionRunner.Stage = stage;
|
||||
// actionRunner.Condition = aStep.Condition;
|
||||
// actionRunner.DisplayName = aStep.DisplayName;
|
||||
|
||||
// ExecutionContext.RegisterNestedStep(actionRunner, inputsData, location, Environment);
|
||||
// location++;
|
||||
// }
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user