Compare commits

..

1 Commits

Author SHA1 Message Date
Tingluo Huang
ae543d5975 release 2.272.0 runner 2020-07-29 15:32:44 -04:00
6 changed files with 30 additions and 30 deletions

View File

@@ -1 +1 @@
<Update to ./src/runnerversion when creating release> 2.272.0

View File

@@ -462,14 +462,13 @@ Options:
--commit Prints the runner commit --commit Prints the runner commit
Config Options: Config Options:
--unattended Disable interactive prompts for missing arguments. Defaults will be used for missing options --unattended Disable interactive prompts for missing arguments. Defaults will be used for missing options
--url string Repository to add the runner to. Required if unattended --url string Repository to add the runner to. Required if unattended
--token string Registration token. Required if unattended --token string Registration token. Required if unattended
--name string Name of the runner to configure (default {Environment.MachineName ?? "myrunner"}) --name string Name of the runner to configure (default {Environment.MachineName ?? "myrunner"})
--runnergroup string Name of the runner group to add this runner to (defaults to the default runner group) --labels string Extra labels in addition to the default: 'self-hosted,{Constants.Runner.Platform},{Constants.Runner.PlatformArchitecture}'
--labels string Extra labels in addition to the default: 'self-hosted,{Constants.Runner.Platform},{Constants.Runner.PlatformArchitecture}' --work string Relative runner work directory (default {Constants.Path.WorkDirectory})
--work string Relative runner work directory (default {Constants.Path.WorkDirectory}) --replace Replace any existing runner with the same name (default false)");
--replace Replace any existing runner with the same name (default false)");
#if OS_WINDOWS #if OS_WINDOWS
_term.WriteLine($@" --runasservice Run the runner as a service"); _term.WriteLine($@" --runasservice Run the runner as a service");
_term.WriteLine($@" --windowslogonaccount string Account to run the service as. Requires runasservice"); _term.WriteLine($@" --windowslogonaccount string Account to run the service as. Requires runasservice");

View File

@@ -53,7 +53,7 @@ namespace GitHub.Runner.Worker
JobContext JobContext { get; } JobContext JobContext { get; }
// Only job level ExecutionContext has JobSteps // Only job level ExecutionContext has JobSteps
Queue<IStep> JobSteps { get; } List<IStep> JobSteps { get; }
// Only job level ExecutionContext has PostJobSteps // Only job level ExecutionContext has PostJobSteps
Stack<IStep> PostJobSteps { get; } Stack<IStep> PostJobSteps { get; }
@@ -144,7 +144,7 @@ namespace GitHub.Runner.Worker
public GlobalContext Global { get; private set; } public GlobalContext Global { get; private set; }
// Only job level ExecutionContext has JobSteps // Only job level ExecutionContext has JobSteps
public Queue<IStep> JobSteps { get; private set; } public List<IStep> JobSteps { get; private set; }
// Only job level ExecutionContext has PostJobSteps // Only job level ExecutionContext has PostJobSteps
public Stack<IStep> PostJobSteps { get; private set; } public Stack<IStep> PostJobSteps { get; private set; }
@@ -663,7 +663,7 @@ namespace GitHub.Runner.Worker
Global.PrependPath = new List<string>(); Global.PrependPath = new List<string>();
// JobSteps for job ExecutionContext // JobSteps for job ExecutionContext
JobSteps = new Queue<IStep>(); JobSteps = new List<IStep>();
// PostJobSteps for job ExecutionContext // PostJobSteps for job ExecutionContext
PostJobSteps = new Stack<IStep>(); PostJobSteps = new Stack<IStep>();

View File

@@ -152,7 +152,7 @@ namespace GitHub.Runner.Worker
{ {
foreach (var step in jobSteps) foreach (var step in jobSteps)
{ {
jobContext.JobSteps.Enqueue(step); jobContext.JobSteps.Add(step);
} }
await stepsRunner.RunAsync(jobContext); await stepsRunner.RunAsync(jobContext);

View File

@@ -59,13 +59,14 @@ namespace GitHub.Runner.Worker
checkPostJobActions = true; checkPostJobActions = true;
while (jobContext.PostJobSteps.TryPop(out var postStep)) while (jobContext.PostJobSteps.TryPop(out var postStep))
{ {
jobContext.JobSteps.Enqueue(postStep); jobContext.JobSteps.Add(postStep);
} }
continue; continue;
} }
var step = jobContext.JobSteps.Dequeue(); var step = jobContext.JobSteps[0];
jobContext.JobSteps.RemoveAt(0);
Trace.Info($"Processing step: DisplayName='{step.DisplayName}'"); Trace.Info($"Processing step: DisplayName='{step.DisplayName}'");
ArgUtil.NotNull(step.ExecutionContext, nameof(step.ExecutionContext)); ArgUtil.NotNull(step.ExecutionContext, nameof(step.ExecutionContext));
@@ -108,11 +109,11 @@ namespace GitHub.Runner.Worker
// the server will never send an empty context name. Generated context names start with "__" // the server will never send an empty context name. Generated context names start with "__"
if (step.ExecutionContext.Global.Variables.GetBoolean("DistributedTask.UseContextNameForGITHUBACTION") ?? false) if (step.ExecutionContext.Global.Variables.GetBoolean("DistributedTask.UseContextNameForGITHUBACTION") ?? false)
{ {
step.ExecutionContext.SetGitHubContext("action", step.ExecutionContext.GetFullyQualifiedContextName()); step.ExecutionContext.SetGitHubContext("action", actionStep.Action.Name);
} }
else else
{ {
step.ExecutionContext.SetGitHubContext("action", actionStep.Action.Name); step.ExecutionContext.SetGitHubContext("action", step.ExecutionContext.GetFullyQualifiedContextName());
} }
try try

View File

@@ -82,7 +82,7 @@ namespace GitHub.Runner.Common.Tests.Worker
{ {
_ec.Object.Result = null; _ec.Object.Result = null;
_ec.Setup(x => x.JobSteps).Returns(new Queue<IStep>(variableSet.Select(x => x.Object).ToList())); _ec.Setup(x => x.JobSteps).Returns(new List<IStep>(variableSet.Select(x => x.Object).ToList()));
// Act. // Act.
await _stepsRunner.RunAsync(jobContext: _ec.Object); await _stepsRunner.RunAsync(jobContext: _ec.Object);
@@ -117,7 +117,7 @@ namespace GitHub.Runner.Common.Tests.Worker
{ {
_ec.Object.Result = null; _ec.Object.Result = null;
_ec.Setup(x => x.JobSteps).Returns(new Queue<IStep>(variableSet.Select(x => x.Object).ToList())); _ec.Setup(x => x.JobSteps).Returns(new List<IStep>(variableSet.Select(x => x.Object).ToList()));
// Act. // Act.
await _stepsRunner.RunAsync(jobContext: _ec.Object); await _stepsRunner.RunAsync(jobContext: _ec.Object);
@@ -156,7 +156,7 @@ namespace GitHub.Runner.Common.Tests.Worker
{ {
_ec.Object.Result = null; _ec.Object.Result = null;
_ec.Setup(x => x.JobSteps).Returns(new Queue<IStep>(variableSet.Steps.Select(x => x.Object).ToList())); _ec.Setup(x => x.JobSteps).Returns(new List<IStep>(variableSet.Steps.Select(x => x.Object).ToList()));
// Act. // Act.
await _stepsRunner.RunAsync(jobContext: _ec.Object); await _stepsRunner.RunAsync(jobContext: _ec.Object);
@@ -210,7 +210,7 @@ namespace GitHub.Runner.Common.Tests.Worker
{ {
_ec.Object.Result = null; _ec.Object.Result = null;
_ec.Setup(x => x.JobSteps).Returns(new Queue<IStep>(variableSet.Steps.Select(x => x.Object).ToList())); _ec.Setup(x => x.JobSteps).Returns(new List<IStep>(variableSet.Steps.Select(x => x.Object).ToList()));
// Act. // Act.
await _stepsRunner.RunAsync(jobContext: _ec.Object); await _stepsRunner.RunAsync(jobContext: _ec.Object);
@@ -289,7 +289,7 @@ namespace GitHub.Runner.Common.Tests.Worker
{ {
_ec.Object.Result = null; _ec.Object.Result = null;
_ec.Setup(x => x.JobSteps).Returns(new Queue<IStep>(variableSet.Steps.Select(x => x.Object).ToList())); _ec.Setup(x => x.JobSteps).Returns(new List<IStep>(variableSet.Steps.Select(x => x.Object).ToList()));
// Act. // Act.
await _stepsRunner.RunAsync(jobContext: _ec.Object); await _stepsRunner.RunAsync(jobContext: _ec.Object);
@@ -332,7 +332,7 @@ namespace GitHub.Runner.Common.Tests.Worker
{ {
_ec.Object.Result = null; _ec.Object.Result = null;
_ec.Setup(x => x.JobSteps).Returns(new Queue<IStep>(variableSet.Step.Select(x => x.Object).ToList())); _ec.Setup(x => x.JobSteps).Returns(new List<IStep>(variableSet.Step.Select(x => x.Object).ToList()));
// Act. // Act.
await _stepsRunner.RunAsync(jobContext: _ec.Object); await _stepsRunner.RunAsync(jobContext: _ec.Object);
@@ -363,7 +363,7 @@ namespace GitHub.Runner.Common.Tests.Worker
{ {
_ec.Object.Result = null; _ec.Object.Result = null;
_ec.Setup(x => x.JobSteps).Returns(new Queue<IStep>(variableSet.Select(x => x.Object).ToList())); _ec.Setup(x => x.JobSteps).Returns(new List<IStep>(variableSet.Select(x => x.Object).ToList()));
// Act. // Act.
await _stepsRunner.RunAsync(jobContext: _ec.Object); await _stepsRunner.RunAsync(jobContext: _ec.Object);
@@ -393,7 +393,7 @@ namespace GitHub.Runner.Common.Tests.Worker
{ {
_ec.Object.Result = null; _ec.Object.Result = null;
_ec.Setup(x => x.JobSteps).Returns(new Queue<IStep>(variableSet.Select(x => x.Object).ToList())); _ec.Setup(x => x.JobSteps).Returns(new List<IStep>(variableSet.Select(x => x.Object).ToList()));
// Act. // Act.
await _stepsRunner.RunAsync(jobContext: _ec.Object); await _stepsRunner.RunAsync(jobContext: _ec.Object);
@@ -419,7 +419,7 @@ namespace GitHub.Runner.Common.Tests.Worker
_ec.Object.Result = null; _ec.Object.Result = null;
_ec.Setup(x => x.JobSteps).Returns(new Queue<IStep>(new[] { step1.Object })); _ec.Setup(x => x.JobSteps).Returns(new List<IStep>(new[] { step1.Object }));
// Act. // Act.
await _stepsRunner.RunAsync(jobContext: _ec.Object); await _stepsRunner.RunAsync(jobContext: _ec.Object);
@@ -457,7 +457,7 @@ namespace GitHub.Runner.Common.Tests.Worker
_ec.Object.Result = null; _ec.Object.Result = null;
_ec.Setup(x => x.JobSteps).Returns(new Queue<IStep>(new[] { step1.Object, step2.Object })); _ec.Setup(x => x.JobSteps).Returns(new List<IStep>(new[] { step1.Object, step2.Object }));
// Act. // Act.
await _stepsRunner.RunAsync(jobContext: _ec.Object); await _stepsRunner.RunAsync(jobContext: _ec.Object);
@@ -495,7 +495,7 @@ namespace GitHub.Runner.Common.Tests.Worker
_ec.Object.Result = null; _ec.Object.Result = null;
_ec.Setup(x => x.JobSteps).Returns(new Queue<IStep>(new[] { step1.Object, step2.Object })); _ec.Setup(x => x.JobSteps).Returns(new List<IStep>(new[] { step1.Object, step2.Object }));
// Act. // Act.
await _stepsRunner.RunAsync(jobContext: _ec.Object); await _stepsRunner.RunAsync(jobContext: _ec.Object);
@@ -526,7 +526,7 @@ namespace GitHub.Runner.Common.Tests.Worker
_ec.Object.Result = null; _ec.Object.Result = null;
_ec.Setup(x => x.JobSteps).Returns(new Queue<IStep>(new[] { step1.Object, step2.Object, step3.Object })); _ec.Setup(x => x.JobSteps).Returns(new List<IStep>(new[] { step1.Object, step2.Object, step3.Object }));
// Act. // Act.
await _stepsRunner.RunAsync(jobContext: _ec.Object); await _stepsRunner.RunAsync(jobContext: _ec.Object);
@@ -562,7 +562,7 @@ namespace GitHub.Runner.Common.Tests.Worker
_ec.Object.Result = null; _ec.Object.Result = null;
_ec.Setup(x => x.JobSteps).Returns(new Queue<IStep>(new[] { step1.Object, step2.Object, step3.Object })); _ec.Setup(x => x.JobSteps).Returns(new List<IStep>(new[] { step1.Object, step2.Object, step3.Object }));
// Act. // Act.
await _stepsRunner.RunAsync(jobContext: _ec.Object); await _stepsRunner.RunAsync(jobContext: _ec.Object);