Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use .NET 8 SDK's artifacts output and enable test reports in CI #23

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,13 @@ jobs:
- name: Test
run: dotnet test --no-build --configuration Release

# TODO: Create a TRX report and upload as an artifact. Tracked by #22.
# - name: Publish Test Report
# uses: dorny/test-reporter@v1
# if: success() || failure()
# with:
# name: .NET Test Report (${{ matrix.os }})
# path: "artifacts/TestResults/**/*.trx"
# reporter: dotnet-trx
# fail-on-error: true
# fail-on-empty: true
- name: Publish Test Report
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: .NET Test Reports (${{ matrix.os }})
path: "artifacts/TestResults/**/*.trx"
if-no-files-found: error

- name: Upload binlogs
uses: actions/upload-artifact@v4
Expand Down
8 changes: 8 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
</PropertyGroup>

<Import Project="build/targets/artifacts/Artifacts.props" />
<Import Project="build/targets/tests/Tests.props" />
</Project>
4 changes: 4 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<Project>
<Import Project="build/targets/artifacts/Artifacts.targets" />
<Import Project="build/targets/tests/Tests.targets" />
</Project>
6 changes: 6 additions & 0 deletions build/targets/artifacts/Artifacts.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<ArtifactsPath>$(RepoRoot)/artifacts</ArtifactsPath>
<ArtifactsTestResultsPath>$(ArtifactsPath)/TestResults</ArtifactsTestResultsPath>
</PropertyGroup>
</Project>
2 changes: 2 additions & 0 deletions build/targets/artifacts/Artifacts.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<Project>
</Project>
2 changes: 2 additions & 0 deletions build/targets/tests/Tests.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<Project>
</Project>
7 changes: 7 additions & 0 deletions build/targets/tests/Tests.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup Condition=" '$(IsTestProject)' == 'true' ">
<!-- Enable test logging to TRX files and place them in the artifacts directory -->
<VSTestLogger>trx%3bLogFileName=$(MSBuildProjectName).trx</VSTestLogger>
<VSTestResultsDirectory Condition="'$(VSTestResultsDirectory)' == ''">$(ArtifactsTestResultsPath)/$(TargetFramework)</VSTestResultsDirectory>
</PropertyGroup>
</Project>
Loading