Skip to content

Commit 950f560

Browse files
committed
Add Test in Build
1 parent d2eb672 commit 950f560

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

.nuke/build.schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"Push",
5656
"PushGithubNuget",
5757
"Restore",
58+
"Test",
5859
"VerifyFormat"
5960
]
6061
},

build/Build.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,22 @@ class Build : NukeBuild
103103
.EnableNoRestore());
104104
});
105105

106+
Target Test => _ => _
107+
.DependsOn(Compile)
108+
.Executes(() =>
109+
{
110+
var projects = Solution.GetAllProjects("*.Tests");
111+
112+
foreach (var project in projects)
113+
{
114+
DotNetTest(_ => _
115+
.SetProjectFile(project.Path)
116+
.SetConfiguration(Configuration)
117+
.EnableNoBuild()
118+
);
119+
}
120+
});
121+
106122
Target Pack => _ => _
107123
.After(Compile)
108124
.Produces(PackagesDirectory / "*.nupkg")

0 commit comments

Comments
 (0)