diff --git a/.github/workflows/abtesting.yml b/.github/workflows/abtesting.yml index bd56f8190cc..ed1e574d5e0 100644 --- a/.github/workflows/abtesting.yml +++ b/.github/workflows/abtesting.yml @@ -17,6 +17,11 @@ concurrency: cancel-in-progress: true jobs: + spm: + uses: ./.github/workflows/common.yml + with: + target: ABTestingUnit + pod-lib-lint: # 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' @@ -55,81 +60,6 @@ jobs: retry_wait_seconds: 120 command: scripts/pod_lib_lint.rb FirebaseABTesting.podspec --platforms=${{ matrix.target }} - spm-package-resolved: - env: - FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 - runs-on: macos-15 - outputs: - cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} - steps: - - uses: actions/checkout@v4 - - name: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer - - 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: - include: - - os: macos-14 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: tvOS - - os: macos-15 - xcode: Xcode_16.2 - target: macOS - - os: macos-15 - xcode: Xcode_16.2 - target: watchOS - - os: macos-15 - xcode: Xcode_16.2 - target: catalyst - - os: macos-15 - xcode: Xcode_16.2 - target: visionOS - 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: Xcode - run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - - name: Install visionOS, if needed. - if: matrix.target == 'visionOS' - run: xcodebuild -downloadPlatform visionOS - - name: Initialize xcodebuild - run: scripts/setup_spm_tests.sh - - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3 - with: - timeout_minutes: 120 - max_attempts: 3 - retry_on: error - retry_wait_seconds: 120 - command: scripts/build.sh ABTestingUnit ${{ matrix.target }} spm - 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/appdistribution.yml b/.github/workflows/appdistribution.yml index ad7f3c227c3..a79d3a53f90 100644 --- a/.github/workflows/appdistribution.yml +++ b/.github/workflows/appdistribution.yml @@ -16,6 +16,12 @@ concurrency: cancel-in-progress: true jobs: + spm: + uses: ./.github/workflows/common.yml + with: + target: AppDistributionUnit + platforms: iOS + pod-lib-lint: # 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' @@ -40,54 +46,6 @@ jobs: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAppDistribution.podspec \ --platforms=ios - 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: - include: - - os: macos-14 - xcode: Xcode_16.2 - - os: macos-15 - xcode: Xcode_16.3 - 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: Xcode - run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - - name: Initialize xcodebuild - run: scripts/setup_spm_tests.sh - - name: iOS Unit Tests - run: scripts/third_party/travis/retry.sh ./scripts/build.sh AppDistributionUnit iOS spm - 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/auth.yml b/.github/workflows/auth.yml index 7dff79459b6..68bf07f695e 100644 --- a/.github/workflows/auth.yml +++ b/.github/workflows/auth.yml @@ -21,6 +21,11 @@ concurrency: cancel-in-progress: true jobs: + spm: + uses: ./.github/workflows/common.yml + with: + target: AuthUnit + buildonly_platforms: macOS pod-lib-lint: # Don't run on private repo unless it is a PR. @@ -58,6 +63,8 @@ jobs: cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} steps: - uses: actions/checkout@v4 + - name: Xcode + run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer - name: Generate Swift Package.resolved id: swift_package_resolve run: | @@ -73,56 +80,6 @@ jobs: 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: - include: - - os: macos-14 - xcode: Xcode_16.2 - target: iOS spm - - os: macos-15 - xcode: Xcode_16.3 - target: iOS spm - - os: macos-15 - xcode: Xcode_16.3 - target: tvOS spm - - os: macos-15 - xcode: Xcode_16.3 - target: macOS spmbuildonly - - os: macos-15 - xcode: Xcode_16.3 - target: watchOS spm - - os: macos-15 - xcode: Xcode_16.3 - target: catalyst spm - - os: macos-15 - xcode: Xcode_16.3 - target: visionOS spm - 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: Xcode - run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - - name: Install visionOS, if needed. - if: matrix.target == 'visionOS spm' - run: xcodebuild -downloadPlatform visionOS - - name: Initialize xcodebuild - run: scripts/setup_spm_tests.sh - - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3 - with: - timeout_minutes: 120 - max_attempts: 3 - retry_on: error - 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' diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml new file mode 100644 index 00000000000..7709db0e71a --- /dev/null +++ b/.github/workflows/common.yml @@ -0,0 +1,96 @@ +name: common + +on: + workflow_call: + inputs: + # The target scheme to be tested. + target: + type: string + required: true + + # The platforms to build on. Defaults to all. + platforms: + type: string + required: false + default: "iOS, tvOS, macOS, watchOS, catalyst, visionOS" + + # By default, all platforms will be tested (see matrix in `spm` job). + # To build instead of test, pass a comma or space separated string of + # platforms. + # + # Platform options: [iOS, tvOS, macOS, watchOS, catalyst, visionOS] + # + # Examples: + # - build only for macOS: `macOS` + # - build only for macOS and tvOS: `macOS, tvOS` + # - build only for all platforms: `all` + buildonly_platforms: + type: string + required: false + default: "" + +jobs: + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-15 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Xcode + run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer + - 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: + os: [macos-15] + xcode: [Xcode_16.2] + platform: [iOS, tvOS, macOS, watchOS, catalyst, visionOS] + include: + - os: macos-14 + xcode: Xcode_16.2 + platform: iOS + 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: Xcode + run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer + - name: Install visionOS, if needed. + if: matrix.platform == 'visionOS' + run: xcodebuild -downloadPlatform visionOS + - name: Initialize xcodebuild + run: scripts/setup_spm_tests.sh + - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3 + if: contains(join(inputs.platforms), matrix.platform) || matrix.os == 'macos-14' + with: + timeout_minutes: 120 + max_attempts: 3 + retry_on: error + retry_wait_seconds: 120 + command: | + ./scripts/build.sh \ + ${{ inputs.target }} \ + ${{ matrix.platform }} \ + ${{ (contains(inputs.buildonly_platforms, matrix.platform) || contains(inputs.buildonly_platforms, 'all')) && 'spmbuildonly' || 'spm' }} diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index cff05b59633..0387677c351 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -16,6 +16,11 @@ concurrency: cancel-in-progress: true jobs: + spm: + uses: ./.github/workflows/common.yml + with: + target: CoreUnit + pod-lib-lint: # 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' @@ -67,55 +72,6 @@ jobs: 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: - # TODO: Add Xcode matrix when Xcode 16 is ubiquitous on CI runners. - include: - - os: macos-14 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: tvOS - - os: macos-15 - xcode: Xcode_16.2 - target: macOS - - os: macos-15 - xcode: Xcode_16.2 - target: watchOS - - os: macos-15 - xcode: Xcode_16.2 - target: catalyst - - os: macos-15 - xcode: Xcode_16.2 - target: visionOS - 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: Xcode - run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - - name: Install visionOS, if needed. - if: matrix.target == 'visionOS' - run: xcodebuild -downloadPlatform visionOS - - name: Initialize xcodebuild - run: scripts/setup_spm_tests.sh - - name: Unit Tests - run: scripts/third_party/travis/retry.sh ./scripts/build.sh CoreUnit ${{ matrix.target }} spm - 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_internal.yml b/.github/workflows/core_internal.yml index 26054ed80ba..ffdb590559c 100644 --- a/.github/workflows/core_internal.yml +++ b/.github/workflows/core_internal.yml @@ -13,6 +13,11 @@ on: - cron: '0 10 * * *' jobs: + spm: + uses: ./.github/workflows/common.yml + with: + target: FirebaseCoreInternalTests + pod-lib-lint: # 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' @@ -42,76 +47,6 @@ 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: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer - - 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: - include: - - os: macos-14 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: tvOS - - os: macos-15 - xcode: Xcode_16.2 - target: macOS - - os: macos-15 - xcode: Xcode_16.2 - target: watchOS - - os: macos-15 - xcode: Xcode_16.2 - target: catalyst - - os: macos-15 - xcode: Xcode_16.2 - target: visionOS - 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 - run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - - name: Install visionOS, if needed. - if: matrix.target == 'visionOS' - run: xcodebuild -downloadPlatform visionOS - - name: FirebaseCoreInternalTests - run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseCoreInternalTests ${{ matrix.target }} spm - 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/crashlytics.yml b/.github/workflows/crashlytics.yml index e49d316e398..07ff1b1def4 100644 --- a/.github/workflows/crashlytics.yml +++ b/.github/workflows/crashlytics.yml @@ -18,6 +18,10 @@ concurrency: cancel-in-progress: true jobs: + spm: + uses: ./.github/workflows/common.yml + with: + target: FirebaseCrashlyticsUnit pod-lib-lint: # Don't run on private repo unless it is a PR. @@ -53,82 +57,6 @@ jobs: retry_wait_seconds: 120 command: scripts/pod_lib_lint.rb FirebaseCrashlytics.podspec --platforms=${{ matrix.target }} ${{ matrix.build-env.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: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer - - 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: - include: - - os: macos-14 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: tvOS - - os: macos-15 - xcode: Xcode_16.2 - target: macOS - - os: macos-15 - xcode: Xcode_16.2 - target: watchOS - - os: macos-15 - xcode: Xcode_16.2 - target: catalyst - - os: macos-15 - xcode: Xcode_16.2 - target: visionOS - 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: Xcode - run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - - name: Install visionOS, if needed. - if: matrix.target == 'visionOS' - run: xcodebuild -downloadPlatform visionOS - - name: Initialize xcodebuild - run: scripts/setup_spm_tests.sh - - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3 - with: - timeout_minutes: 120 - max_attempts: 3 - retry_on: error - retry_wait_seconds: 120 - command: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseCrashlyticsUnit ${{ matrix.target }} spm - 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/database.yml b/.github/workflows/database.yml index 4f6ef256257..7a1b286cb4d 100644 --- a/.github/workflows/database.yml +++ b/.github/workflows/database.yml @@ -21,6 +21,14 @@ concurrency: cancel-in-progress: true jobs: + spm: + strategy: + matrix: + target: [DatabaseUnit, DatabaseUnitSwift] + uses: ./.github/workflows/common.yml + with: + target: ${{ matrix.target }} + pod-lib-lint: # 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' @@ -63,75 +71,6 @@ 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: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer - - 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: - include: - - os: macos-14 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: tvOS - - os: macos-15 - xcode: Xcode_16.2 - target: macOS - - os: macos-15 - xcode: Xcode_16.2 - target: watchOS - - os: macos-15 - xcode: Xcode_16.2 - target: catalyst - - os: macos-15 - xcode: Xcode_16.2 - target: visionOS - 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: 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 DatabaseUnit ${{ matrix.target }} spm - - name: iOS Swift Unit Tests - run: scripts/third_party/travis/retry.sh ./scripts/build.sh DatabaseUnitSwift ${{ matrix.target }} spm - 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/dynamiclinks.yml b/.github/workflows/dynamiclinks.yml index 10cd6d8a232..f13dacfd968 100644 --- a/.github/workflows/dynamiclinks.yml +++ b/.github/workflows/dynamiclinks.yml @@ -17,6 +17,16 @@ concurrency: cancel-in-progress: true jobs: + spm: + strategy: + matrix: + target: [FirebaseAppCheckUnit, FirebaseAppCheckUnitSwift] + uses: ./.github/workflows/common.yml + with: + target: FirebaseDynamicLinks + buildonly_platforms: iOS + platforms: iOS + pod_lib_lint: # 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' @@ -39,56 +49,6 @@ 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: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer - - 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: - include: - - os: macos-14 - xcode: Xcode_16.2 - - os: macos-15 - xcode: Xcode_16.2 - 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: Xcode - run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - - name: Initialize xcodebuild - run: scripts/setup_spm_tests.sh - - name: iOS Unit Tests - run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseDynamicLinks iOS spmbuildonly - dynamiclinks-cron-only: # Don't run on private repo. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk' diff --git a/.github/workflows/firebase_app_check.yml b/.github/workflows/firebase_app_check.yml index 814a142b33b..791921e6c8b 100644 --- a/.github/workflows/firebase_app_check.yml +++ b/.github/workflows/firebase_app_check.yml @@ -16,6 +16,14 @@ concurrency: cancel-in-progress: true jobs: + spm: + strategy: + matrix: + target: [FirebaseAppCheckUnit, FirebaseAppCheckUnitSwift] + uses: ./.github/workflows/common.yml + with: + target: ${{ matrix.target }} + pod_lib_lint: # 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' @@ -100,75 +108,3 @@ jobs: - name: PodLibLint FirebaseAppCheck Cron # 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: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer - - 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: - include: - - os: macos-14 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: tvOS - - os: macos-15 - xcode: Xcode_16.2 - target: macOS - - os: macos-15 - xcode: Xcode_16.2 - target: watchOS - - os: macos-15 - xcode: Xcode_16.2 - target: catalyst - - os: macos-15 - xcode: Xcode_16.2 - target: visionOS - 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: Xcode - run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - - name: Install visionOS, if needed. - if: matrix.target == 'visionOS spm' - run: xcodebuild -downloadPlatform visionOS - - name: Initialize xcodebuild - run: scripts/setup_spm_tests.sh - - name: Unit Tests - run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseAppCheckUnit ${{ matrix.target }} spm - - name: Swift Unit Tests - run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseAppCheckUnitSwift ${{ matrix.target }} spm diff --git a/.github/workflows/inappmessaging.yml b/.github/workflows/inappmessaging.yml index d4786922a2f..363b0f16ba6 100644 --- a/.github/workflows/inappmessaging.yml +++ b/.github/workflows/inappmessaging.yml @@ -17,6 +17,12 @@ concurrency: cancel-in-progress: true jobs: + spm: + uses: ./.github/workflows/common.yml + with: + target: FirebaseInAppMessaging-Beta + platforms: iOS + buildonly_platforms: iOS pod_lib_lint: # Don't run on private repo unless it is a PR. @@ -68,56 +74,6 @@ 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: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer - - 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: - include: - - os: macos-14 - xcode: Xcode_16.2 - - os: macos-15 - xcode: Xcode_16.2 - 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: Xcode - run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - - name: Initialize xcodebuild - run: scripts/setup_spm_tests.sh - - name: iOS Unit Tests - run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseInAppMessaging-Beta iOS spmbuildonly - fiam-cron-only: # Don't run on private repo. if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk' diff --git a/.github/workflows/installations.yml b/.github/workflows/installations.yml index 0d3153e5dd2..0f15589ab74 100644 --- a/.github/workflows/installations.yml +++ b/.github/workflows/installations.yml @@ -16,6 +16,12 @@ concurrency: cancel-in-progress: true jobs: + spm: + uses: ./.github/workflows/common.yml + with: + target: FirebaseInstallations + buildonly_platforms: all + pod-lib-lint: # 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' @@ -57,72 +63,6 @@ jobs: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseInstallations.podspec \ --platforms=${{ matrix.target }} --test-specs=${{ matrix.build-env.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: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer - - 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: - include: - - os: macos-14 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: tvOS - - os: macos-15 - xcode: Xcode_16.2 - target: macOS - - os: macos-15 - xcode: Xcode_16.2 - target: watchOS - - os: macos-15 - xcode: Xcode_16.2 - target: catalyst - - os: macos-15 - xcode: Xcode_16.2 - target: visionOS - 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: 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 FirebaseInstallations ${{ matrix.target }} spmbuildonly - catalyst: if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' runs-on: macos-15 diff --git a/.github/workflows/messaging.yml b/.github/workflows/messaging.yml index 3fc6e92fc7b..7af613cb311 100644 --- a/.github/workflows/messaging.yml +++ b/.github/workflows/messaging.yml @@ -23,6 +23,11 @@ concurrency: cancel-in-progress: true jobs: + spm: + uses: ./.github/workflows/common.yml + with: + target: MessagingUnit + buildonly_platforms: tvOS, macOS, watchOS, catalyst, visionOS # TODO(#12205) Update the build.sh script for this job from "test" instead of "build" messaging-integration-tests: @@ -78,73 +83,6 @@ jobs: - name: Build and test run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} ${{ matrix.build-env.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: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer - - 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: - include: - - os: macos-14 - xcode: Xcode_16.2 - target: iOS spmbuildonly - - os: macos-15 - xcode: Xcode_16.2 - target: iOS spm - - os: macos-15 - xcode: Xcode_16.2 - target: tvOS spmbuildonly - - os: macos-15 - xcode: Xcode_16.2 - target: macOS spmbuildonly - - os: macos-15 - xcode: Xcode_16.2 - target: watchOS spmbuildonly - - os: macos-15 - xcode: Xcode_16.2 - target: catalyst spmbuildonly - - os: macos-15 - xcode: Xcode_16.2 - target: visionOS spmbuildonly - 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 - 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 }} - 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/mlmodeldownloader.yml b/.github/workflows/mlmodeldownloader.yml index b68db76e5c7..3f59912e4ad 100644 --- a/.github/workflows/mlmodeldownloader.yml +++ b/.github/workflows/mlmodeldownloader.yml @@ -16,6 +16,11 @@ concurrency: cancel-in-progress: true jobs: + spm: + uses: ./.github/workflows/common.yml + with: + target: FirebaseMLModelDownloaderUnit + pod-lib-lint: if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' env: @@ -72,75 +77,6 @@ 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: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer - - 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: - matrix: - include: - - os: macos-14 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: tvOS - - os: macos-15 - xcode: Xcode_16.2 - target: macOS - - os: macos-15 - xcode: Xcode_16.2 - target: watchOS - - os: macos-15 - xcode: Xcode_16.2 - target: catalyst - - os: macos-15 - xcode: Xcode_16.2 - target: visionOS - 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: Xcode - run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - - name: Install visionOS, if needed. - if: matrix.target == 'visionOS' - run: xcodebuild -downloadPlatform visionOS - - name: Initialize xcodebuild - run: scripts/setup_spm_tests.sh - - name: Unit Tests - run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseMLModelDownloaderUnit ${{ matrix.target }} spm - catalyst: if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' runs-on: macos-15 diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index f455d00a366..a3f61b9c349 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -24,6 +24,11 @@ concurrency: cancel-in-progress: true jobs: + spm: + uses: ./.github/workflows/common.yml + with: + target: PerformanceUnit + platforms: iOS, tvOS # Build and run the unit tests for Firebase performance SDK. performance: @@ -128,60 +133,6 @@ 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: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer - - 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: - include: - - os: macos-14 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: tvOS - 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: 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 PerformanceUnit ${{ matrix.target }} spm - catalyst: if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' runs-on: macos-15 diff --git a/.github/workflows/remoteconfig.yml b/.github/workflows/remoteconfig.yml index c6ca84bbd1b..51ab6b72bfb 100644 --- a/.github/workflows/remoteconfig.yml +++ b/.github/workflows/remoteconfig.yml @@ -19,6 +19,16 @@ concurrency: cancel-in-progress: true jobs: + spm_1: + uses: ./.github/workflows/common.yml + with: + target: RemoteConfigUnit + + spm_2: + uses: ./.github/workflows/common.yml + with: + target: RemoteConfigFakeConsole + buildonly_platforms: watchOS remoteconfig: # Don't run on private repo unless it is a PR. @@ -87,85 +97,6 @@ jobs: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} --platforms=${{ matrix.target }} \ ${{ matrix.build-env.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: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer - - 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: - include: - - os: macos-14 - xcode: Xcode_16.2 - target: iOS - test: spm - - os: macos-15 - xcode: Xcode_16.2 - target: iOS - test: spm - - os: macos-15 - xcode: Xcode_16.2 - target: tvOS - test: spm - - os: macos-15 - xcode: Xcode_16.2 - target: macOS - test: spm - - os: macos-15 - xcode: Xcode_16.2 - target: watchOS - test: spmbuildonly - - os: macos-15 - xcode: Xcode_16.2 - target: catalyst - test: spm - - os: macos-15 - xcode: Xcode_16.2 - target: visionOS - test: spm - 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: Xcode - run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - - name: Install visionOS, if needed. - if: matrix.target == 'visionOS' - run: xcodebuild -downloadPlatform visionOS - - 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 }} spm - - name: Fake Console tests - run: scripts/third_party/travis/retry.sh ./scripts/build.sh RemoteConfigFakeConsole ${{ matrix.target }} ${{ matrix.test }} - 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/sessions.yml b/.github/workflows/sessions.yml index 4fbd1ccb643..33e9dbfba9b 100644 --- a/.github/workflows/sessions.yml +++ b/.github/workflows/sessions.yml @@ -17,6 +17,10 @@ concurrency: cancel-in-progress: true jobs: + spm: + uses: ./.github/workflows/common.yml + with: + target: FirebaseSessionsUnit pod-lib-lint: # Don't run on private repo unless it is a PR. @@ -49,81 +53,6 @@ jobs: retry_wait_seconds: 120 command: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSessions.podspec --platforms=${{ matrix.target }} ${{ matrix.build-env.tests }} - spm-package-resolved: - env: - FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 - runs-on: macos-15 - outputs: - cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} - steps: - - uses: actions/checkout@v4 - - name: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer - - 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: - include: - - os: macos-14 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: tvOS - - os: macos-15 - xcode: Xcode_16.2 - target: macOS - - os: macos-15 - xcode: Xcode_16.2 - target: watchOS - - os: macos-15 - xcode: Xcode_16.2 - target: catalyst - - os: macos-15 - xcode: Xcode_16.2 - target: visionOS - 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: Xcode - run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - - name: Install visionOS, if needed. - if: matrix.target == 'visionOS' - run: xcodebuild -downloadPlatform visionOS - - name: Initialize xcodebuild - run: scripts/setup_spm_tests.sh - - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3 - with: - timeout_minutes: 120 - max_attempts: 3 - retry_on: error - retry_wait_seconds: 120 - command: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseSessionsUnit ${{ matrix.target }} spm - 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/shared-swift.yml b/.github/workflows/shared-swift.yml index 4975512fcf2..fe1b1e20303 100644 --- a/.github/workflows/shared-swift.yml +++ b/.github/workflows/shared-swift.yml @@ -17,6 +17,10 @@ concurrency: cancel-in-progress: true jobs: + spm: + uses: ./.github/workflows/common.yml + with: + target: FirebaseSharedSwiftTests pod-lib-lint: # Don't run on private repo unless it is a PR. @@ -47,54 +51,3 @@ jobs: run: sed -i "" "s/s.swift_version[[:space:]]*=[[:space:]]*'5.9'/s.swift_version = '${{ matrix.build-env.swift_version }}'/" FirebaseSharedSwift.podspec - 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: Xcode - run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer - - 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] - build-env: - - os: macos-14 - xcode: Xcode_16.2 - - os: macos-15 - xcode: Xcode_16.2 - runs-on: ${{ matrix.build-env.os }} - steps: - - uses: actions/checkout@v4 - - uses: actions/cache/restore@v4 - with: - path: .build - key: ${{needs.spm-package-resolved.outputs.cache_key}} - - name: Xcode - run: sudo xcode-select -s /Applications/${{ matrix.build-env.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 FirebaseSharedSwiftTests ${{ matrix.target }} spm diff --git a/.github/workflows/storage.yml b/.github/workflows/storage.yml index 6e77207d651..1b11f50f516 100644 --- a/.github/workflows/storage.yml +++ b/.github/workflows/storage.yml @@ -18,6 +18,11 @@ concurrency: cancel-in-progress: true jobs: + spm: + uses: ./.github/workflows/common.yml + with: + target: FirebaseStorageUnit + storage-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' @@ -60,76 +65,6 @@ 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: - matrix: - include: - - os: macos-14 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: iOS - - os: macos-15 - xcode: Xcode_16.2 - target: tvOS - - os: macos-15 - xcode: Xcode_16.2 - target: macOS - - os: macos-15 - xcode: Xcode_16.2 - target: watchOS - - os: macos-15 - xcode: Xcode_16.2 - target: catalyst - - os: macos-15 - xcode: Xcode_16.2 - target: visionOS - 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: Xcodes - run: ls -l /Applications/Xcode* - - name: Xcode - run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - - name: Install visionOS, if needed. - if: matrix.target == 'visionOS spm' - run: xcodebuild -downloadPlatform visionOS - - name: Initialize xcodebuild - run: scripts/setup_spm_tests.sh - - name: Unit Tests - run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseStorageUnit ${{ matrix.target }} spm - 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'