Skip to content

ci(swift): run Swift CI on SwiftUI/sample changes and build for the iOS Simulator - #3386

Merged
pinieb merged 2 commits into
a2ui-project:mainfrom
karolkulesza:ci/swift-swiftui-paths-ios-build
Oct 22, 2026
Merged

pinieb merged 2 commits into
a2ui-project:mainfrom
karolkulesza:ci/swift-swiftui-paths-ios-build

Conversation

@karolkulesza

Copy link
Copy Markdown
Contributor

Description

The Swift workflow (swift_build_and_test.yml) had two gaps:

  • Its path filters only covered swift/core/** and shared spec inputs, so PRs that change only
    swift/swiftui/** or swift/sample/** never ran A2UISwiftUITests.
  • It ran swift test on macOS only, so #if os(iOS) / UIKit code
    (e.g. A2UITextField.swift, A2UIAccessibilityModifier.swift) and the sample app were never compiled.

Changes:

  • Add swift/swiftui/** and swift/sample/** to the push and pull_request path filters.
  • New ios-build job on macos-latest:
    • xcodebuild build -scheme A2UISwiftCore-Package -destination 'generic/platform=iOS Simulator'
      (all four library products), always.
    • xcodebuild build -project swift/sample/A2UISampleClient.xcodeproj -scheme A2UISampleClient
      for the same destination with CODE_SIGNING_ALLOWED=NO, only when swift/**, Package.swift,
      specification/v0_9_1/** or the workflow changes (via dorny/paths-filter, same pin as web_ci.yml),
      or on manual dispatch.
    • ARCHS=arm64 to avoid building the simulator slice twice; -skipMacroValidation and
      -skipPackagePluginValidation are required because the package uses swift-json-schema macros and a
      build-tool plugin.
  • The existing test job and the workflow name are unchanged.

CI cost: one extra macOS job. xcodebuild builds swift-syntax from source, which is most of the time.
Locally (Xcode 26.3, Apple Silicon, busy machine) the package build took ~4.5 min and the sample build
~2 min from a clean DerivedData. If you'd rather pay for one build only, building just the sample covers
the same library targets; happy to switch.

Verified locally: both xcodebuild commands, exactly as in the workflow, end in BUILD SUCCEEDED on
current main, so the new job should be green as is.

#3376 also edits this workflow: it adds a separate performance job next to the new ios-build job. Whichever lands second will need a small, mechanical conflict resolution in that file.

Fixes #3385

Pre-launch Checklist

One time:

For this PR:

  • I have updated the relevant CHANGELOG.md file. (CI-only change; no package CHANGELOG applies.)
  • I updated/added relevant documentation. (N/A)
  • My code changes (if any) have tests. (The change is the CI job itself.)
  • If my branch is on a fork, I have verified that scripts/e2e_test.sh passes.

If you need help, consider asking for advice on the discussion board.

The Swift workflow only triggered on swift/core/** (plus shared spec
inputs), so SwiftUI-only and sample-only changes never ran
A2UISwiftUITests. It also only ran `swift test` on macOS, so the
`#if os(iOS)` / UIKit code paths and the sample app were never compiled.

- Add swift/swiftui/** and swift/sample/** to the push and
  pull_request path filters.
- Add an ios-build job that builds the A2UISwiftCore-Package scheme for
  generic/platform=iOS Simulator, and builds the A2UISampleClient app
  when swift/**, Package.swift or specification/v0_9_1/** change.
- Build arm64 only and pass -skipMacroValidation /
  -skipPackagePluginValidation, which xcodebuild needs for the
  swift-json-schema macros and the schema generator plugin.

Fixes a2ui-project#3385
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@github-actions github-actions Bot added the status: needs-triage auto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs label Oct 21, 2026
@Varun-S10

Copy link
Copy Markdown
Collaborator

Hi @karolkulesza, Thank you for raising this PR to fix #3385. We have reviewed and verified the changes.
Hi @gspencergoog, could you please take a look? Thank you.

@Varun-S10 Varun-S10 added status: needs review and removed status: needs-triage auto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs labels Oct 22, 2026
@pinieb pinieb added the lang: swift Affects SDKs or apps in the Swift programming language label Oct 22, 2026
@pinieb
pinieb self-requested a review October 22, 2026 17:37
@pinieb
pinieb enabled auto-merge (squash) October 22, 2026 17:38
@pinieb
pinieb merged commit 12a6093 into a2ui-project:main Oct 22, 2026
42 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in A2UI Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang: swift Affects SDKs or apps in the Swift programming language status: needs review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(swift): Swift workflow skips SwiftUI/sample changes and never compiles iOS-only code

3 participants