From 9d0faec7c6ff93000fbd28bf30401350ba14511a Mon Sep 17 00:00:00 2001 From: micha37-martins Date: Thu, 22 Aug 2024 16:02:10 +0200 Subject: [PATCH] add workflow for coverage --- .github/workflows/github-workflow.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github-workflow.yaml b/.github/workflows/github-workflow.yaml index 3c6e62f..8effe38 100644 --- a/.github/workflows/github-workflow.yaml +++ b/.github/workflows/github-workflow.yaml @@ -45,12 +45,12 @@ jobs: chmod +x ./coverage.sh bash ./coverage.sh - - name: Extract coverage percentage + - name: Extract coverage percentage from index.js id: coverage shell: bash run: | - grep -o 'Overall coverage rate.*' coverage/index.html | grep -o '[0-9]*\.[0-9]*' > coverage.txt - coverage=$(cat coverage.txt) + coverage=$(jq -r '.files[0].covered' ./coverage/test_smartmon.coverage/index.js) + echo "Extracted coverage percentage: $coverage" echo "::set-output name=coverage::$coverage" - name: Update README.md with coverage badge