From d9a51b0b776dc2e2a32d57984645e5a161328a54 Mon Sep 17 00:00:00 2001 From: Lucas Li Date: Tue, 17 Sep 2024 22:35:27 -0700 Subject: [PATCH] fix formate --- .github/workflows/test.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 106cfe95..714e67a6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,10 +54,12 @@ jobs: # Ensure coverage meets the required threshold - name: Check code coverage run: | - if grep -q '"statements":{.*"pct": \([8-9][0-9]\|100\)' coverage/wfprev/coverage-summary.json; then - echo "Test passed"; + statements_pct=$(jq '.total.statements.pct' coverage/wfprev/coverage-summary.json) + + if (( $(echo "$statements_pct >= 80" | bc -l) )); then + echo "Test passed. Code coverage for statements is $statements_pct%"; else - echo "Code coverage is less than 80%! Exiting..."; + echo "Code coverage for statements is less than 80%! Exiting... ($statements_pct%)"; exit 1; fi working-directory: client/wfprev-war/src/main/angular