diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index b9181c1..ddc837b 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -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" @@ -47,6 +50,38 @@ 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' @@ -54,7 +89,7 @@ jobs: 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