File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,17 @@ jobs:
3737
3838 - name : Parse Coverage and Write Summary
3939 run : |
40- TOTAL=$(xmllint --xpath 'string(/coverage/@line-rate)' coverage.xml)
41- PERCENTAGE=$(echo "$TOTAL * 100" | bc)
42- echo "| Metric | Value |" >> $GITHUB_STEP_SUMMARY
43- echo "|--------|-----|" >> $GITHUB_STEP_SUMMARY
44- echo "| 📊 Line Coverage | ${PERCENTAGE}% |" >> $GITHUB_STEP_SUMMARY
40+ poetry run python -c "
41+ import xml.etree.ElementTree as ET
42+ tree = ET.parse('coverage.xml')
43+ root = tree.getroot()
44+ line_rate = float(root.attrib['line-rate'])
45+ percentage = line_rate * 100
46+ with open('${{ github.step_summary }}', 'a') as f:
47+ f.write('| Metric | Value |\n')
48+ f.write('|--------|-----|\n')
49+ f.write(f'| 📊 Line Coverage | {percentage:.2f}% |\n')
50+ "
4551
4652 - name : Publish Test Results Summary
4753 uses : test-summary/action@v2
You can’t perform that action at this time.
0 commit comments