Repository navigation
ci: consumer-test the Swift package, before tagging and after publishing - #8
Merged
Merged
Conversation
package.yml builds the xcframework zip and the generated Swift sources exactly as the release publishes them. The consumer test assembles the package swift-releases will carry, adds it to an empty SPM app package, and runs the README quick start and the consumer contract with xcodebuild test on an iOS simulator. The release tests these files at the release version and publishes exactly them (the checksum comes from the tested zip); verify-published.yml resolves the published version with SPM afterwards and opens a release-broken issue on failure. Fix found by the test: no release up to 2.0.8 compiled. The xcframework's module map was named minigraf_ffiFFI.modulemap, which Clang never finds, so `canImport(minigraf_ffiFFI)` was false and minigraf_ffi.swift failed with "cannot find type 'RustBuffer' in scope". It is now module.modulemap, and Sources/MinigrafKit gets only the Swift file; swift-releases drops the stale header and module map. The release also stamps the README install version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz
adityamukho
force-pushed
the
ci/consumer-tests
branch
from
October 21, 2026 04:56
27f6ae0 to
cec5828
Compare
adityamukho
marked this pull request as ready for review
October 21, 2026 04:56
… version Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz
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.
Step 7 of the binding consumer tests plan (minigraf
docs/superpowers/plans/2026-10-20-binding-consumer-tests.md).What
package.yml(macos-14): runs the device, simulator and lipo builds, bindgen and-create-xcframework. It uploadsdist-xcframework, which holdsMinigrafKit-v<version>.xcframework.zipandSources/minigraf_ffi.swift.consumer-test/run.sh local <dist> <version> | registry <version>sets up an empty SPM app package (consumer-test/App) that depends onminigraf-swift. Then it runsswift package resolveandxcodebuild teston the newest available iPhone simulator.swift-releases: this repo'sPackage.swiftandSources/MinigrafKit, the generated Swift, and the xcframework bypath:..package(url:, exact:); also checks thatPackage.resolvedpins the version under test.QuickstartTestsis the README quick start line for line (readme-sync).ContractTestscovers in-memory, file-backed with a reopen, and the error type (MiniGrafErrorcarrying a[XXX-NNN]code).ci.yml: thepackage,consumerandreadme-syncjobs replace the iOS simulator smoke build.release.yml:testpassesversion.publish(now onubuntu-latest) downloadsdist-xcframeworkand computes the checksum from the tested zip, then writesswift-releases, tags it and uploads that zip. It doesn't rebuild.preparealso stamps the README install version.verify-publishedruns after the upload.verify-published.yml: registry mode onmacos-14, plus therelease-brokenreport job.Fix found by the test: no release up to 2.0.8 compiles
A temporary CI job resolved the published
2.0.8(exact:). It failed to build withminigraf_ffi.swift:14:23: error: cannot find type 'RustBuffer' in scope, and the same forForeignBytes,RustCallStatusand every FFI symbol.The cause: the xcframework's
Headers/held the module map under its generated name,minigraf_ffiFFI.modulemap. Clang finds a module in a header directory only throughmodule.modulemap, so#if canImport(minigraf_ffiFFI)was false and the import was skipped. Now:module.modulemap;Sources/MinigrafKitgets only the.swiftfile;publishreplaces the target's files onswift-releases, so the old.hand.modulemapdon't linger.With that, the iOS simulator run passes all 4 tests (run 39545941139). The temporary job was removed before the final commit. The README now says releases up to v2.0.8 don't compile.
Deviations from the plan
.package(path:)to the assembled tree, withbinaryTarget(path:)inside it, instead of unzipping into the app package. That way it tests thePackage.swiftandSources/that users get.Package.resolved.After merge,
verify-published -f version=2.0.8should fail and open therelease-brokenissue, which stays open until 2.0.9 verifies.🤖 Generated with Claude Code
https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz