@@ -79,28 +79,18 @@ jobs:
7979 console.log(coverage.total.statements.pct + '%');
8080 ")
8181
82- echo "| File | Statements | Branches | Functions | Lines |" >> $GITHUB_STEP_SUMMARY
83- echo "|------|------------ |----------|-----------| -------|" >> $GITHUB_STEP_SUMMARY
82+ echo "| Metric | Coverage |" >> $GITHUB_STEP_SUMMARY
83+ echo "|-------- |----------|" >> $GITHUB_STEP_SUMMARY
8484
85- # Add overall coverage
85+ # Add overall coverage summary
8686 node -e "
8787 const fs = require('fs');
8888 const coverage = JSON.parse(fs.readFileSync('coverage/coverage-summary.json', 'utf8'));
8989 const total = coverage.total;
90- console.log(\`| **Overall** | \${total.statements.pct}% | \${total.branches.pct}% | \${total.functions.pct}% | \${total.lines.pct}% |\`);
91- " >> $GITHUB_STEP_SUMMARY
92-
93- # Add individual file coverage
94- node -e "
95- const fs = require('fs');
96- const coverage = JSON.parse(fs.readFileSync('coverage/coverage-summary.json', 'utf8'));
97- Object.keys(coverage).forEach(file => {
98- if (file !== 'total' && file.includes('src/') && !file.includes('__tests__')) {
99- const filename = file.split('/').pop();
100- const fileCov = coverage[file];
101- console.log(\`| \${filename} | \${fileCov.statements.pct}% | \${fileCov.branches.pct}% | \${fileCov.functions.pct}% | \${fileCov.lines.pct}% |\`);
102- }
103- });
90+ console.log(\`| **Statements** | \${total.statements.pct}% (\${total.statements.covered}/\${total.statements.total}) |\`);
91+ console.log(\`| **Branches** | \${total.branches.pct}% (\${total.branches.covered}/\${total.branches.total}) |\`);
92+ console.log(\`| **Functions** | \${total.functions.pct}% (\${total.functions.covered}/\${total.functions.total}) |\`);
93+ console.log(\`| **Lines** | \${total.lines.pct}% (\${total.lines.covered}/\${total.lines.total}) |\`);
10494 " >> $GITHUB_STEP_SUMMARY
10595 else
10696 OVERALL_COVERAGE="N/A"
0 commit comments