From e673c80c6b41d887ca9ed97c62969c038cc19d5a Mon Sep 17 00:00:00 2001 From: AJ Lauer Barinov Date: Wed, 3 Jan 2024 15:31:36 -0800 Subject: [PATCH] ci: add automated check for each of the example applications --- .github/workflows/build-and-test.yml | 7 +++---- scripts/run-tests.sh | 31 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) create mode 100755 scripts/run-tests.sh diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 938f5ec..d8e174e 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -4,12 +4,11 @@ on: push: jobs: - tests: - name: Test the SDK with a Demo App + test-example-applications: + name: Test SDK example applications on iOS and tvOS runs-on: macos-13 steps: - name: Checkout uses: actions/checkout@v3 - name: Run tests - run: "./run-tests.sh" - + run: "./scripts/run-tests.sh" diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh new file mode 100755 index 0000000..5131662 --- /dev/null +++ b/scripts/run-tests.sh @@ -0,0 +1,31 @@ +#!/bin/bash +set -euo pipefail + +if ! command -v xcbeautify &> /dev/null +then + echo -e "\033[1;31m ERROR: xcbeautify could not be found please install it... \033[0m" + exit 1 +fi + +echo "▸ Current Xcode: $(xcode-select -p)" + +readonly XCODE=$(xcodebuild -version | grep Xcode | cut -d " " -f2) + +echo "▸ Using Xcode Version: ${XCODE}" + +echo "▸ Available Xcode SDKs" +xcodebuild -showsdks + +echo "▸ Running DemoApp tests" + +xcodebuild clean test \ + -scheme DemoApp \ + -workspace Example/MUXSDKImaListener.xcworkspace \ + -destination 'platform=iOS Simulator,OS=17.2,name=iPhone 15' | xcbeautify + +echo "▸ Running MUXSDKIMATVOSExample tests" + +xcodebuild clean test \ + -scheme MUXSDKIMATVOSExample \ + -workspace Example/MUXSDKImaListener.xcworkspace \ + -destination 'platform=tvOS Simulator,OS=17.2,name=Apple TV' | xcbeautify