Skip to content

Commit

Permalink
Add HeadlessRunStep as new GithubActionStep
Browse files Browse the repository at this point in the history
  • Loading branch information
manandre committed Oct 10, 2023
1 parent beb4a86 commit 777410b
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/Nuke/GithubActions/HeadlessRunStep.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
namespace Rocket.Surgery.Nuke.GithubActions;

/// <summary>
/// A wrapper around the SetupXvfb step in order to run commands in headless mode
/// </summary>
[PublicAPI]
public class HeadlessRunStep : UsingStep
{
/// <summary>
/// The default constructor
/// </summary>
/// <param name="name"></param>
public HeadlessRunStep(string name) : base(name)
{
Uses = "coactions/setup-xvfb@v1";
}

Check warning on line 16 in src/Nuke/GithubActions/HeadlessRunStep.cs

View check run for this annotation

Codecov / codecov/patch

src/Nuke/GithubActions/HeadlessRunStep.cs#L13-L16

Added lines #L13 - L16 were not covered by tests

/// <summary>The script to run</summary>
public string Run { get; set; } = null!;

Check warning on line 19 in src/Nuke/GithubActions/HeadlessRunStep.cs

View check run for this annotation

Codecov / codecov/patch

src/Nuke/GithubActions/HeadlessRunStep.cs#L19

Added line #L19 was not covered by tests

/// <summary>
/// The working directory where the script is run
/// </summary>
public string? WorkingDirectory { get; set; }

/// <summary>
/// Options to pass to the xvfb server
/// See https://www.x.org/releases/current/doc/man/man1/Xvfb.1.xhtml#heading4 for the list of supported options
/// </summary>
public string? Options { get; set; }

/// <inheritdoc />
public override void Write(CustomFileWriter writer)
{
WithProperties(x => x.Kebaberize());
base.Write(writer);
}

Check warning on line 37 in src/Nuke/GithubActions/HeadlessRunStep.cs

View check run for this annotation

Codecov / codecov/patch

src/Nuke/GithubActions/HeadlessRunStep.cs#L34-L37

Added lines #L34 - L37 were not covered by tests
}

0 comments on commit 777410b

Please sign in to comment.