Zum Inhalt springen
Plugins

language Plugin

iOS plugin

The `ios` plugin (`plugins/ios/`) defines typed grader patterns for iOS and Swift work that runs on native macOS workers. It does not add iOS-specific routing branches. Each generated grader is an ordinary `.syrus.yml` grader with execution `capabilities`, timeout metadata, and artifact metadata, so the same worker-placement model can serve other platform toolchains later.

iOS plugin

The ios plugin (plugins/ios/) defines typed grader patterns for iOS and Swift work that runs on native macOS workers. It does not add iOS-specific routing branches. Each generated grader is an ordinary .syrus.yml grader with execution capabilities, timeout metadata, and artifact metadata, so the same worker-placement model can serve other platform toolchains later.

Xcode simulator tests

Use type: xcodebuild for common xcodebuild test or build validation. The grader requires exactly one of workspace: or project:, requires scheme:, defaults the simulator destination to platform=iOS Simulator,name=iPhone 16,OS=latest, and writes isolated build products under the workspace:

grade:
  - type: xcodebuild
    workspace: MobileApp.xcworkspace
    scheme: MobileApp
    destination: "platform=iOS Simulator,name=iPhone 16,OS=latest"
    derived_data_path: .syrus/DerivedData/mobile
    result_bundle_path: build/syrus/MobileApp.xcresult
    compilation_cache: true
    compilation_cache_retention_days: 21
    junit_output: build/syrus/junit/mobile.xml
    timeout_minutes: 45

The command removes the configured result bundle before running because xcodebuild refuses to overwrite an existing .xcresult. It passes CODE_SIGNING_ALLOWED=NO and CODE_SIGNING_REQUIRED=NO for ordinary simulator tests. If a repository needs signing, keep Keychain/provisioning setup in the macOS worker runbook and repository-owned scripts; do not put secrets in .syrus.yml.

The typed grader leaves Xcode's native compilation cache disabled by default. Enable the Build Cache plugin and set compilation_cache: true to opt in. Syrus probes the selected Xcode and Swift compiler with a short timeout before enabling it; an older, unsupported, or unhealthy toolchain runs the same build without caching. A native CAS error also causes one uncached retry. This is not the build_cache plugin's sccache integration and its diagnostics are reported separately.

The cache lives under $SYRUS_XCODE_COMPILATION_CACHE_ROOT (default $SYRUS_DATA_ROOT/cache/xcode-compilation, with /var/lib/syrus as the data root fallback) rather than DerivedData or a Workflow checkout. Toolchain-specific weekly generations allow concurrent Xcode builds to use CAS's native concurrency while old, inactive generations are removed after compilation_cache_retention_days (21 by default, configurable from 1 through 90). The generated diagnostic log reports whether caching was enabled, unsupported, disabled, or retried, the effective path, and Xcode's native hit/miss remarks.

Reuse is host-local. Cache keys remain sensitive to the Xcode/Swift toolchain, SDK, build settings, inputs, and—in toolchains without suitable prefix mapping—absolute checkout paths. Syrus does not claim reuse across different Mac workers and does not persist or share whole DerivedData directories.

Use -workspace when the app has a workspace (especially with CocoaPods or Swift packages that generate one) and -project only for project-only apps. Always name the scheme explicitly and choose a simulator destination available on the Mac worker pool; keep OS=latest only when the fleet is kept current. If a formatter emits JUnit XML, write it to a stable path such as build/syrus/junit/ios-tests.xml and declare it as the grader's junit_output.

Swift Package Manager

Use type: swiftpm for Swift Package Manager validation on the same macOS worker pool:

prepare:
  - swift package resolve

grade:
  - type: swiftpm
    package_path: Packages/Shared
    build_path: .syrus/DerivedData/shared
    action: test
    timeout_minutes: 20

Set action: build when the target should compile only. build_path is isolated per run by default, matching the Xcode DerivedData isolation pattern.

For a repository-root Package.swift, the plugin's prepare detector can auto-detect swift package resolve. Xcode dependency resolution should stay explicit because xcodebuild -resolvePackageDependencies needs the same workspace/project and scheme choices as the grader.

Capabilities and artifacts

Both grader types default to:

capabilities:
  os: macos
  arch: arm64
  toolchain: xcode
  runtime: ios_simulator

The generated metadata records the .xcresult bundle, DerivedData/SwiftPM build directory, and a distinct Xcode compilation-cache diagnostic log as artifacts. If the command or wrapper emits JUnit XML, set junit_output: so normal test-result ingestion and target health signals can consume structured results. Leave it unset when the command only emits xcodebuild logs and an .xcresult bundle.

Planning iOS implementation work

An iOS implementation proposal should declare macOS placement explicitly:

{
  "planned_execution": {
    "project_label": "iOS App",
    "target_label": "//apps/ios:test",
    "capabilities": {
      "os": ["macos"],
      "arch": ["arm64"],
      "toolchain": ["xcode"],
      "runtime": ["ios_simulator"]
    }
  }
}

Use the same primary placement for mixed iOS/backend work when the agent must edit and test the iOS app in the same attempt. Backend graders can retain their own Linux target requirements.