Skip to content

Commit

Permalink
Merge pull request #10 from dorssel/test_analytics
Browse files Browse the repository at this point in the history
Migrate to Codecov test analytics
  • Loading branch information
dorssel authored Dec 24, 2024
2 parents d346a2f + cf7970b commit 5e48e1b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
7 changes: 7 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
"dotnet-gitversion"
],
"rollForward": false
},
"trx2junit": {
"version": "2.1.0",
"commands": [
"trx2junit"
],
"rollForward": false
}
}
}
25 changes: 16 additions & 9 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:

- name: Install dependencies
run: |
dotnet restore
dotnet tool restore
dotnet restore
- name: Build
run: |
Expand All @@ -57,13 +57,6 @@ jobs:
- name: Package
run: dotnet pack --configuration Release --no-build

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
**/TestResults/*.trx
- name: Upload Package Artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -73,7 +66,21 @@ jobs:
**/*.snupkg
retention-days: 14
- name: Codecov
- name: Convert test results
if: ${{ !cancelled() }}
run: |
find . -name "*.trx" -exec dotnet tool run trx2junit --output TestResults/JUnit {} +
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
fail_ci_if_error: true
files: TestResults/JUnit/*.xml
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ SPDX-License-Identifier: MIT
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<InvariantGlobalization>true</InvariantGlobalization>
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
<SelfContained>false</SelfContained>
<IsPackable>false</IsPackable>
<IsPublishable>false</IsPublishable>
<IsTrimmable>true</IsTrimmable>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\strongname.snk</AssemblyOriginatorKeyFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>CS1591</NoWarn>

<!-- Assembly metadata -->
<Product>gitversion-msbuild</Product>
Expand Down
2 changes: 1 addition & 1 deletion GitVersion.MsBuild/GitVersion.MsBuild.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SPDX-License-Identifier: MIT
<IsPackable>true</IsPackable>
<BuildOutputTargetFolder>tools</BuildOutputTargetFolder>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<NoWarn>NU5128;$(NoWarn)</NoWarn>
<NoWarn>$(NoWarn);CS1591;NU5128</NoWarn>
<PackageId>Dorssel.GitVersion.MsBuild</PackageId>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
Expand Down

0 comments on commit 5e48e1b

Please sign in to comment.