Răsfoiți Sursa

CI updates for visionOS and Xcode 16: part 2 (#13708)

Paul Beusterien 1 an în urmă
părinte
comite
96ca3cd67d

+ 2 - 0
.github/workflows/abtesting.yml

@@ -43,6 +43,8 @@ jobs:
         command: scripts/pod_lib_lint.rb FirebaseABTesting.podspec --platforms=${{ matrix.target }}
 
   spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
     runs-on: macos-14
     outputs:
       cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}

+ 2 - 0
.github/workflows/appdistribution.yml

@@ -38,6 +38,8 @@ jobs:
          --platforms=${{ matrix.target }}
 
   spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
     runs-on: macos-14
     outputs:
       cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}

+ 44 - 41
.github/workflows/auth.yml

@@ -78,50 +78,10 @@ jobs:
         retry_wait_seconds: 120
         command: scripts/pod_lib_lint.rb ${{ matrix.podspec }} --platforms=${{ matrix.target }} ${{ matrix.tests }} --allow-warnings
 
-  integration-tests:
-    # Don't run on private repo unless it is a PR.
-    if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
-    strategy:
-      matrix:
-        scheme: [ObjCApiTests, SwiftApiTests, AuthenticationExampleUITests]
-
+  spm-package-resolved:
     env:
-      plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
       FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
     runs-on: macos-14
-    steps:
-    - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
-      with:
-        cache_key: integration-tests${{ matrix.os }}
-    - name: Install Secrets
-      run: |
-        scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthCredentials.h.gpg \
-          FirebaseAuth/Tests/SampleSwift/ObjCApiTests/AuthCredentials.h "$plist_secret"
-        scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/SwiftApplication.plist.gpg \
-          FirebaseAuth/Tests/SampleSwift/AuthenticationExample/SwiftApplication.plist "$plist_secret"
-        scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/AuthCredentials.h.gpg \
-          FirebaseAuth/Tests/SampleSwift/AuthCredentials.h "$plist_secret"
-        scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info.plist.gpg \
-          FirebaseAuth/Tests/SampleSwift/GoogleService-Info.plist "$plist_secret"
-        scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info_multi.plist.gpg \
-          FirebaseAuth/Tests/SampleSwift/GoogleService-Info_multi.plist "$plist_secret"
-        scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Sample.entitlements.gpg \
-          FirebaseAuth/Tests/SampleSwift/Sample.entitlements "$plist_secret"
-        scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Credentials.swift.gpg \
-          FirebaseAuth/Tests/SampleSwift/SwiftApiTests/Credentials.swift "$plist_secret"
-    - name: Xcode
-      run: sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
-    - uses: nick-fields/retry@v3
-      with:
-        timeout_minutes: 120
-        max_attempts: 3
-        retry_on: error
-        retry_wait_seconds: 120
-        command: ([ -z $plist_secret ] || scripts/build.sh Auth iOS ${{ matrix.scheme }})
-
-  spm-package-resolved:
-    runs-on: macos-14
     outputs:
       cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
     steps:
@@ -169,6 +129,49 @@ jobs:
         retry_wait_seconds: 120
         command: scripts/third_party/travis/retry.sh ./scripts/build.sh AuthUnit ${{ matrix.target }}
 
+  integration-tests:
+    # Don't run on private repo unless it is a PR.
+    if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
+    strategy:
+      matrix:
+        scheme: [ObjCApiTests, SwiftApiTests, AuthenticationExampleUITests]
+    env:
+      plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    runs-on: macos-14
+    steps:
+    - uses: actions/checkout@v4
+    - uses: actions/cache/restore@v4
+      with:
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
+    - name: Install Secrets
+      run: |
+        scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthCredentials.h.gpg \
+          FirebaseAuth/Tests/SampleSwift/ObjCApiTests/AuthCredentials.h "$plist_secret"
+        scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/SwiftApplication.plist.gpg \
+          FirebaseAuth/Tests/SampleSwift/AuthenticationExample/SwiftApplication.plist "$plist_secret"
+        scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/AuthCredentials.h.gpg \
+          FirebaseAuth/Tests/SampleSwift/AuthCredentials.h "$plist_secret"
+        scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info.plist.gpg \
+          FirebaseAuth/Tests/SampleSwift/GoogleService-Info.plist "$plist_secret"
+        scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info_multi.plist.gpg \
+          FirebaseAuth/Tests/SampleSwift/GoogleService-Info_multi.plist "$plist_secret"
+        scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Sample.entitlements.gpg \
+          FirebaseAuth/Tests/SampleSwift/Sample.entitlements "$plist_secret"
+        scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Credentials.swift.gpg \
+          FirebaseAuth/Tests/SampleSwift/SwiftApiTests/Credentials.swift "$plist_secret"
+    - name: Xcode
+      run: sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
+    - uses: nick-fields/retry@v3
+      with:
+        timeout_minutes: 120
+        max_attempts: 3
+        retry_on: error
+        retry_wait_seconds: 120
+        command: ([ -z $plist_secret ] || scripts/build.sh Auth iOS ${{ matrix.scheme }})
+
   catalyst:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

+ 31 - 18
.github/workflows/core.yml

@@ -22,12 +22,8 @@ jobs:
       matrix:
         # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532
         target: [ios, tvos, macos --skip-tests, watchos]
-        os: [macos-14, macos-13]
-        include:
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-13
-            xcode: Xcode_15.2
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
@@ -39,28 +35,45 @@ jobs:
     - name: Build and test
       run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCore.podspec --platforms=${{ matrix.target }}
 
+  spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    runs-on: macos-14
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
+
   spm:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
-      max-parallel: 1
       matrix:
         target: [iOS, tvOS, macOS, catalyst, watchOS]
-        os: [macos-13, macos-14]
-        include:
-          - os: macos-13
-            xcode: Xcode_15.2
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-14
-            xcode: Xcode_15.3
-            target: visionOS
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Xcode
       run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
     - name: Initialize xcodebuild

+ 2 - 6
.github/workflows/core_extension.yml

@@ -20,12 +20,8 @@ jobs:
     strategy:
       matrix:
         target: [ios, tvos, macos, watchos]
-        os: [macos-14, macos-13]
-        include:
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-13
-            xcode: Xcode_15.2
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4

+ 32 - 16
.github/workflows/core_internal.yml

@@ -18,12 +18,8 @@ jobs:
     strategy:
       matrix:
         target: [ios, tvos, macos, watchos]
-        os: [macos-14, macos-13]
-        include:
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-13
-            xcode: Xcode_15.2
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
@@ -35,25 +31,45 @@ jobs:
     - name: Build and test
       run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCoreInternal.podspec --platforms=${{ matrix.target }}
 
+  spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    runs-on: macos-14
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
+
   spm:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
-      max-parallel: 1
       matrix:
         target: [iOS, tvOS, macOS, catalyst, watchOS]
-        os: [macos-13, macos-14]
-        include:
-          - os: macos-13
-            xcode: Xcode_15.2
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-14
-            xcode: Xcode_15.3
-            target: visionOS
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
+    - uses: actions/cache/restore@v4
+      with:
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Initialize xcodebuild
       run: scripts/setup_spm_tests.sh
     - name: Xcode

+ 32 - 20
.github/workflows/crashlytics.yml

@@ -25,18 +25,12 @@ jobs:
     strategy:
       matrix:
         target: [ios, tvos, macos, watchos --skip-tests]
-        os: [macos-14, macos-13]
+        os: [macos-14]
         flags: [
           '--use-modular-headers',
           ''
         ]
-        include:
-          - os: macos-14
-            xcode: Xcode_15.3
-            tests: --skip-tests
-          - os: macos-13
-            xcode: Xcode_15.2
-            tests:
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
@@ -53,28 +47,46 @@ jobs:
         retry_wait_seconds: 120
         command: scripts/pod_lib_lint.rb FirebaseCrashlytics.podspec --platforms=${{ matrix.target }} ${{ matrix.tests }} ${{ matrix.flags }}
 
+
+  spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    runs-on: macos-14
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
+
   spm:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
-      max-parallel: 1
       matrix:
         target: [iOS, tvOS, macOS, catalyst, watchOS]
-        os: [macos-13, macos-14]
-        include:
-          - os: macos-13
-            xcode: Xcode_15.2
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-14
-            xcode: Xcode_15.3
-            target: visionOS
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Xcode
       run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
     - name: Initialize xcodebuild

+ 32 - 22
.github/workflows/database.yml

@@ -25,16 +25,9 @@ jobs:
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
     strategy:
       matrix:
-        # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532
         target: [ios, tvos, macos --skip-tests, watchos]
-        os: [macos-14, macos-13]
-        include:
-          - os: macos-14
-            xcode: Xcode_15.3
-            tests: --skip-tests
-          - os: macos-13
-            xcode: Xcode_15.2
-            tests: --test-specs=unit
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
@@ -44,7 +37,7 @@ jobs:
     - name: Xcode
       run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
     - name: Build and test
-      run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDatabase.podspec ${{ matrix.tests }} --platforms=${{ matrix.target }}
+      run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDatabase.podspec --test-specs=unit --platforms=${{ matrix.target }}
 
   integration:
     # Don't run on private repo unless it is a PR.
@@ -64,28 +57,45 @@ jobs:
       # Only iOS to mitigate flakes.
       run: scripts/third_party/travis/retry.sh scripts/build.sh Database iOS integration
 
+  spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    runs-on: macos-14
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
+
   spm:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
-      max-parallel: 1
       matrix:
         target: [iOS, tvOS, macOS, catalyst, watchOS]
-        os: [macos-13, macos-14]
-        include:
-          - os: macos-13
-            xcode: Xcode_15.2
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-14
-            xcode: Xcode_15.3
-            target: visionOS
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Xcode
       run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
     - name: Initialize xcodebuild

+ 31 - 15
.github/workflows/dynamiclinks.yml

@@ -22,12 +22,8 @@ jobs:
 
     strategy:
       matrix:
-        os: [macos-14, macos-13]
-        include:
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-13
-            xcode: Xcode_15.2
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
@@ -39,24 +35,44 @@ jobs:
     - name: FirebaseDynamicLinks
       run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDynamicLinks.podspec --allow-warnings
 
+  spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    runs-on: macos-14
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
+
   spm:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
-      max-parallel: 1
       matrix:
-        os: [macos-14, macos-13]
-        include:
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-13
-            xcode: Xcode_15.2
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Xcode
       run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
     - name: Initialize xcodebuild

+ 31 - 16
.github/workflows/firebase_app_check.yml

@@ -21,14 +21,9 @@ jobs:
     strategy:
       matrix:
         podspec: [FirebaseAppCheckInterop.podspec, FirebaseAppCheck.podspec]
-        # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532
         target: [ios, tvos, macos --skip-tests, watchos]
-        os: [macos-14, macos-13]
-        include:
-          - os: macos-13
-            xcode: Xcode_15.2
-          - os: macos-14
-            xcode: Xcode_15.3
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
@@ -96,25 +91,45 @@ jobs:
       # TODO: Remove --allow-warnings when stabilized.
       run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAppCheck.podspec --platforms=ios ${{ matrix.flags }}
 
+  spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    runs-on: macos-14
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
+
   spm:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
-      max-parallel: 1
       matrix:
         target: [iOS, tvOS, macOS, catalyst, watchOS]
-        os: [macos-14, macos-13]
-        include:
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-13
-            xcode: Xcode_15.2
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Xcode
       run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
     - name: Initialize xcodebuild

+ 29 - 12
.github/workflows/firestore.yml

@@ -352,7 +352,7 @@ jobs:
     if: |
       (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') ||
       (github.event_name == 'pull_request')
-    runs-on: macos-13
+    runs-on: macos-14
     strategy:
       matrix:
         podspec: [
@@ -406,7 +406,7 @@ jobs:
             platforms: 'ios'
         include:
           - os: macos-14
-            xcode: Xcode_15.3
+            xcode: Xcode_16
           - os: macos-13
             xcode: Xcode_15.2
     runs-on: ${{ matrix.os }}
@@ -429,8 +429,32 @@ jobs:
             --allow-warnings \
             --no-analyze
 
+  spm-package-resolved:
+    runs-on: macos-14
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+      FIREBASE_SOURCE_FIRESTORE: 1
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
+
   spm-source:
-    needs: check
+    needs: [check, spm-package-resolved]
     # Either a scheduled run from public repo, or a pull request with firestore changes.
     if: |
       (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') ||
@@ -438,15 +462,8 @@ jobs:
     strategy:
       matrix:
         target: [iOS, tvOS, macOS]
-        os: [macos-13, macos-14]
-        include:
-          - os: macos-13
-            xcode: Xcode_15.2
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-14
-            xcode: Xcode_15.3
-            target: visionOS
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     env:
       FIREBASE_SOURCE_FIRESTORE: 1

+ 37 - 23
.github/workflows/functions.yml

@@ -30,12 +30,8 @@ jobs:
     strategy:
       matrix:
         target: [ios, tvos, macos, watchos]
-        os: [macos-14, macos-13]
-        include:
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-13
-            xcode: Xcode_15.2
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
@@ -52,24 +48,47 @@ jobs:
         scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseFunctions.podspec \
           --test-specs=unit --platforms=${{ matrix.target }}
 
+
+  spm-package-resolved:
+    runs-on: macos-14
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
+
   spm-integration:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
-      max-parallel: 1
       matrix:
         os: [macos-14]
-        include:
-          - os: macos-14
-            xcode: Xcode_15.3
+        xcode: [Xcode_15.4]
     runs-on: ${{ matrix.os }}
     env:
       FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Initialize xcodebuild
       run: scripts/setup_spm_tests.sh
     - name: Integration Test Server
@@ -86,24 +105,19 @@ jobs:
   spm-unit:
     # Don't run on private repo.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
       matrix:
         target: [iOS, tvOS, macOS, catalyst, watchOS]
-        os: [macos-13, macos-14]
-        include:
-          - os: macos-13
-            xcode: Xcode_15.2
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-14
-            xcode: Xcode_15.3
-            target: visionOS
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Xcode
       run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
     - name: Initialize xcodebuild

+ 31 - 15
.github/workflows/inappmessaging.yml

@@ -24,12 +24,8 @@ jobs:
     strategy:
       matrix:
         podspec: [FirebaseInAppMessaging.podspec]
-        os: [macos-14, macos-13]
-        include:
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-13
-            xcode: Xcode_15.2
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
@@ -66,24 +62,44 @@ jobs:
     - name: Build and test
       run: scripts/third_party/travis/retry.sh scripts/build.sh InAppMessaging ${{ matrix.platform }} xcodebuild
 
+  spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    runs-on: macos-14
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
+
   spm:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
-      max-parallel: 1
       matrix:
-        os: [macos-14, macos-13]
-        include:
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-13
-            xcode: Xcode_15.2
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Xcode
       run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
     - name: Initialize xcodebuild

+ 32 - 17
.github/workflows/installations.yml

@@ -25,13 +25,13 @@ jobs:
       matrix:
         # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532
         target: [ios, tvos, macos --skip-tests, watchos]
-        os: [macos-14, macos-13]
+        os: [macos-14]
         include:
           - os: macos-14
             xcode: Xcode_15.3
             test-specs: unit,integration
-          - os: macos-13
-            xcode: Xcode_15.2
+          - os: macos-14
+            xcode: Xcode_16
             test-specs: unit
     runs-on: ${{ matrix.os }}
     steps:
@@ -57,29 +57,44 @@ jobs:
        scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseInstallations.podspec \
          --platforms=${{ matrix.target }} --test-specs=--platforms=${{ matrix.test-specs }}
 
+  spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    runs-on: macos-14
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
   spm:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
-      max-parallel: 1
       matrix:
-        # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532
-        target: [iOS, tvOS, macOS, watchOS, catalyst]
-        os: [macos-13, macos-14]
-        include:
-          - os: macos-13
-            xcode: Xcode_15.2
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-14
-            xcode: Xcode_15.3
-            target: visionOS
+        target: [iOS, tvOS, macOS, catalyst, watchOS]
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Xcode
       run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
     - name: Initialize xcodebuild

+ 35 - 18
.github/workflows/messaging.yml

@@ -29,7 +29,7 @@ jobs:
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
     env:
       plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-    runs-on: macos-13
+    runs-on: macos-14
     steps:
     - uses: actions/checkout@v4
     - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
@@ -59,13 +59,13 @@ jobs:
       matrix:
         podspec: [FirebaseMessagingInterop.podspec, FirebaseMessaging.podspec]
         target: [ios, tvos, macos --skip-tests, watchos --skip-tests] # skipping tests on mac because of keychain access
-        os: [macos-14, macos-13]
+        os: [macos-14]
         include:
           - os: macos-14
             xcode: Xcode_15.3
             tests: --test-specs=unit
-          - os: macos-13
-            xcode: Xcode_15.2
+          - os: macos-14
+            xcode: Xcode_16
             tests: --skip-tests
     runs-on: ${{ matrix.os }}
     steps:
@@ -78,34 +78,51 @@ jobs:
     - name: Build and test
       run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} ${{ matrix.tests }} --platforms=${{ matrix.target }}
 
+  spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    runs-on: macos-14
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
+
   spm:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
-      max-parallel: 1
       matrix:
-        target: [iOS, watchOS, tvOS, macOS, catalyst]
-        os: [macos-13, macos-14]
-        include:
-          - os: macos-13
-            xcode: Xcode_15.2
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-14
-            xcode: Xcode_15.3
-            target: visionOS
+        target: [iOS spm, tvOS spmbuildonly, macOS spmbuildonly, catalyst spmbuildonly, watchOS spmbuildonly]
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Initialize xcodebuild
       run: scripts/setup_spm_tests.sh
     - name: Xcode
       run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
     - name: Unit Tests
-      run: scripts/third_party/travis/retry.sh ./scripts/build.sh MessagingUnit ${{ matrix.target }} spm
+      run: scripts/third_party/travis/retry.sh ./scripts/build.sh MessagingUnit ${{ matrix.target }}
 
   catalyst:
     # Don't run on private repo unless it is a PR.

+ 31 - 18
.github/workflows/mlmodeldownloader.yml

@@ -22,12 +22,8 @@ jobs:
     strategy:
       matrix:
         target: [ios, tvos, macos, watchos]
-        os: [macos-14, macos-13]
-        include:
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-13
-            xcode: Xcode_15.2
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
@@ -70,27 +66,44 @@ jobs:
     - name: PodLibLint MLModelDownloader Cron
       run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseMLModelDownloader.podspec --platforms=${{ matrix.target }} --use-static-frameworks
 
+  spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    runs-on: macos-14
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
+
   spm:
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
-      max-parallel: 1
       matrix:
         target: [iOS, tvOS, macOS, catalyst, watchOS]
-        os: [macos-13, macos-14]
-        include:
-          - os: macos-13
-            xcode: Xcode_15.2
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-14
-            xcode: Xcode_15.3
-            target: visionOS
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Xcode
       run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
     - name: Initialize xcodebuild

+ 30 - 14
.github/workflows/performance.yml

@@ -55,12 +55,8 @@ jobs:
     strategy:
       matrix:
         target: [ios, tvos]
-        os: [macos-14, macos-13]
-        include:
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-13
-            xcode: Xcode_15.2
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
@@ -123,24 +119,44 @@ jobs:
         testapp_dir: quickstart-ios/build-for-testing
         test_type: "xctest"
 
+  spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    runs-on: macos-14
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
   spm:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
-      max-parallel: 1
       matrix:
         target: [iOS, tvOS]
-        include:
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-13
-            xcode: Xcode_15.2
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Xcode
       run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
     - name: Initialize xcodebuild

+ 34 - 20
.github/workflows/remoteconfig.yml

@@ -58,20 +58,19 @@ jobs:
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
 
     strategy:
-      max-parallel: 1
       matrix:
         # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532
         target: [ios, tvos, macos --skip-tests, watchos]
         podspec: [FirebaseRemoteConfig.podspec]
-        os: [macos-14, macos-13]
+        os: [macos-14]
         include:
           - os: macos-14
             xcode: Xcode_15.3
             # TODO(#13078): Fix testing infra to enforce warnings again.
             tests: --allow-warnings
           # Flaky tests on CI
-          - os: macos-13
-            xcode: Xcode_15.2
+          - os: macos-14
+            xcode: Xcode_16
             tests: --skip-tests
     runs-on: ${{ matrix.os }}
     steps:
@@ -86,38 +85,53 @@ jobs:
        scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} --platforms=${{ matrix.target }} \
          ${{ matrix.tests }}
 
+  spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    runs-on: macos-14
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
+
   spm:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
       matrix:
         target: [iOS, tvOS, macOS, catalyst, watchOS]
-        os: [macos-13, macos-14]
-        include:
-          - os: macos-13
-            xcode: Xcode_15.2
-            test: spmbuildonly
-          - os: macos-14
-            xcode: Xcode_15.3
-            test: spmbuildonly
-          - os: macos-14
-            xcode: Xcode_15.3
-            target: visionOS
-            test: spm
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Xcode
       run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
     - name: Initialize xcodebuild
       run: scripts/setup_spm_tests.sh
     - name: Unit Tests
-      run: scripts/third_party/travis/retry.sh ./scripts/build.sh RemoteConfigUnit ${{ matrix.target }} ${{ matrix.test }}
+      run: scripts/third_party/travis/retry.sh ./scripts/build.sh RemoteConfigUnit ${{ matrix.target }} spm
     - name: Fake Console tests
-      run: scripts/third_party/travis/retry.sh ./scripts/build.sh RemoteConfigFakeConsole ${{ matrix.target }} ${{ matrix.test }}
+      run: scripts/third_party/travis/retry.sh ./scripts/build.sh RemoteConfigFakeConsole ${{ matrix.target }} spm
 
   catalyst:
     # Don't run on private repo unless it is a PR.

+ 32 - 15
.github/workflows/sessions.yml

@@ -24,14 +24,14 @@ jobs:
     strategy:
       matrix:
         target: [ios, tvos, macos, watchos]
-        os: [macos-14, macos-13]
+        os: [macos-14]
         include:
           - os: macos-14
             xcode: Xcode_15.3
             tests:
           # Flaky tests on CI
-          - os: macos-13
-            xcode: Xcode_15.2
+          - os: macos-14
+            xcode: Xcode_16
             tests: --skip-tests
     runs-on: ${{ matrix.os }}
     steps:
@@ -49,28 +49,45 @@ jobs:
         retry_wait_seconds: 120
         command: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSessions.podspec --platforms=${{ matrix.target }} ${{ matrix.tests }}
 
+  spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    runs-on: macos-14
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
+
   spm:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
-      max-parallel: 1
       matrix:
         target: [iOS, tvOS, macOS, catalyst, watchOS]
-        os: [macos-13, macos-14]
-        include:
-          - os: macos-13
-            xcode: Xcode_15.2
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-14
-            xcode: Xcode_15.3
-            target: visionOS
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Xcode
       run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
     - name: Initialize xcodebuild

+ 31 - 18
.github/workflows/shared-swift.yml

@@ -24,12 +24,8 @@ jobs:
     strategy:
       matrix:
         target: [ios, tvos, macos, watchos]
-        os: [macos-14, macos-13]
-        include:
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-13
-            xcode: Xcode_15.2
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
@@ -41,28 +37,45 @@ jobs:
     - name: Build and test
       run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSharedSwift.podspec --platforms=${{ matrix.target }}
 
+  spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    runs-on: macos-14
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
+
   spm:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
-      max-parallel: 1
       matrix:
         target: [iOS, tvOS, macOS, catalyst, watchOS]
-        os: [macos-13, macos-14]
-        include:
-          - os: macos-13
-            xcode: Xcode_15.2
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-14
-            xcode: Xcode_15.3
-            target: visionOS
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Xcode
       run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
     - name: Initialize xcodebuild

+ 45 - 19
.github/workflows/spm.yml

@@ -22,27 +22,50 @@ concurrency:
     cancel-in-progress: true
 
 jobs:
+  spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    runs-on: macos-14
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
+
   swift-build-run:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
-      max-parallel: 1
       matrix:
-        os: [macos-14, macos-13]
+        os: [macos-14]
         include:
-          # The integration tests are slow and flaky on Xcode 15, so just build.
-          - os: macos-13
-            xcode: Xcode_15.2
-            test: spmbuildonly
+          - os: macos-14
+            xcode: Xcode_16
+            test: spm
           - os: macos-14
             xcode: Xcode_15.3
             test: spm
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Clone mock responses for Vertex AI unit tests
       run: scripts/update_vertexai_responses.sh
     - name: Xcode
@@ -63,20 +86,22 @@ jobs:
   iOS-Device:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
       matrix:
-        os: [macos-14, macos-13]
+        os: [macos-14]
         include:
           - os: macos-14
             xcode: Xcode_15.3
-          - os: macos-13
-            xcode: Xcode_15.2
+          - os: macos-14
+            xcode: Xcode_16
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: device${{ matrix.os }}${{ matrix.xcode }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Clone mock responses for Vertex AI unit tests
       run: scripts/update_vertexai_responses.sh
     - name: Xcode
@@ -89,25 +114,26 @@ jobs:
   platforms:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
-
+    needs: [spm-package-resolved]
     strategy:
       matrix:
         # Full set of Firebase-Package tests only run on iOS. Run subset on other platforms.
         # visionOS isn't buildable from here (even with Firestore source) because the test
         # targets need Analytics.
         target: [tvOS, macOS, catalyst]
-        os: [macos-13, macos-14]
+        os: [macos-14]
         include:
-          - os: macos-13
-            xcode: Xcode_15.2
+          - os: macos-14
+            xcode: Xcode_16
           - os: macos-14
             xcode: Xcode_15.3
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: platforms${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Xcode
       run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
     - name: Initialize xcodebuild

+ 36 - 19
.github/workflows/storage.yml

@@ -25,7 +25,7 @@ jobs:
         language: [Swift, ObjC]
         include:
           - os: macos-14
-            xcode: Xcode_15.3
+            xcode: Xcode_15.4
     env:
       plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
     runs-on: ${{ matrix.os }}
@@ -59,28 +59,45 @@ jobs:
         retry_wait_seconds: 120
         command: ([ -z $plist_secret ] || scripts/build.sh Storage${{ matrix.language }} all)
 
+  spm-package-resolved:
+    env:
+      FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
+    runs-on: macos-14
+    outputs:
+      cache_key: ${{ steps.generate_cache_key.outputs.cache_key }}
+    steps:
+      - uses: actions/checkout@v4
+      - name: Generate Swift Package.resolved
+        id: swift_package_resolve
+        run: |
+          swift package resolve
+      - name: Generate cache key
+        id: generate_cache_key
+        run: |
+          cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}"
+          echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT"
+      - uses: actions/cache/save@v4
+        id: cache
+        with:
+          path: .build
+          key: ${{ steps.generate_cache_key.outputs.cache_key }}
+
   spm:
     # Don't run on private repo unless it is a PR.
     if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    needs: [spm-package-resolved]
     strategy:
-      max-parallel: 1
       matrix:
         target: [iOS, tvOS, macOS, catalyst, watchOS]
-        os: [macos-13, macos-14]
-        include:
-          - os: macos-13
-            xcode: Xcode_15.2
-          - os: macos-14
-            xcode: Xcode_15.3
-          - os: macos-14
-            xcode: Xcode_15.3
-            target: visionOS
+        os: [macos-14]
+        xcode: [Xcode_15.2, Xcode_16]
     runs-on: ${{ matrix.os }}
     steps:
     - uses: actions/checkout@v4
-    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+    - uses: actions/cache/restore@v4
       with:
-        cache_key: spm-cron${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}
+        path: .build
+        key: ${{needs.spm-package-resolved.outputs.cache_key}}
     - name: Xcodes
       run: ls -l /Applications/Xcode*
     - name: Xcode
@@ -156,13 +173,13 @@ jobs:
     strategy:
       matrix:
         target: [ios, tvos, macos, watchos]
-        os: [macos-14, macos-13]
+        os: [macos-14]
         include:
           - os: macos-14
             xcode: Xcode_15.3
             tests: --skip-tests
-          - os: macos-13
-            xcode: Xcode_15.2
+          - os: macos-14
+            xcode: Xcode_16
             tests: --test-specs=unit
     runs-on: ${{ matrix.os }}
     steps:
@@ -185,12 +202,12 @@ jobs:
     strategy:
       matrix:
         target: [ios, tvos, macos, watchos]
-        os: [macos-14, macos-13]
+        os: [macos-14]
         include:
           - os: macos-14
             xcode: Xcode_15.3
-          - os: macos-13
-            xcode: Xcode_15.2
+          - os: macos-14
+            xcode: Xcode_16
     runs-on: ${{ matrix.os }}
     needs: pod-lib-lint
     steps: