Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 38 additions & 3 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,30 @@ jobs:
tests:
runs-on: 'macos-latest'

timeout-minutes: 15
timeout-minutes: 30

env:
SCHEME: "BlackBoxFirebasePerformance"
OS_VERSION: "26.2"
OS_VERSION: "26.4"

strategy:
matrix:
include:
- destination: "platform=iOS Simulator"
platform: ios
download_platform: "iOS"
device: "iPhone 17"
system_prefix: "iOS"
- destination: "platform=OS X"
platform: macos
- destination: "platform=tvOS Simulator"
platform: tvos
download_platform: "tvOS"
device: "Apple TV 4K (3rd generation)"
system_prefix: "tvOS"
- destination: "platform=watchOS Simulator"
platform: watchos
download_platform: "watchOS"
device: "Apple Watch Ultra 3 (49mm)"
system_prefix: "watchOS"

Expand All @@ -47,14 +50,46 @@ jobs:
- name: Resolve Dependencies
run: xcodebuild -resolvePackageDependencies

- name: Resolve Simulator Runtime
if: matrix.platform != 'macos'
id: resolve-runtime
run: |
platform="${{ matrix.system_prefix }}"
requested="${{ env.OS_VERSION }}"
selected=""

if xcrun simctl list runtimes | grep -Fq "${platform} ${requested}"; then
selected="${requested}"
elif xcodebuild -downloadPlatform ${{ matrix.download_platform }} -buildVersion "${requested}" && \
xcrun simctl list runtimes | grep -Fq "${platform} ${requested}"; then
selected="${requested}"
fi

if [ -z "${selected}" ]; then
selected="$(
xcrun simctl list runtimes |
awk -v platform="${platform}" '$0 ~ "^" platform " 26\\." && $0 !~ /unavailable/ { print $2 }' |
sort -V |
tail -1
)"
fi

if [ -z "${selected}" ]; then
echo "No available ${platform} 26.x runtime found" >&2
exit 1
fi

echo "Using ${platform} runtime ${selected}"
echo "version=${selected}" >> "$GITHUB_OUTPUT"

- name: Create Simulator
id: create_simulator
if: matrix.platform != 'macos'
uses: ./.github/actions/create_sim
with:
name: ${{ matrix.device }}
device: ${{ matrix.device }}
system: ${{ matrix.system_prefix }}${{ env.OS_VERSION }}
system: ${{ matrix.system_prefix }}${{ steps.resolve-runtime.outputs.version }}

- name: Select Destination
id: select-destination
Expand Down