ci: add iOS Build + Test GitHub Actions workflow#20
Closed
DocNR wants to merge 4 commits into
Closed
Conversation
Runs xcodebuild test on every PR and on main pushes. Catches the kind of failures that aren't visible from local Xcode alone: - Missing pbxproj entries for new Swift files (almost shipped a broken PR #19 due to this — the new ActivitySummary.swift / Nip19.swift needed manual entries in 5 places across the pbxproj). - Test regressions before merge. - Build breakage from Swift / Xcode version drift on the runner image. Workflow notes: - Picks the first available iPhone simulator at runtime instead of pinning to a specific name — runner images bump iPhone generations periodically and a hardcoded name (e.g. iPhone 17) breaks the workflow on rollover. - `concurrency` cancels stale runs on the same ref so we don't burn macOS minutes on superseded commits. - Uploads the xcresult bundle as an artifact only on failure (14-day retention) so test failures can be opened in Xcode locally. - Disables code signing in CI — we're only running unit tests on the simulator, no archive / distribution. Once this lands and runs green at least once, set as a required status check on `main` via: gh api repos/DocNR/clave/branches/main/protection/required_status_checks \ --method PATCH -f strict=true -F 'contexts[]=Build + unit tests' Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… app ClaveTests inherited the project-level baseline of iOS 26.4. The main app and NSE both override to 17.6. CI runner (macos-latest, Xcode 16.4, iOS Simulator 26.2) failed: Cannot test target "ClaveTests" on "iPhone 16 Pro": iPhone 16 Pro's iOS Simulator 26.2 doesn't match ClaveTests's iOS Simulator 26.4 deployment target. Tests should match the main app's deployment target so they exercise the same constraints as production. The previous 26.4 was likely an auto-bump artifact when the project was opened in a newer Xcode. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Xcode 14+ requires explicit user approval for SwiftPM plugins (security feature). Local devs click 'Trust & Enable' once; CI needs the explicit flags to skip the prompt. Affects swift-secp256k1's SharedSourcesPlugin.
…licitly The failure mode was sneaky: -skipPackagePluginValidation lets the xcodebuild step proceed without the trust prompt, but swift-secp256k1's SharedSourcesPlugin still silently degrades — libsecp256k1.o builds without ECDH/extrakeys/recovery modules, so symbols like _secp256k1_ecdh are undefined at link time when ClaveNSE/Clave try to use P256K. Setting IDESkipPackagePluginFingerprintValidatation + the SCM defaults BEFORE resolving packages allows plugins to run with full define expansion. Then we resolve packages in a separate step so any plugin errors surface explicitly instead of getting buried in the test step.
Owner
Author
|
Closing — see BACKLOG iOS CI sprint entry. Half-broken CI is worse than no CI; needs focused sprint to resolve the swift-secp256k1 SharedSourcesPlugin / xcodebuild plugin-trust interaction in CI environments. Closing in favor of a future PR. |
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.
Summary
First CI for the repo. Runs `xcodebuild test` on every PR and on main pushes.
Why now
PR #19's pbxproj-entries-for-new-Swift-files step almost shipped broken — the new `ActivitySummary.swift` and `Nip19.swift` needed manual entries in 5 places each across the project file, and missing one would fail to build but pass local Xcode (which discovers Swift files differently). CI catches this kind of thing before merge.
Workflow design
Test plan
```
gh api repos/DocNR/clave/branches/main/protection/required_status_checks \
--method PATCH -f strict=true -F 'contexts[]=Build + unit tests'
```
🤖 Generated with Claude Code