Skip to content

Commit 781a205

Browse files
committed
ci: Update coverage thresholds and enhance reporting
Update codecov.yml: - Increase project coverage target from 1% to 80% (based on 83.7% baseline) - Set 2% threshold to catch significant coverage drops - Increase patch coverage target to 70% for new code Enhance coverage.yml workflow: - Generate HTML, text, and XML coverage reports with gcovr - Upload reports as GitHub Actions artifacts for easy download - Add coverage summary to PR comments via GITHUB_STEP_SUMMARY - Keep existing Codecov integration This makes coverage more visible and actionable for developers while maintaining the quality bar established by the expanded test suite.
1 parent fc75af0 commit 781a205

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

.github/codecov.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ coverage:
22
status:
33
project:
44
default:
5-
target: 1%
6-
threshold: 1%
5+
target: 80% # Based on 83.7% baseline with -a flag
6+
threshold: 2% # Allow 2% drop (81.7% minimum)
77
patch:
88
default:
9-
target: 1%
10-
threshold: 1%
9+
target: 70% # New code should be reasonably tested
10+
threshold: 10% # Some flexibility for new features

.github/workflows/coverage.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,34 @@ jobs:
4040
- name: Test
4141
run: /bin/bash mfc.sh test -a -j $(nproc)
4242

43+
- name: Generate Coverage Reports
44+
run: |
45+
sudo apt install -y gcovr
46+
gcovr build/staging --root . \
47+
--gcov-executable gcov \
48+
--filter 'src/.*' \
49+
--html --html-details -o coverage_report.html \
50+
--txt -o coverage_summary.txt \
51+
--xml -o coverage.xml \
52+
--print-summary
53+
54+
- name: Upload Coverage Artifacts
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: coverage-report
58+
path: |
59+
coverage_report.html
60+
coverage_summary.txt
61+
coverage.xml
62+
63+
- name: Comment Coverage Summary
64+
if: github.event_name == 'pull_request'
65+
run: |
66+
echo "## 📊 Coverage Summary" >> $GITHUB_STEP_SUMMARY
67+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
68+
cat coverage_summary.txt >> $GITHUB_STEP_SUMMARY
69+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
70+
4371
- name: Upload coverage reports to Codecov
4472
uses: codecov/codecov-action@v4
4573
with:

0 commit comments

Comments
 (0)