To use, we need two steps in our GitHub Actions workflow:
- Update the
dotnet test
step to output a trx formatted file, adding-l:"trx;LogFileName=${{ github.workspace }}/TestOutput.xml"
For example:
- name: .NET test
run: dotnet test src/MyProject.Tests/MyProject.Tests.csproj -l:"trx;LogFileName=${{ github.workspace }}/TestOutput.xml"
- Pass in the trx file path from the test step to this action:
- uses: samsmithnz/DotNetTestResults@0.1.0
with:
fileName: ${{ github.workspace }}/TestOutput.xml