Add Codecov code coverage badge and CI integration - #69
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 existingbuild-testjob:swift test→swift test --enable-code-coverage.profdatato an lcov report viaxcrun llvm-cov export, using-ignore-filename-regex='(\.build|Tests|Demo)/'to exclude test files, the Demo app, and all dependency/build-artifact code.codecov/codecov-action@v5) uploadscoverage.lcov.fail_ci_if_error: falseso CI won't break before Codecov is configured.codecov.yml— second line of defence for the ignore paths (Tests,Demo,.build), plusauto-target project/patch status and comment behavior.README.md— Codecov badge added alongside the CI badge.Coverage scope
Tests run against
ReliaBLEMock, which shares theSources/ReliaBLE/source tree, so coverage maps to the library sources. Per the three-target mock design,CBCentralManagerFactory.swiftis excluded from the mock target and won't appear in coverage, since the productionReliaBLEtarget 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