Skip to content

Commit

Permalink
add code coverage in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Khant authored and Khant committed Aug 3, 2024
1 parent 5001cae commit 20ac7df
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,43 @@ jobs:
run: dotnet restore --no-cache --disable-parallel --verbosity minimal

- name: Build
run: dotnet build
run: dotnet build --configuration Release --no-restore

- name: Test
run: dotnet test
run: dotnet test --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage

code-coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout
with:
fetch-depth: 0

- name: Setup dotnet 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
cache: true
cache-dependency-path: "**/packages.lock.json"

- 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

0 comments on commit 20ac7df

Please sign in to comment.