-
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.
Added trigger values to the attributes, and concurrency / default con… (
#1162) * Added trigger values to the attributes, and concurrency / default configurations * Updated default concurrency for lint
- Loading branch information
1 parent
39726ba
commit 0c9b669
Showing
16 changed files
with
268 additions
and
44 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
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
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
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
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
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
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
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
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
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
34 changes: 34 additions & 0 deletions
34
src/Nuke/GithubActions/RocketSurgeonsGithubActionsConcurrency.cs
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,34 @@ | ||
using Nuke.Common.CI; | ||
|
||
namespace Rocket.Surgery.Nuke.GithubActions; | ||
|
||
/// <summary> | ||
/// The concurrency settings for a workflow or job | ||
/// </summary> | ||
public class RocketSurgeonsGithubActionsConcurrency : ConfigurationEntity | ||
{ | ||
/// <summary> | ||
/// The concurrency group | ||
/// </summary> | ||
public string? Group { get; set; } | ||
|
||
/// <summary> | ||
/// Cancel existing jobs | ||
/// </summary> | ||
public bool? CancelInProgress { get; set; } | ||
|
||
/// <inheritdoc /> | ||
public override void Write(CustomFileWriter writer) | ||
{ | ||
using var _ = writer.Indent(); | ||
if (!string.IsNullOrWhiteSpace(Group)) | ||
{ | ||
writer.WriteValue(new("group", Group)); | ||
} | ||
|
||
if (CancelInProgress.HasValue) | ||
{ | ||
writer.WriteLine($"cancel-in-progress: {CancelInProgress.Value.ToString().ToLowerInvariant()}"); | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/Nuke/GithubActions/RocketSurgeonsGithubActionsDefaults.cs
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,23 @@ | ||
using Nuke.Common.CI; | ||
|
||
namespace Rocket.Surgery.Nuke.GithubActions; | ||
|
||
/// <summary> | ||
/// The job defaults | ||
/// </summary> | ||
public class RocketSurgeonsGithubActionsDefaults : ConfigurationEntity | ||
{ | ||
/// <summary> | ||
/// The defaults of run | ||
/// </summary> | ||
public RocketSurgeonsGithubActionsDefaultsRun? Run { get; set; } | ||
|
||
/// <inheritdoc /> | ||
public override void Write(CustomFileWriter writer) | ||
{ | ||
using var _ = writer.Indent(); | ||
if (Run is null) return; | ||
writer.WriteLine("run:"); | ||
Run.Write(writer); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/Nuke/GithubActions/RocketSurgeonsGithubActionsDefaultsRun.cs
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,28 @@ | ||
using Nuke.Common.CI; | ||
|
||
namespace Rocket.Surgery.Nuke.GithubActions; | ||
|
||
/// <summary> | ||
/// The job run defaults | ||
/// </summary> | ||
public class RocketSurgeonsGithubActionsDefaultsRun : ConfigurationEntity | ||
{ | ||
/// <summary> | ||
/// The shell | ||
/// </summary> | ||
public GithubActionShell? Shell { get; set; } | ||
|
||
/// <summary> | ||
/// The working directory where the script is run | ||
/// </summary> | ||
public string? WorkingDirectory { get; set; } | ||
|
||
public override void Write(CustomFileWriter writer) | ||
{ | ||
using var _ = writer.Indent(); | ||
if (!string.IsNullOrWhiteSpace(WorkingDirectory)) | ||
writer.WriteLine($"working-directory: {WorkingDirectory}"); | ||
if (!string.IsNullOrWhiteSpace(Shell?.ToString())) | ||
writer.WriteLine($"shell: {Shell}"); | ||
} | ||
} |
Oops, something went wrong.