@@ -196,11 +196,47 @@ jobs:
196196
197197 - name : Run tests with coverage
198198 run : pnpm test:coverage
199+ env :
200+ CI : true
201+
202+ - name : Generate coverage summary
203+ if : always()
204+ run : |
205+ echo "## Test Coverage Summary" >> $GITHUB_STEP_SUMMARY
206+ echo "" >> $GITHUB_STEP_SUMMARY
207+ echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
208+
209+ # Extract coverage summary from packages/server
210+ if [ -f packages/server/coverage/coverage-summary.json ]; then
211+ node -e "
212+ const fs = require('fs');
213+ const coverage = JSON.parse(fs.readFileSync('packages/server/coverage/coverage-summary.json', 'utf8'));
214+ const total = coverage.total;
215+
216+ const formatPercent = (pct) => {
217+ const color = pct >= 90 ? '🟢' : pct >= 80 ? '🟡' : '🔴';
218+ return \`\${color} \${pct.toFixed(2)}%\`;
219+ };
220+
221+ console.log('Coverage Summary:');
222+ console.log('');
223+ console.log('Statements :', formatPercent(total.statements.pct));
224+ console.log('Branches :', formatPercent(total.branches.pct));
225+ console.log('Functions :', formatPercent(total.functions.pct));
226+ console.log('Lines :', formatPercent(total.lines.pct));
227+ console.log('');
228+ console.log('Files tested:', Object.keys(coverage).length - 1);
229+ " >> $GITHUB_STEP_SUMMARY
230+ else
231+ echo "Coverage report not found" >> $GITHUB_STEP_SUMMARY
232+ fi
233+
234+ echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
199235
200236 - name : Upload coverage reports
201237 uses : codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5
202238 if : always()
203239 with :
204- files : ./coverage/coverage-final.json
240+ files : ./packages/server/ coverage/coverage-final.json
205241 flags : unittests
206242 name : codecov-curriculum-db
0 commit comments