Просмотр исходного кода

Download platforms before running tests / builds / validations

Florian Friedrich 6 месяцев назад
Родитель
Сommit
2d3168ded9

+ 6 - 5
.github/workflows/cocoapods-release.yml

@@ -16,12 +16,13 @@ jobs:
       - uses: maxim-lobanov/setup-xcode@v1
         with:
           xcode-version: ^16.4
-      - name: Download visionOS
+      - name: Install Platforms
         run: |
-          sudo xcodebuild -runFirstLaunch
-          sudo xcrun simctl list # needed to boot the simulator
-          sudo xcodebuild -downloadPlatform visionOS
-          sudo xcodebuild -runFirstLaunch
+          xcrun simctl delete unavailable # Remove unavailable sims - also boots the simulator
+          xcodebuild -downloadPlatform iOS
+          xcodebuild -downloadPlatform tvOS
+          xcodebuild -downloadPlatform visionOS
+          xcodebuild -downloadPlatform watchOS
       - uses: actions/checkout@v5
       - name: Generate Podspec
         env:

+ 6 - 5
.github/workflows/cocoapods-validations.yml

@@ -17,12 +17,13 @@ jobs:
       - uses: maxim-lobanov/setup-xcode@v1
         with:
           xcode-version: ^16.4
-      - name: Download visionOS
+      - name: Install Platforms
         run: |
-          sudo xcodebuild -runFirstLaunch
-          sudo xcrun simctl list # needed to boot the simulator
-          sudo xcodebuild -downloadPlatform visionOS
-          sudo xcodebuild -runFirstLaunch
+          xcrun simctl delete unavailable # Remove unavailable sims - also boots the simulator
+          xcodebuild -downloadPlatform iOS
+          xcodebuild -downloadPlatform tvOS
+          xcodebuild -downloadPlatform visionOS
+          xcodebuild -downloadPlatform watchOS
       - uses: actions/checkout@v5
       - name: Generate Podspec
         run: ./Scripts/generate-podspec.sh

+ 1 - 2
.github/workflows/danger.yml

@@ -15,8 +15,7 @@ jobs:
       - uses: actions/checkout@v5
         with:
           fetch-depth: 0
-      - name: danger/swift
-        uses: danger/swift@3.22.0
+      - uses: danger/swift@3.22.0
         with:
           args: --failOnErrors --no-publish-check
         env:

+ 6 - 0
.github/workflows/demo-builds.yml

@@ -43,6 +43,12 @@ jobs:
       - uses: maxim-lobanov/setup-xcode@v1
         with:
           xcode-version: ^16.4
+      - name: Install Platform
+        # This isn't necessarily an exhaustive list, but it saves some time in the obvious cases.
+        if: ${{ matrix.scheme != 'BenchmarkMac' && matrix.scheme != 'RegisteredLoggingTest (Desktop)' && matrix.scheme != 'TestXcodeColors (Desktop)' && matrix.scheme != 'OverflowTestMac' && matrix.scheme != 'RollingTestMac' && matrix.scheme != 'CLI' }}
+        run: |
+          xcrun simctl delete unavailable # Remove unavailable sims - also boots the simulator
+          xcodebuild -downloadPlatform iOS
       - uses: actions/checkout@v5
       - uses: sersoft-gmbh/xcodebuild-action@v3
         with:

+ 21 - 0
.github/workflows/integration-tests.yml

@@ -17,6 +17,10 @@ jobs:
       - uses: maxim-lobanov/setup-xcode@v1
         with:
           xcode-version: ^16.4
+      - name: Install Platform
+        run: |
+          xcrun simctl delete unavailable # Remove unavailable sims - also boots the simulator
+          xcodebuild -downloadPlatform iOS
       - uses: actions/checkout@v5
       - uses: sersoft-gmbh/xcodebuild-action@v3
         with:
@@ -38,6 +42,23 @@ jobs:
       - uses: maxim-lobanov/setup-xcode@v1
         with:
           xcode-version: ^16.4
+      - name: Install Platform
+        if: ${{ matrix.scheme != 'macOSSwiftIntegration' }}
+        env:
+          SCHEME: ${{ matrix.scheme }}
+        run: |
+          xcrun simctl delete unavailable # Remove unavailable sims - also boots the simulator
+          case "${SCHEME}" in
+            iOSFrameworkIntegration)
+              xcodebuild -downloadPlatform iOS
+              ;;
+            tvOSSwiftIntegration)
+              xcodebuild -downloadPlatform tvOS
+              ;;
+            watchOSSwiftIntegration)
+              xcodebuild -downloadPlatform watchOS
+              ;;
+          esac
       - uses: actions/checkout@v5
       - uses: sersoft-gmbh/xcodebuild-action@v3
         with:

+ 22 - 0
.github/workflows/library-builds.yml

@@ -20,6 +20,11 @@ jobs:
       - uses: maxim-lobanov/setup-xcode@v1
         with:
           xcode-version: ^16.4
+      - name: Install Platform
+        if: ${{ matrix.sdk == 'iphonesimulator' }}
+        run: |
+          xcrun simctl delete unavailable # Remove unavailable sims - also boots the simulator
+          xcodebuild -downloadPlatform iOS
       - uses: actions/checkout@v5
       - uses: sersoft-gmbh/xcodebuild-action@v3
         with:
@@ -39,6 +44,23 @@ jobs:
       - uses: maxim-lobanov/setup-xcode@v1
         with:
           xcode-version: ^16.4
+      - name: Install Platform
+        if: ${{ matrix.sdk != 'macosx' }}
+        env:
+          MATRIX_SDK: ${{ matrix.sdk }}
+        run: |
+          xcrun simctl delete unavailable # Remove unavailable sims - also boots the simulator
+          case "${MATRIX_SDK}" in
+            iphonesimulator)
+              xcodebuild -downloadPlatform iOS
+              ;;
+            watchsimulator)
+              xcodebuild -downloadPlatform watchOS
+              ;;
+            appletvsimulator)
+              xcodebuild -downloadPlatform tvOS
+              ;;
+          esac
       - uses: actions/checkout@v5
       - uses: sersoft-gmbh/xcodebuild-action@v3
         with:

+ 12 - 9
.github/workflows/unit-tests.yml

@@ -38,14 +38,14 @@ jobs:
           - iPadOS
           - tvOS
           - visionOS
-        skip-testing: ['']
+        skip-testing: [""]
         include:
           - scheme: iOS Tests
             platform: iOS
-            skip-testing: 'iOS Tests/DDFileLoggerPerformanceTests'
+            skip-testing: "iOS Tests/DDFileLoggerPerformanceTests"
           - scheme: OS X Tests
             platform: macOS
-            skip-testing: 'OS X Tests/DDFileLoggerPerformanceTests'
+            skip-testing: "OS X Tests/DDFileLoggerPerformanceTests"
     steps:
       - uses: maxim-lobanov/setup-xcode@v1
         with:
@@ -66,13 +66,16 @@ jobs:
             *) echo "::error title=Unknown platform!::Unknown platform: ${PLATFORM}" && exit 1;;
           esac
           echo "destination=${DESTINATION}" >> "${GITHUB_OUTPUT}"
-      - name: Download visionOS
-        if: ${{ matrix.platform == 'visionOS' }}
+      - name: Install Platform
+        if: ${{ matrix.platform != 'macOS' }}
+        env:
+          PLATFORM: ${{ matrix.platform }}
         run: |
-          sudo xcodebuild -runFirstLaunch
-          sudo xcrun simctl list # needed to boot the simulator
-          sudo xcodebuild -downloadPlatform visionOS
-          sudo xcodebuild -runFirstLaunch
+          if [ "${PLATFORM}" = 'iPadOS' ]; then
+            PLATFORM='iOS'
+          fi
+          xcrun simctl delete unavailable # Remove unavailable sims - also boots the simulator
+          xcodebuild -downloadPlatform "${PLATFORM}"
       - uses: actions/checkout@v5
       - uses: sersoft-gmbh/xcodebuild-action@v3
         with: