diff --git a/.buildkite/commands/run-unit-tests-for-scheme.sh b/.buildkite/commands/run-unit-tests-for-scheme.sh new file mode 100755 index 000000000000..b01b1c4c2d2b --- /dev/null +++ b/.buildkite/commands/run-unit-tests-for-scheme.sh @@ -0,0 +1,17 @@ +#!/bin/bash -euo pipefail + +SCHEME="${1:?Usage $0 SCHEME}" +DEVICE="iPhone 16" +OS_VERSION="18.4" + +if "$(dirname "${BASH_SOURCE[0]}")/should-skip-job.sh" --job-type validation; then + exit 0 +fi + +$(dirname "${BASH_SOURCE[0]}")/shared-set-up.sh + +xcodebuild \ + -scheme "${SCHEME}" \ + -destination "platform=iOS Simulator,OS=${OS_VERSION},name=${DEVICE}" \ + test \ + | xcbeautify diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index f6accd43f04c..af462cee5f5c 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,3 +1,6 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json +--- + # Most of the steps need to run on a macOS agent, so let's define it as a root property. agents: queue: mac @@ -111,17 +114,12 @@ steps: - github_commit_status: context: "Reader Unit Tests" - label: "🔬 Keystone Unit Tests" - command: | - if .buildkite/commands/should-skip-job.sh --job-type validation; then - exit 0 - fi - - .buildkite/commands/shared-set-up.sh - xcodebuild \ - -scheme Keystone \ - -destination 'platform=iOS Simulator,OS=18.2,name=iPhone 16' \ - test \ - | xcbeautify + command: .buildkite/commands/run-unit-tests-for-scheme.sh Keystone + # Disabled till https://github.com/wordpress-mobile/WordPress-iOS/pull/24537 is completed + # + # The boolean value has to be a string explicitly. + # See validation error against schema. + if: "false" plugins: [$CI_TOOLKIT_PLUGIN] artifact_paths: - "build/results/*" @@ -129,17 +127,7 @@ steps: - github_commit_status: context: "Unit Tests Keystone" - label: "🔬 WordPressData Unit Tests" - command: | - if .buildkite/commands/should-skip-job.sh --job-type validation; then - exit 0 - fi - - .buildkite/commands/shared-set-up.sh - xcodebuild \ - -scheme WordPressData \ - -destination 'platform=iOS Simulator,OS=18.2,name=iPhone 16' \ - test \ - | xcbeautify + command: .buildkite/commands/run-unit-tests-for-scheme.sh WordPressData plugins: [$CI_TOOLKIT_PLUGIN] artifact_paths: - "build/results/*"