Skip to content

Add Codecov code coverage badge and CI integration - #69

Merged
itsniper merged 1 commit into
masterfrom
claude/codecov-coverage-badge-1i7tdm
Aug 2, 2026
Merged

Add Codecov code coverage badge and CI integration#69
itsniper merged 1 commit into
masterfrom
claude/codecov-coverage-badge-1i7tdm

Conversation

@itsniper

@itsniper itsniper commented Aug 1, 2026

Copy link
Copy Markdown
Member

Adds a code coverage badge to the README next to the existing CI badge, wired into the existing test runner via Codecov.

Changes

  • .github/workflows/ci.yml — coverage tied into the existing build-test job:
    • swift testswift test --enable-code-coverage
    • New Export code coverage step converts the SPM .profdata to an lcov report via xcrun llvm-cov export, using -ignore-filename-regex='(\.build|Tests|Demo)/' to exclude test files, the Demo app, and all dependency/build-artifact code.
    • New Upload coverage to Codecov step (codecov/codecov-action@v5) uploads coverage.lcov. fail_ci_if_error: false so CI won't break before Codecov is configured.
  • codecov.yml — second line of defence for the ignore paths (Tests, Demo, .build), plus auto-target project/patch status and comment behavior.
  • README.md — Codecov badge added alongside the CI badge.

Coverage scope

Tests run against ReliaBLEMock, which shares the Sources/ReliaBLE/ source tree, so coverage maps to the library sources. Per the three-target mock design, CBCentralManagerFactory.swift is excluded from the mock target and won't appear in coverage, since the production ReliaBLE target isn't the one under test — expected given the architecture.

Follow-up required

For uploads and the badge to work, the repo must be enabled on codecov.io and a repository upload token added as a GitHub Actions secret named CODECOV_TOKEN. Until then the badge shows "unknown" and CI stays green.

🤖 Generated with Claude Code


Generated by Claude Code

Enable code coverage in the CI test run, export the results as an lcov
report scoped to the library sources (test files, the Demo app, and
dependencies are filtered out), and upload it to Codecov. Add a codecov.yml
as a second line of defence for the ignore paths and add a coverage badge to
the README next to the CI badge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HBDhen1gvude7r9Yv4FPzP
@itsniper
itsniper merged commit bc6a9ab into master Aug 2, 2026
7 checks passed
@itsniper
itsniper deleted the claude/codecov-coverage-badge-1i7tdm branch August 2, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants