@@ -18,6 +18,8 @@ var testCsproj = File("./src/FluentAssertions.Analyzers.Tests/FluentAssertions.A
1818var nuspecFile = File ( "./src/FluentAssertions.Analyzers/FluentAssertions.Analyzers.nuspec" ) ;
1919var version = GetCurrentVersion ( Context ) ;
2020
21+ var testResults = MakeAbsolute ( buildDir + File ( "./testResults.trx" ) ) ;
22+
2123//////////////////////////////////////////////////////////////////////
2224// TASKS
2325//////////////////////////////////////////////////////////////////////
@@ -62,7 +64,8 @@ Task("Run-Unit-Tests")
6264 DotNetCoreTest ( testCsproj , new DotNetCoreTestSettings
6365 {
6466 Filter = "TestCategory=Completed" ,
65- Configuration = configuration
67+ Configuration = configuration ,
68+ ArgumentCustomization = builder => builder . Append ( $ "--logger \" trx;LogFileName={ testResults } \" ")
6669 } ) ;
6770 } ) ;
6871
@@ -96,12 +99,25 @@ Task("Publish-NuGet")
9699 } ) ;
97100 } ) ;
98101
102+ Task ( "AppVeyor" )
103+ . IsDependentOn ( "Update-Version" )
104+ . IsDependentOn ( "Run-Unit-Tests" )
105+ . IsDependentOn ( "Pack" )
106+ . WithCriteria ( AppVeyor . IsRunningOnAppVeyor )
107+ . Does ( ( ) =>
108+ {
109+ AppVeyor . UploadTestResults ( testResults , AppVeyorTestResultsType . MSTest ) ;
110+
111+ var nugetPackage = MakeAbsolute ( buildDir + File ( $ "./FluentAssertions.Analyzers.{ version } .nupkg") ) ;
112+ AppVeyor . UploadArtifact ( nugetPackage , new AppVeyorUploadArtifactsSettings ( )
113+ . SetArtifactType ( AppVeyorUploadArtifactType . NuGetPackage ) ) ;
114+ } ) ;
115+
99116//////////////////////////////////////////////////////////////////////
100117// TASK TARGETS
101118//////////////////////////////////////////////////////////////////////
102119
103120Task ( "Default" )
104- . IsDependentOn ( "Update-Version" )
105121 . IsDependentOn ( "Build" )
106122 . IsDependentOn ( "Run-Unit-Tests" )
107123 . IsDependentOn ( "Pack" ) ;
0 commit comments