Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proceed after failed target on independent pipeline
- Loading branch information
Showing
5 changed files
with
96 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using System.Collections.Generic; | ||
using Nuke.Common.CI.GitHubActions; | ||
using Nuke.Common.CI.GitHubActions.Configuration; | ||
using Nuke.Common.Execution; | ||
using Nuke.Common.Utilities; | ||
|
||
class CustomGitHubActionsAttribute : GitHubActionsAttribute | ||
{ | ||
public CustomGitHubActionsAttribute(string name, GitHubActionsImage image, params GitHubActionsImage[] images) : base(name, image, images) | ||
{ | ||
} | ||
|
||
protected override GitHubActionsJob GetJobs(GitHubActionsImage image, IReadOnlyCollection<ExecutableTarget> relevantTargets) | ||
{ | ||
var job = base.GetJobs(image, relevantTargets); | ||
|
||
var newSteps = new List<GitHubActionsStep>(job.Steps); | ||
|
||
// only need to list the ones that are missing from default image | ||
newSteps.Insert(0, new GitHubActionsSetupDotNetStep("2.1.x", "3.1.x", "6.0.x", "7.0.x")); | ||
|
||
job.Steps = newSteps.ToArray(); | ||
return job; | ||
} | ||
} | ||
|
||
class GitHubActionsSetupDotNetStep : GitHubActionsStep | ||
{ | ||
private string[] _versions { get; } | ||
public GitHubActionsSetupDotNetStep(params string[] versions) | ||
{ | ||
_versions = versions; | ||
} | ||
|
||
public override void Write(CustomFileWriter writer) | ||
{ | ||
writer.WriteLine("- uses: actions/setup-dotnet@v3"); | ||
|
||
using (writer.Indent()) | ||
{ | ||
writer.WriteLine("with:"); | ||
using (writer.Indent()) | ||
{ | ||
writer.WriteLine("dotnet-version: |"); | ||
using (writer.Indent()) | ||
{ | ||
foreach (var version in _versions) | ||
{ | ||
writer.WriteLine(version); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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