33using Nuke . Common . CI . GitHubActions ;
44using Nuke . Common . IO ;
55using Nuke . Common . ProjectModel ;
6+ using Nuke . Common . Tooling ;
67using Nuke . Common . Tools . DotNet ;
78using Nuke . Common . Tools . GitHub ;
89using Nuke . Common . Tools . NuGet ;
1516using System . IO ;
1617using System . Linq ;
1718
18- using static Nuke . Common . IO . FileSystemTasks ;
1919using static Nuke . Common . IO . PathConstruction ;
2020using static Nuke . Common . Tools . DotNet . DotNetTasks ;
2121// ReSharper disable ArrangeThisQualifier
@@ -116,15 +116,15 @@ protected override void OnBuildInitialized()
116116 Target Restore => _ => _
117117 . Executes ( ( ) =>
118118 {
119- DotNetRestore ( s => s . SetProjectFile ( Solution . Path ) ) ;
119+ DotNetRestore ( s => s . SetProjectFile ( Solution ) ) ;
120120 } ) ;
121121
122122 Target Compile => _ => _
123123 . DependsOn ( Restore )
124124 . Executes ( ( ) =>
125125 {
126126 DotNetBuild ( s => s
127- . SetProjectFile ( Solution . Path )
127+ . SetProjectFile ( Solution )
128128 . SetConfiguration ( Configuration )
129129 . SetProperty ( "GeneratePackageOnBuild" , "True" )
130130 . SetProperty ( "VersionPostFix" , VersionPostFix ?? string . Empty ) ) ;
@@ -134,18 +134,17 @@ protected override void OnBuildInitialized()
134134 . DependsOn ( Compile )
135135 . Executes ( ( ) =>
136136 {
137- // There aren't any yet
138- } ) ;
137+ var TestProject = SourceDirectory / "ElectronNET.IntegrationTests" / "ElectronNET.IntegrationTests.csproj" ;
139138
140- Target CreatePackages => _ => _
141- . DependsOn ( Compile )
142- . Executes ( ( ) =>
143- {
144- // Packages are created on build
139+ DotNetTest ( s => s
140+ . SetProjectFile ( TestProject )
141+ . SetConfiguration ( Configuration )
142+ . When ( _ => GitHubActions . Instance is not null , x => x . SetLoggers ( "GitHubActions" ) )
143+ ) ;
145144 } ) ;
146145
147146 Target PublishPackages => _ => _
148- . DependsOn ( CreatePackages )
147+ . DependsOn ( Compile )
149148 . DependsOn ( RunUnitTests )
150149 . Executes ( ( ) =>
151150 {
@@ -240,7 +239,7 @@ protected override void OnBuildInitialized()
240239
241240 Target Package => _ => _
242241 . DependsOn ( RunUnitTests )
243- . DependsOn ( CreatePackages ) ;
242+ . DependsOn ( Compile ) ;
244243
245244 Target Default => _ => _
246245 . DependsOn ( Package ) ;
0 commit comments