diff --git a/.buildkite/commands/run-tests.sh b/.buildkite/commands/run-tests.sh new file mode 100755 index 0000000..ad2d215 --- /dev/null +++ b/.buildkite/commands/run-tests.sh @@ -0,0 +1,21 @@ +#!/bin/bash -eu + +# Notice that: +# +# - We are using raw `xcodebuild` without extra tooling such as Fastlane, +# `xcpretty`, or `xcbeautify`. This is an intentional compromise to keep the +# setup lean, as adding any of those would require extras in CI such as +# chating for what, right now, looks like merely a log readability gain. +# +# - The iOS Simulator version is hardcoded in the command call, unlike the +# Simulator device, so we have a single source of truth. The downside is that +# the syntax in the pipeline is less clear: a reader might as where's the +# iOS version set. As long as we only need to test against the latest iOS +# version, that seems like a reasonable tradeoff to make it easier to move to +# newer versions as they are released. +SIMULATOR_NAME=$1 + +xcodebuild clean test \ + -project 'ScreenObject.xcodeproj' \ + -scheme 'ScreenObject' \ + -destination "platform=iOS Simulator,name=$SIMULATOR_NAME,OS=14.5" diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml new file mode 100644 index 0000000..4d7c872 --- /dev/null +++ b/.buildkite/pipeline.yml @@ -0,0 +1,11 @@ +env: + IMAGE_ID: xcode-12.5.1 +agents: + queue: 'mac' + +steps: + - label: "🧪 Build and Test (iPhone 12 Simulator)" + command: .buildkite/commands/run-tests.sh 'iPhone 12' + + - label: "🧪 Build and Test (iPad Pro (12.9-inch) (5th generation) Simulator)" + command: .buildkite/commands/run-tests.sh 'iPad Pro (12.9-inch) (5th generation)' diff --git a/ScreenObject.xcodeproj/xcshareddata/xcschemes/ScreenObject.xcscheme b/ScreenObject.xcodeproj/xcshareddata/xcschemes/ScreenObject.xcscheme index cd1b7da..30421a9 100644 --- a/ScreenObject.xcodeproj/xcshareddata/xcschemes/ScreenObject.xcscheme +++ b/ScreenObject.xcodeproj/xcshareddata/xcschemes/ScreenObject.xcscheme @@ -28,6 +28,16 @@ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + + + +