From fbc32877b6ed43e224337f64d47b0c29b6d44a1d Mon Sep 17 00:00:00 2001 From: indivar Date: Sat, 24 Jun 2023 22:25:37 +0530 Subject: [PATCH] add(#751): add coverage report --- .github/workflows/test.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f281f977..bf2985f5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,9 @@ on: branches: - master # Only run when PR is raised for master +permissions: + pull-requests: write # for writting comment for coverage + # This ensures for a single PR one job is run in case of multiple runs concurrency: group: build-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -21,3 +24,22 @@ jobs: # Run Tests - name: Run Tests run: docker-compose -f "docker-compose.test.yml" up --build + # Code Coverage + - name: Code Coverage Report + uses: irongut/CodeCoverageSummary@v1.3.0 + with: + filename: ./temp/testresults/coverage.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