Add code coverage#8
Merged
Merged
Conversation
Replace the unmaintained slashmo/install-swift action, which pulled in the deprecated actions/cache@v2 and caused the macOS jobs to hard-fail at "Set up job". macOS now uses the runner's preinstalled Swift 6.3.3 toolchain and Linux runs in the official swift:6.3.3 container. Bump actions/checkout to v4.
Follow the junkbot-swift CI layout: macOS on macos-26 and Linux across a swift:latest + nightly container matrix, each building and testing debug and release with actions/checkout@v4. Remove the Buildroot and Linux armv7 cross-compile workflows, which were failing.
Windows builds and runs the unit tests via compnerd/gha-setup-swift on windows-latest. Android cross-compiles and runs the unit tests on an x86_64 emulator via skiptools/swift-android-action, plus a separate armv7 cross-compile check using the swift.org Android SDK.
The Swift Android SDK installs as a single multi-arch bundle, so the armv7 slice is selected by target triple, not a distinct `swift sdk list` id. Resolve the exact armv7 triple from the installed SDK metadata and pass it to --swift-sdk.
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 code coverage measurement, reporting, and CI enforcement for the package.
Changes
Scripts/coverage.sh— runsswift test --enable-code-coverage, exports an LCOV report (coverage.lcov) and a Cobertura XML report (coverage.xml) scoped to the package's ownSources/, and fails if line coverage drops below a threshold (default passed via CI)..github/workflows/swift.yml— newCode Coveragejob on macOS that runs the gate at 70%, publishes the Cobertura report to GitHub Code Quality for per-PR coverage display, and uploads both reports as build artifacts.Baseline
Current line coverage is 73.19% (980/1339 lines). The CI threshold is set at 70% so it starts green, with room to ratchet up over time.
Raise the bar later by bumping the threshold argument (e.g.
Scripts/coverage.sh 80).