Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/check_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,32 @@ jobs:
echo "--- v2 filename samples ---"
grep 'filename=' v2/zig-out/kcov/kcov-merged/cobertura.xml | head -3

- name: Generate local coverage report
if: github.event_name == 'pull_request'
run: |
pip install --quiet diff-cover==10.3.0
# Determine the base branch to diff against
BASE_REF="origin/${{ github.base_ref }}"
echo "Comparing coverage against $BASE_REF"

# Run diff-cover on both v1 and v2 cobertura reports
diff-cover \
kcov-merged/kcov-merged/cobertura.xml \
v2/zig-out/kcov/kcov-merged/cobertura.xml \
--compare-branch="$BASE_REF" \
--format markdown:diff-coverage.md \
--fail-under 0

# Output to GitHub step summary
if [ -f diff-coverage.md ]; then
echo "## Patch Coverage Report" >> "$GITHUB_STEP_SUMMARY"
cat diff-coverage.md >> "$GITHUB_STEP_SUMMARY"
else
echo "⚠️ diff-cover produced no output" >> "$GITHUB_STEP_SUMMARY"
fi

- name: Upload coverage to Codecov
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
Expand Down
Loading