Skip to content

Commit

Permalink
Write test output and coverage to GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nachtjasmin committed Oct 27, 2023
1 parent b5fa23b commit 26ca703
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
29 changes: 28 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,31 @@ jobs:
cache: true
cache-dependency-path: src/**/packages.lock.json
- run: dotnet restore --locked-mode
- run: dotnet test
- name: Run tests with coverage
run: dotnet test /p:CollectCoverage=true --logger trx --results-directory "TestResults"
- name: Upload dotnet test results
uses: actions/upload-artifact@v3
with:
name: dotnet-results
path: TestResults
if: ${{ always() }}

- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: coverage/**/coverage.cobertura.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '60 80'

- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,4 @@ fabric.properties

# End of https://www.toptal.com/developers/gitignore/api/dotnetcore,visualstudiocode,intellij+all
*.DotSettings.user
TestResults/

0 comments on commit 26ca703

Please sign in to comment.