diff --git a/.github/workflows/abtesting.yml b/.github/workflows/abtesting.yml index 00cb6e22b6b..e16cb3ddb82 100644 --- a/.github/workflows/abtesting.yml +++ b/.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 }} diff --git a/.github/workflows/appdistribution.yml b/.github/workflows/appdistribution.yml index 1c34f2e97eb..8c80ed4116c 100644 --- a/.github/workflows/appdistribution.yml +++ b/.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 }} diff --git a/.github/workflows/auth.yml b/.github/workflows/auth.yml index 6e6058dc0f3..e9169e19701 100644 --- a/.github/workflows/auth.yml +++ b/.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' diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index d4913b5a428..d8f420f2af3 100644 --- a/.github/workflows/core.yml +++ b/.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 diff --git a/.github/workflows/core_extension.yml b/.github/workflows/core_extension.yml index 1afaa4bb3de..b728bbc3bff 100644 --- a/.github/workflows/core_extension.yml +++ b/.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 diff --git a/.github/workflows/core_internal.yml b/.github/workflows/core_internal.yml index 916e4d2a6b0..c1b38b07422 100644 --- a/.github/workflows/core_internal.yml +++ b/.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 diff --git a/.github/workflows/crashlytics.yml b/.github/workflows/crashlytics.yml index 124e2121b8f..ef4c0ba650c 100644 --- a/.github/workflows/crashlytics.yml +++ b/.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 diff --git a/.github/workflows/database.yml b/.github/workflows/database.yml index 4ff6742cfc2..17b1db109e6 100644 --- a/.github/workflows/database.yml +++ b/.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 diff --git a/.github/workflows/dynamiclinks.yml b/.github/workflows/dynamiclinks.yml index 589825221e8..4fcd9624616 100644 --- a/.github/workflows/dynamiclinks.yml +++ b/.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 diff --git a/.github/workflows/firebase_app_check.yml b/.github/workflows/firebase_app_check.yml index a4b03fe4a64..d001709535a 100644 --- a/.github/workflows/firebase_app_check.yml +++ b/.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 diff --git a/.github/workflows/firestore.yml b/.github/workflows/firestore.yml index 1c684ee5c50..4c98182f859 100644 --- a/.github/workflows/firestore.yml +++ b/.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 diff --git a/.github/workflows/functions.yml b/.github/workflows/functions.yml index 32e9dffcb01..d4207217be3 100644 --- a/.github/workflows/functions.yml +++ b/.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 diff --git a/.github/workflows/inappmessaging.yml b/.github/workflows/inappmessaging.yml index 76eea952f23..c766fd89f31 100644 --- a/.github/workflows/inappmessaging.yml +++ b/.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 diff --git a/.github/workflows/installations.yml b/.github/workflows/installations.yml index 94e7c7831e0..5fe5174fa9a 100644 --- a/.github/workflows/installations.yml +++ b/.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 diff --git a/.github/workflows/messaging.yml b/.github/workflows/messaging.yml index 151166c5715..acc9d6d8c2c 100644 --- a/.github/workflows/messaging.yml +++ b/.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. diff --git a/.github/workflows/mlmodeldownloader.yml b/.github/workflows/mlmodeldownloader.yml index a0d2cd992cc..feae6c76383 100644 --- a/.github/workflows/mlmodeldownloader.yml +++ b/.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 diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 29aa3176bb6..f58bb912a18 100644 --- a/.github/workflows/performance.yml +++ b/.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 diff --git a/.github/workflows/remoteconfig.yml b/.github/workflows/remoteconfig.yml index fe576403f5d..200c19801cf 100644 --- a/.github/workflows/remoteconfig.yml +++ b/.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. diff --git a/.github/workflows/sessions.yml b/.github/workflows/sessions.yml index a80387bab95..c4edb685e1f 100644 --- a/.github/workflows/sessions.yml +++ b/.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 diff --git a/.github/workflows/shared-swift.yml b/.github/workflows/shared-swift.yml index 4b6ea4a12e1..40f1d46fa19 100644 --- a/.github/workflows/shared-swift.yml +++ b/.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 diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml index 5557f1b2865..fec6410ca5d 100644 --- a/.github/workflows/spm.yml +++ b/.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 diff --git a/.github/workflows/storage.yml b/.github/workflows/storage.yml index 1c1bb861e30..b93f4b9141d 100644 --- a/.github/workflows/storage.yml +++ b/.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: