Browse Source

Refactor Test Runs For Swift 5.9 (#3775)

### Goals :soccer:
This PR updates the CI builders to integrate Xcode 15 into all runs.
Jon Shier 2 years ago
parent
commit
495e9ffd08
1 changed files with 118 additions and 83 deletions
  1. 118 83
      .github/workflows/ci.yml

+ 118 - 83
.github/workflows/ci.yml

@@ -22,7 +22,7 @@ concurrency:
   cancel-in-progress: true
 jobs:
   macOS:
-    name: Test macOS, All Xcodes and Swifts
+    name: ${{ matrix.name }}
     runs-on: ${{ matrix.runsOn }}
     env:
       DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
@@ -31,9 +31,13 @@ jobs:
       fail-fast: false
       matrix:
         include:
-          - xcode: "Xcode_14.3"
+          - xcode: "Xcode_15.0"
+            runsOn: firebreak
+            name: "macOS 13, Xcode 15.0, Swift 5.9.0"
+            testPlan: "macOS"
+          - xcode: "Xcode_14.3.1"
             runsOn: firebreak
-            name: "macOS 13, Xcode 14.3, Swift 5.8.0"
+            name: "macOS 13, Xcode 14.3.1, Swift 5.8.0"
             testPlan: "macOS"
           - xcode: "Xcode_14.2"
             runsOn: macOS-12
@@ -68,146 +72,171 @@ jobs:
             name: "macOS 11, Xcode 13.0, Swift 5.5.0"
             testPlan: "macOS-NoTS"
     steps:
-      - uses: actions/checkout@v3
-      - name: Install Firewalk
-        run: "brew install alamofire/alamofire/firewalk && firewalk &"
+      - uses: actions/checkout@v4
       - name: ${{ matrix.name }}
-        run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire macOS" -destination "platform=macOS" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty
+        run: |-
+          set -o pipefail
+          brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk
+          firewalk &
+          env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire macOS" -destination "platform=macOS" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty
   Catalyst:
-    name: Test Catalyst
-    runs-on: macOS-13
+    name: ${{ matrix.name }}
+    runs-on: ${{ matrix.runsOn }}
     env:
-      DEVELOPER_DIR: /Applications/Xcode_14.3.app/Contents/Developer
+      DEVELOPER_DIR: /Applications/${{ matrix.xcode }}.app/Contents/Developer
     timeout-minutes: 10
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - xcode: "Xcode_15.0"
+            name: "Catalyst 15.0"
+            runsOn: firebreak
+          - xcode: "Xcode_14.3.1"
+            name: "Catalyst 14.3.1"
+            runsOn: macOS-13
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Install Firewalk
-        run: brew install alamofire/alamofire/firewalk && firewalk &
+        run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
       - name: Catalyst
-        run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "platform=macOS" clean test | xcpretty
-  Latest:
-    name: Test Latest (iOS, tvOS, watchOS)
-    runs-on: macOS-13
+        run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "platform=macOS" clean test 2>&1 | xcpretty
+  Beta:
+    name: ${{ matrix.name }}
+    runs-on: firebreak
     env:
-      DEVELOPER_DIR: "/Applications/Xcode_14.3.app/Contents/Developer"
+      DEVELOPER_DIR: "/Applications/Xcode_15b8.app/Contents/Developer"
     timeout-minutes: 10
     strategy:
       fail-fast: false
       matrix:
         include:
-          - destination: "OS=16.4,name=iPhone 14 Pro"
-            name: "iOS"
-            scheme: "Alamofire iOS"
-          - destination: "OS=16.4,name=Apple TV"
-            name: "tvOS"
-            scheme: "Alamofire tvOS"
-          - destination: "OS=9.4,name=Apple Watch Series 8 (45mm)"
-            name: "watchOS"
-            scheme: "Alamofire watchOS"
+          - destination: "OS=1.0,name=Apple Vision Pro"
+            name: "visionOS 1.0"
+            testPlan: "visionOS"
+            scheme: "Alamofire visionOS"
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Install Firewalk
-        run: brew install alamofire/alamofire/firewalk && firewalk &
+        run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
       - name: ${{ matrix.name }}
-        run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean test | xcpretty
+        run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test 2>&1 | xcpretty
   iOS:
-    name: "Test Old iOS"
-    runs-on: firebreak
+    name: ${{ matrix.name }}
+    runs-on: ${{ matrix.runsOn }}
     env:
-      DEVELOPER_DIR: "/Applications/Xcode_14.3.app/Contents/Developer"
+      DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
     timeout-minutes: 10
     strategy:
       fail-fast: false
       matrix:
         include:
+          - destination: "OS=17.0,name=iPhone 14 Pro"
+            name: "iOS 17.0"
+            testPlan: "iOS"
+            xcode: "Xcode_15.0"
+            runsOn: firebreak
+          - destination: "OS=16.4,name=iPhone 14 Pro"
+            name: "iOS 16.4"
+            testPlan: "iOS"
+            xcode: "Xcode_14.3.1"
+            runsOn: firebreak
           - destination: "OS=15.5,name=iPhone 13 Pro"
             name: "iOS 15.5"
             testPlan: "iOS-NoTS"
+            xcode: "Xcode_14.3.1"
+            runsOn: macOS-13
           - destination: "OS=14.5,name=iPhone 12 Pro"
             name: "iOS 14.5"
             testPlan: "iOS-NoTS"
+            xcode: "Xcode_14.3.1"
+            runsOn: macOS-13
           # - destination: "OS=13.7,name=iPhone 11 Pro"
           #   name: "iOS 13.7"
           #   testPlan: "iOS-NoTS"
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Install Firewalk
         run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
       - name: ${{ matrix.name }}
-        run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty
-  Beta:
-    name: "Test Beta iOS"
-    runs-on: firebreak
-    env:
-      DEVELOPER_DIR: "/Applications/Xcode_15.0.app/Contents/Developer"
-    timeout-minutes: 10
-    strategy:
-      fail-fast: false
-      matrix:
-        include:
-          - destination: "OS=17.0,name=iPhone 14 Pro"
-            name: "iOS 17.0"
-            testPlan: "iOS"
-            scheme: "Alamofire iOS"
-          - destination: "OS=1.0,name=Apple Vision Pro"
-            name: "visionOS 1.0"
-            testPlan: "visionOS"
-            scheme: "Alamofire visionOS"
-    steps:
-      - uses: actions/checkout@v3
-      - name: Install Firewalk
-        run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
-      - name: ${{ matrix.name }}
-        run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty
+        run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire iOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test 2>&1 | xcpretty
   tvOS:
-    name: Test Old tvOS
-    runs-on: firebreak
+    name: ${{ matrix.name }}
+    runs-on: ${{ matrix.runsOn }}
     env:
-      DEVELOPER_DIR: /Applications/Xcode_14.3.app/Contents/Developer
+      DEVELOPER_DIR: /Applications/${{ matrix.xcode }}.app/Contents/Developer
     timeout-minutes: 10
     strategy:
       fail-fast: false
       matrix:
         include:
+          - destination: "OS=17.0,name=Apple TV"
+            name: "tvOS 17.0"
+            testPlan: "tvOS"
+            xcode: "Xcode_15.0"
+            runsOn: firebreak
+          - destination: "OS=16.4,name=Apple TV"
+            name: "tvOS 16.4"
+            testPlan: "tvOS"
+            xcode: "Xcode_14.3.1"
+            runsOn: firebreak
           - destination: "OS=15.4,name=Apple TV"
             name: "tvOS 15.4"
             testPlan: "tvOS-NoTS"
+            xcode: "Xcode_14.3.1"
+            runsOn: firebreak
           - destination: "OS=14.5,name=Apple TV"
             name: "tvOS 14.5"
             testPlan: "tvOS-NoTS"
+            xcode: "Xcode_14.3.1"
+            runsOn: firebreak
           # - destination: "OS=13.4,name=Apple TV"
           #   name: "tvOS 13.4"
           #   testPlan: "tvOS-NoTS"
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Install Firewalk
         run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
       - name: ${{ matrix.name }}
-        run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire tvOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty
+        run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire tvOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test 2>&1 | xcpretty
   watchOS:
-    name: Test Old watchOS
-    runs-on: firebreak
+    name: ${{ matrix.name }}
+    runs-on: ${{ matrix.runsOn }}
     env:
-      DEVELOPER_DIR: /Applications/Xcode_14.3.app/Contents/Developer
+      DEVELOPER_DIR: /Applications/${{ matrix.xcode }}.app/Contents/Developer
     timeout-minutes: 10
     strategy:
       fail-fast: false
       matrix:
         include:
+          - destination: "OS=10.0,name=Apple Watch Series 9 (45mm)"
+            name: "watchOS 10.0"
+            testPlan: "watchOS"
+            xcode: "Xcode_15.0"
+            runsOn: firebreak
+          - destination: "OS=9.4,name=Apple Watch Series 8 (45mm)"
+            name: "watchOS 9.4"
+            testPlan: "watchOS"
+            xcode: "Xcode_14.3.1"
+            runsOn: firebreak
           - destination: "OS=8.5,name=Apple Watch Series 7 (45mm)"
             name: "watchOS 8.5"
             testPlan: "watchOS-NoTS"
+            xcode: "Xcode_14.3.1"
+            runsOn: firebreak
           - destination: "OS=7.4,name=Apple Watch Series 6 (44mm)"
             name: "watchOS 7.4"
             testPlan: "watchOS-NoTS"
+            xcode: "Xcode_14.3.1"
+            runsOn: firebreak
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Install Firewalk
-        run: brew install alamofire/alamofire/firewalk && firewalk &
-      - name: ${{ matrix.name}}
-        run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire watchOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test | xcpretty
+        run: brew update && brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk && firewalk &
+      - name: ${{ matrix.name }}
+        run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "Alamofire.xcodeproj" -scheme "Alamofire watchOS" -destination "${{ matrix.destination }}" -testPlan "${{ matrix.testPlan }}" clean test 2>&1 | xcpretty
   SPM:
-    name: Test with SPM
+    name: ${{ matrix.name }}
     runs-on: ${{ matrix.runsOn }}
     env:
       DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
@@ -219,8 +248,8 @@ jobs:
           - xcode: "Xcode_15.0"
             runsOn: firebreak
             name: "macOS 13, SPM 5.9.0 Test"
-          - xcode: "Xcode_14.3"
-            runsOn: macOS-13
+          - xcode: "Xcode_14.3.1"
+            runsOn: firebreak
             name: "macOS 13, SPM 5.8.0 Test"
           - xcode: "Xcode_14.2"
             runsOn: macOS-12
@@ -247,9 +276,9 @@ jobs:
             runsOn: macOS-11
             name: "macOS 11, SPM 5.5.0 Test"
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
       - name: Install Firewalk
-        run: brew install alamofire/alamofire/firewalk && firewalk &
+        run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk xcbeautify && firewalk &
       - name: Test SPM
         run: swift test -c debug
   Linux:
@@ -259,12 +288,18 @@ jobs:
       fail-fast: false
       matrix:
         include:
-          - image: swift:5.8.0-focal
-          - image: swift:5.8.0-jammy
-          - image: swift:5.8.0-bionic
-          - image: swift:5.8.0-centos7
-          - image: swift:5.8.0-amazonlinux2
-          - image: swift:5.8.0-rhel-ubi9
+          - image: swift:5.8.1-focal
+          - image: swift:5.8.1-jammy
+          - image: swift:5.8.1-bionic
+          - image: swift:5.8.1-centos7
+          - image: swift:5.8.1-amazonlinux2
+          - image: swift:5.8.1-rhel-ubi9
+          # - image: swift:5.9.0-focal
+          # - image: swift:5.9.0-jammy
+          # - image: swift:5.9.0-bionic
+          # - image: swift:5.9.0-centos7
+          # - image: swift:5.9.0-amazonlinux2
+          # - image: swift:5.9.0-rhel-ubi9
           - image: swiftlang/swift:nightly-focal
           - image: swiftlang/swift:nightly-jammy
           - image: swiftlang/swift:nightly-amazonlinux2
@@ -294,7 +329,7 @@ jobs:
           branch: swift-5.8-release
           tag: 5.8-RELEASE
       - name: Clone
-        uses: actions/checkout@v3
+        uses: actions/checkout@v4
       - name: SPM Windows Build
         run: |
           swift build --build-tests -c debug -Xlinker /INCREMENTAL:NO -v
@@ -306,7 +341,7 @@ jobs:
     timeout-minutes: 10
     steps:
       - name: Clone
-        uses: actions/checkout@v3
+        uses: actions/checkout@v4
       - name: Initialize CodeQL
         uses: github/codeql-action/init@v2
         with: