Skip to content

Commit

Permalink
fix(deps): update Nuke usage
Browse files Browse the repository at this point in the history
  • Loading branch information
candoumbe committed Dec 3, 2024
1 parent 18bd1b0 commit badddc2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/Candoumbe.Pipelines/Components/IBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public interface IBenchmark : ICompile, IHaveArtifacts
/// </summary>
public sealed Configure<DotNetRunSettings> BenchmarksSettingsBase => _ => _
.SetConfiguration(Configuration)
.SetProcessArgumentConfigurator(args => args.Add("-- --filter {0}", "*", customValue: true)
.Add("--artifacts {0}", BenchmarkResultDirectory)
.SetProcessArgumentConfigurator(args => args.Add("-- --filter *")
.Add($"--artifacts {BenchmarkResultDirectory}")
.Add("--join"));

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Candoumbe.Pipelines/Components/IHaveGitVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public interface IHaveGitVersion : INukeBuild, IRequireNuGetPackage
/// <summary>
/// The GitVersion tool that can be used to version the project
/// </summary>
[GitVersion(Framework = "net6.0")]
[GitVersion(Framework = "net8.0")]
[Required]
public GitVersion GitVersion => TryGetValue(() => GitVersion);

Expand Down
31 changes: 21 additions & 10 deletions src/Candoumbe.Pipelines/Components/IMutationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using Candoumbe.Pipelines.Components.Workflows;
using JetBrains.Annotations;
using Nuke.Common;
using Nuke.Common.Git;
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
using Nuke.Common.Tooling;
Expand Down Expand Up @@ -96,8 +98,8 @@ void RunMutationTestsForTheProject(MutationProjectConfiguration mutationProject,
Verbose("{ProjectName} will run mutation tests for the following frameworks : {@Frameworks}", sourceProject.Name, sourceProject.GetTargetFrameworks());

Arguments args = new();
args = args.Apply(StrykerArgumentsSettingsBase)
.Apply(StrykerArgumentsSettings);
args = StrykerArgumentsSettingsBase.Invoke(args);
args = StrykerArgumentsSettings.Invoke(args);

args.Add("--target-framework {value}", framework)
.Add("--output {value}", MutationTestResultDirectory / sourceProject.Name / framework);
Expand Down Expand Up @@ -185,14 +187,22 @@ void RunMutationTestsForTheProject(MutationProjectConfiguration mutationProject,
});

internal Configure<Arguments> StrykerArgumentsSettingsBase => _
=> _
.When(IsLocalBuild, args => args.Add("--open-report:{value}", "html"))
.WhenNotNull(StrykerDashboardApiKey,
(args, apiKey) => args.Add("--dashboard-api-key {value}", apiKey, secret: true)
.Add("--reporter dashboard"))
.Add("--reporter markdown")
.Add("--reporter html")
.When(IsLocalBuild, args => args.Add("--reporter progress"));
=>
{
Arguments args = new();

if (IsLocalBuild)
{
args = args.Add("--open-report:{value}", "html")
.Add("--reporter progress");
}

return args.WhenNotNull(StrykerArgumentsSettings,
(args, apiKey) => args.Add("--dashboard-api-key {value}", apiKey, secret: true)
.Add("--reporter dashboard"))
.Add("--reporter markdown")
.Add("--reporter html");
};

/// <summary>
/// Configures arguments that will be used by when running Stryker tool
Expand All @@ -203,6 +213,7 @@ void RunMutationTestsForTheProject(MutationProjectConfiguration mutationProject,
/// <summary>
/// Wraps information on mutation tests for a specific project.
/// </summary>
[UsedImplicitly]
public record MutationProjectConfiguration
{
/// <summary>
Expand Down

0 comments on commit badddc2

Please sign in to comment.