Skip to content

Commit

Permalink
add workflow for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
micha37-martins committed Aug 22, 2024
1 parent 9d0faec commit 82e1462
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/github-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ jobs:
chmod +x ./coverage.sh
bash ./coverage.sh
# Info: sed is used as the js file is no strict json format
- name: Extract coverage percentage from index.js
id: coverage
shell: bash
run: |
coverage=$(jq -r '.files[0].covered' ./coverage/test_smartmon.coverage/index.js)
coverage=$(sed -n '/var data = /,/};/p' ./coverage/test_smartmon.coverage/index.js | sed '1s/.*= //' | sed '$s/};/}/' | jq -r '.files[0].covered')
echo "Extracted coverage percentage: $coverage"
echo "::set-output name=coverage::$coverage"
Expand Down

0 comments on commit 82e1462

Please sign in to comment.