-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add HeadlessRunStep as new GithubActionStep
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} | ||
|
||
/// <summary>The script to run</summary> | ||
public string Run { get; set; } = null!; | ||
|
||
/// <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); | ||
} | ||
} |