Skip to content

Commit

Permalink
Add support for GitHubActionsTestLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
xoofx committed Oct 7, 2023
1 parent d55d967 commit 8f50b8a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/dotnet-releaser/ReleaserApp.BuildAndTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ private async Task<bool> RunTest(string projectFile, string configuration)
var runner = new DotNetRunner("test");
runner.Arguments.Add("--no-restore"); // Because we ran it just before
runner.Arguments.Add("--no-build"); // Because we ran it just before
runner.Arguments.Add("--logger");
runner.Arguments.Add("GitHubActions");
runner.Arguments.Add("--configuration");
runner.Arguments.Add($"{configuration}");
runner.Arguments.Add(projectFile);
Expand Down
19 changes: 19 additions & 0 deletions src/dotnet-releaser/dotnet-releaser.targets
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,25 @@
</When>
</Choose>

<Choose>
<When Condition="'$(ManagePackageVersionsCentrally)' == 'true' AND '$(CentralPackageVersionsFileImported)' == 'true' AND '$(IsTestProject)' == 'true'">
<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" VersionOverride="2.3.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</When>
<When Condition="'$(IsTestProject)' == 'true'">
<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</When>
</Choose>

<!--<Target Name="CreateSetup" AfterTargets="Publish">
<PropertyGroup>
<PublishDirFullPath>$([System.IO.Path]::GetFullPath('$(PublishDir)'))</PublishDirFullPath>
Expand Down

0 comments on commit 8f50b8a

Please sign in to comment.