@@ -19,10 +19,14 @@ Setup(
1919 var buildDate = DateTime . UtcNow ;
2020 var runNumber = gh . IsRunningOnGitHubActions
2121 ? gh . Environment . Workflow . RunNumber
22- : ( short ) ( ( buildDate - buildDate . Date ) . TotalSeconds / 3 ) ;
22+ : 0 ;
23+
24+ var suffix = runNumber == 0
25+ ? $ "-{ ( short ) ( ( buildDate - buildDate . Date ) . TotalSeconds / 3 ) } "
26+ : string . Empty ;
2327
2428 var version = FormattableString
25- . Invariant ( $ "{ buildDate : yyyy.M.d} .{ runNumber } ") ;
29+ . Invariant ( $ "{ buildDate : yyyy.M.d} .{ runNumber } { suffix } ") ;
2630
2731 context . Information ( "Building version {0} (Branch: {1}, IsMain: {2})" ,
2832 version ,
@@ -144,6 +148,34 @@ Task("Clean")
144148 . UploadArtifact ( data . ArtifactsPath , $ "Artifact_{ gh . Environment . Runner . ImageOS ?? gh . Environment . Runner . OS } _{ context . Environment . Runtime . BuiltFramework . Identifier } _{ context . Environment . Runtime . BuiltFramework . Version } ")
145149 : throw new Exception ( "GitHubActions not available" )
146150 )
151+ . Then ( "Prepare-Integration-Test" )
152+ . Does < BuildData > (
153+ static ( context , data ) => {
154+ context . CopyDirectory ( data . ProjectRoot . Combine ( "Devlead.Testing.MockHttp.Tests" ) , data . IntegrationTestPath ) ;
155+ context . CopyFile ( data . ProjectRoot . CombineWithFilePath ( "Directory.Packages.props" ) , data . IntegrationTestPath . CombineWithFilePath ( "Directory.Packages.props" ) ) ;
156+ context . CopyFile ( "nuget.config" , data . IntegrationTestPath . CombineWithFilePath ( "nuget.config" ) ) ;
157+ context . DotNetAddPackage (
158+ "Devlead.Testing.MockHttp" ,
159+ new DotNetPackageAddSettings {
160+ EnvironmentVariables = { { "Configuration" , "IntegrationTest" } } ,
161+ WorkingDirectory = data . IntegrationTestPath ,
162+ Version = data . Version ,
163+ Source = data . NuGetOutputPath . FullPath
164+ }
165+ ) ;
166+ }
167+ )
168+ . Then ( "Integration-Test" )
169+ . Does < BuildData > (
170+ static ( context , data ) => {
171+ context . DotNetTest (
172+ data . IntegrationTestPath . FullPath ,
173+ new DotNetTestSettings {
174+ Configuration = "IntegrationTest"
175+ }
176+ ) ;
177+ }
178+ )
147179 . Default ( )
148180. Then ( "Push-GitHub-Packages" )
149181 . WithCriteria < BuildData > ( ( context , data ) => data . ShouldPushGitHubPackages ( ) )
0 commit comments