Explorar o código

refactor(ci): Introduce common, re-usable quickstart workflow (#15245)

Nick Cooke hai 7 meses
pai
achega
056de5b888

+ 9 - 21
.github/workflows/abtesting.yml

@@ -13,6 +13,7 @@ on:
     - '.github/workflows/common.yml'
     - '.github/workflows/common_cocoapods.yml'
     - '.github/workflows/common_catalyst.yml'
+    - '.github/workflows/common_quickstart.yml'
     - 'Gemfile*'
   schedule:
     # Run every day at 2am (PDT) / 5am (EDT) - cron uses UTC times
@@ -40,28 +41,15 @@ jobs:
       product: FirebaseABTesting
 
   quickstart:
-    # 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'
-
-    env:
+    uses: ./.github/workflows/common_quickstart.yml
+    with:
+      product: ABTesting
+      is_legacy: true
+      setup_command: scripts/setup_quickstart.sh abtesting
+      plist_src_path: scripts/gha-encrypted/qs-database.plist.gpg
+      plist_dst_path: quickstart-ios/database/GoogleService-Info.plist
+    secrets:
       plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-    runs-on: macos-15
-    steps:
-    - uses: actions/checkout@v4
-    - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
-    - name: Xcode
-      run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
-    - name: Setup quickstart
-      env:
-        LEGACY: true
-      run: scripts/setup_quickstart.sh abtesting
-    - name: Install Secret GoogleService-Info.plist
-      run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
-          quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
-    - name: Test swift quickstart
-      env:
-        LEGACY: true
-      run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh ABTesting true)
 
   quickstart-ftl-cron-only:
     # Don't run on private repo.

+ 14 - 15
.github/workflows/auth.yml

@@ -13,6 +13,7 @@ on:
     - '.github/workflows/common.yml'
     - '.github/workflows/common_cocoapods.yml'
     - '.github/workflows/common_catalyst.yml'
+    - '.github/workflows/common_quickstart.yml'
     - 'scripts/gha-encrypted/AuthSample/SwiftApplication.plist.gpg'
     - 'Gemfile*'
   schedule:
@@ -92,22 +93,16 @@ jobs:
         command: ([ -z $plist_secret ] || scripts/build.sh Auth iOS ${{ matrix.scheme }})
 
   quickstart:
-    # 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'
-
-    env:
+    uses: ./.github/workflows/common_quickstart.yml
+    with:
+      product: Authentication
+      is_legacy: false
+      setup_command: scripts/setup_quickstart.sh authentication
+      plist_src_path: scripts/gha-encrypted/qs-auth.plist.gpg
+      plist_dst_path: quickstart-ios/authentication/GoogleService-Info.plist
+      run_tests: false
+    secrets:
       plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-    runs-on: macos-15
-    steps:
-    - uses: actions/checkout@v4
-    - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
-    - name: Setup quickstart
-      run: scripts/setup_quickstart.sh authentication
-    - name: Install Secret GoogleService-Info.plist
-      run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-auth.plist.gpg \
-          quickstart-ios/authentication/GoogleService-Info.plist "$plist_secret"
-    - name: Test swift quickstart
-      run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Authentication false)
 
   # TODO(@sunmou99): currently have issue with this job, will re-enable it once the issue resolved.
   # quickstart-ftl-cron-only:
@@ -116,6 +111,7 @@ jobs:
 
   #   env:
   #     plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
+  #     signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
   #   runs-on: macos-14
   #   steps:
   #   - uses: actions/checkout@v4
@@ -150,6 +146,9 @@ jobs:
           '--use-static-frameworks'
         ]
     needs: pod_lib_lint
+    env:
+      plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
+    runs-on: macos-14
     steps:
     - uses: actions/checkout@v4
     - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1

+ 114 - 0
.github/workflows/common_quickstart.yml

@@ -0,0 +1,114 @@
+name: common_quickstart
+
+permissions:
+  contents: read
+
+on:
+  workflow_call:
+    # Re-usable workflows do not automatically inherit the caller's secrets.
+    #
+    # This workflow decrypts encrypted files, so the calling workflow needs to
+    # pass the secret to the re-usable workflow.
+    #
+    # Example:
+    #
+    #   quickstart:
+    #     uses: ./.github/workflows/common_quickstart.yml
+    #     with:
+    #       # ...
+    #     secrets:
+    #       plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
+    #
+    secrets:
+      plist_secret:
+        required: true
+
+    inputs:
+      # The product to test be tested (e.g. `ABTesting`).
+      product:
+        type: string
+        required: true
+
+      # Whether to test the legacy version of the quickstart.
+      is_legacy:
+        type: boolean
+        required: true
+
+      # The path to the encrypted `GoogleService-Info.plist` file.
+      plist_src_path:
+        type: string
+        required: true
+
+      # The destination path for the decrypted `GoogleService-Info.plist` file.
+      plist_dst_path:
+        type: string
+        required: true
+
+      # The type of quickstart to test.
+      #
+      # Options: [swift, objc]
+      quickstart_type:
+        type: string
+        required: false
+        default: objc
+
+      # Whether to run tests or just build. Defaults to true.
+      run_tests:
+        type: boolean
+        required: false
+        default: true
+
+      # A command to execute before testing.
+      #
+      # Example: `scripts/setup_quickstart.sh functions`
+      setup_command:
+        type: string
+        required: false
+        default: ""
+
+jobs:
+  quickstart:
+    # Run on the main repo's scheduled jobs or pull requests and manual workflow invocations.
+    if: (github.repository == 'firebase/firebase-ios-sdk' && github.event_name == 'schedule') || contains(fromJSON('["pull_request", "workflow_dispatch"]'), github.event_name)
+    env:
+      plist_secret: ${{ secrets.plist_secret }}
+      LEGACY: ${{ inputs.is_legacy && true || '' }}
+    runs-on: macos-15
+    steps:
+    - uses: actions/checkout@v4
+    - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
+    - name: Xcode
+      run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
+    - name: Run setup command.
+      run: ${{ inputs.setup_command }}
+    - name: Install Secret GoogleService-Info.plist
+      run: |
+          scripts/decrypt_gha_secret.sh \
+            ${{ inputs.plist_src_path }} \
+            ${{ inputs.plist_dst_path }} \
+            "$plist_secret"
+    - name: Build ${{ inputs.product }} Quickstart (${{ inputs.quickstart_type }} / ${{ inputs.is_legacy && 'Legacy' || 'Non-Legacy' }})
+      uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
+      with:
+        timeout_minutes: 15
+        max_attempts: 3
+        retry_wait_seconds: 120
+        command: |
+          scripts/test_quickstart.sh \
+            ${{ inputs.product }} \
+            ${{ inputs.run_tests }} \
+            ${{ inputs.quickstart_type }}
+    # Failure sequence to upload artifact.
+    - id: lowercase_product
+      if: ${{ failure() }}
+      run: |
+        lowercase_product=$(echo "${{ inputs.product }}" | tr '[:upper:]' '[:lower:]')
+        echo "lowercase_product=$lowercase_product" >> $GITHUB_OUTPUT
+    - name: Remove data before upload.
+      if: ${{ failure() }}
+      run: scripts/remove_data.sh ${{ steps.lowercase_product.outputs.lowercase_product }}
+    - uses: actions/upload-artifact@v4
+      if: ${{ failure() }}
+      with:
+        name: quickstart_artifacts_${{ steps.lowercase_product.outputs.lowercase_product }}
+        path: quickstart-ios/

+ 12 - 23
.github/workflows/crashlytics.yml

@@ -13,6 +13,7 @@ on:
     - '.github/workflows/common.yml'
     - '.github/workflows/common_cocoapods.yml'
     - '.github/workflows/common_catalyst.yml'
+    - '.github/workflows/common_quickstart.yml'
     - 'Interop/Analytics/Public/*.h'
     - 'Gemfile*'
   schedule:
@@ -42,33 +43,21 @@ jobs:
       buildonly_platforms: tvOS, macOS, watchOS
 
   quickstart:
-    # 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'
-
-    env:
-      plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-    runs-on: macos-15
-    steps:
-    - uses: actions/checkout@v4
-    - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
-    - name: Xcode
-      run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
-    - name: Setup quickstart
-      run: scripts/setup_quickstart.sh crashlytics
-      env:
-        LEGACY: true
-    - name: Install Secret GoogleService-Info.plist
-      run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-crashlytics.plist.gpg \
-          quickstart-ios/crashlytics/GoogleService-Info.plist "$plist_secret"
-    - name: Test swift quickstart
-      run: |
+    uses: ./.github/workflows/common_quickstart.yml
+    with:
+      product: Crashlytics
+      is_legacy: true
+      quickstart_type: swift
+      setup_command: |
+        scripts/setup_quickstart.sh crashlytics
         mkdir quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics
         # Set the deployed pod location of run and upload-symbols with the development pod version.
         cp Crashlytics/run quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/
         cp Crashlytics/upload-symbols quickstart-ios/crashlytics/LegacyCrashlyticsQuickstart/Pods/FirebaseCrashlytics/
-        ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Crashlytics true swift)
-      env:
-        LEGACY: true
+      plist_src_path: scripts/gha-encrypted/qs-crashlytics.plist.gpg
+      plist_dst_path: quickstart-ios/crashlytics/GoogleService-Info.plist
+    secrets:
+      plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
 
   quickstart-ftl-cron-only:
     # Don't run on private repo.

+ 14 - 18
.github/workflows/database.yml

@@ -16,6 +16,7 @@ on:
     - '.github/workflows/common.yml'
     - '.github/workflows/common_cocoapods.yml'
     - '.github/workflows/common_catalyst.yml'
+    - '.github/workflows/common_quickstart.yml'
     - 'Gemfile*'
     - 'scripts/run_database_emulator.sh'
   schedule:
@@ -69,25 +70,20 @@ jobs:
       run: scripts/third_party/travis/retry.sh scripts/build.sh Database iOS integration
 
   quickstart:
-    # 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'
-    env:
+    uses: ./.github/workflows/common_quickstart.yml
+    strategy:
+      matrix:
+        quickstart_type: [objc, swift]
+    with:
+      product: Database
+      is_legacy: false
+      setup_command: scripts/setup_quickstart.sh database
+      plist_src_path: scripts/gha-encrypted/qs-database.plist.gpg
+      plist_dst_path: quickstart-ios/database/GoogleService-Info.plist
+      quickstart_type: ${{ matrix.quickstart_type }}
+      run_tests: false
+    secrets:
       plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-    runs-on: macos-15
-    steps:
-    - uses: actions/checkout@v4
-    - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
-    - name: Setup quickstart
-      run: scripts/setup_quickstart.sh database
-    - name: Install Secret GoogleService-Info.plist
-      run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-database.plist.gpg \
-          quickstart-ios/database/GoogleService-Info.plist "$plist_secret"
-    - name: Xcode
-      run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
-    - name: Test objc quickstart
-      run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false)
-    - name: Test swift quickstart
-      run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Database false swift)
 
   database-cron-only:
     # Don't run on private repo.

+ 11 - 18
.github/workflows/firestore.yml

@@ -598,23 +598,16 @@ jobs:
         if: needs.*.result == 'failure'
         run: exit 1
 
-  # Disable until FirebaseUI is updated to accept Firebase 9 and quickstart is updated to accept
-  # Firebase UI 12
+  # TODO: Disable until FirebaseUI is updated to accept Firebase 9 and
+  # quickstart is updated to accept Firebase UI 12
   # quickstart:
-  #   # 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'
-  #   env:
+  #   uses: ./.github/workflows/common_quickstart.yml
+  #   with:
+  #     product: Firestore
+  #     is_legacy: true
+  #     setup_command: scripts/setup_quickstart.sh firestore
+  #     plist_src_path: scripts/gha-encrypted/qs-firestore.plist.gpg
+  #     plist_dst_path: quickstart-ios/firestore/GoogleService-Info.plist
+  #     run_tests: false
+  #   secrets:
   #     plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-  #   runs-on: macos-14
-  #   needs: check
-
-  #   steps:
-  #   - uses: actions/checkout@v4
-  #   - name: Setup quickstart
-  #     run: scripts/setup_quickstart.sh firestore
-  #   - name: Install Secret GoogleService-Info.plist
-  #     run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-firestore.plist.gpg \
-  #         quickstart-ios/firestore/GoogleService-Info.plist "$plist_secret"
-  #   - name: Test swift quickstart
-  #     run: ([ -z $plist_secret ] ||
-  #           scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Firestore false)

+ 16 - 25
.github/workflows/functions.yml

@@ -50,32 +50,23 @@ jobs:
     with:
       target: FirebaseFunctionsUnit
 
-  # TODO: Move to macos-14 and Xcode 15. The legacy quickstart uses material which doesn't build on Xcode 15.
+  # TODO: The legacy quickstart uses material which doesn't build on Xcode 15.
   # quickstart:
-  #   # 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'
-  #   env:
-  #     plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-  #     LEGACY: true
-  #   # TODO: Move to macos-14 and Xcode 15. The legacy quickstart uses material which doesn't build on Xcode 15.
-  #   runs-on: macos-12
-
-  #   steps:
-  #   - uses: actions/checkout@v4
-  #   - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
-  #   - name: Setup quickstart
-  #     run: scripts/setup_quickstart.sh functions
-  #   - name: install secret googleservice-info.plist
-  #     run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-functions.plist.gpg \
-  #         quickstart-ios/functions/GoogleService-Info.plist "$plist_secret"
-  #   - name: Setup custom URL scheme
-  #     run: sed -i '' 's/REVERSED_CLIENT_ID/com.googleusercontent.apps.1025801074639-6p6ebi8amuklcjrto20gvpe295smm8u6/' quickstart-ios/functions/LegacyFunctionsQuickstart/FunctionsExample/Info.plist
-  #   - name: Test objc quickstart
-  #     run: ([ -z $plist_secret ] ||
-  #           scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true)
-  #   - name: Test swift quickstart
-  #     run: ([ -z $plist_secret ] ||
-  #           scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Functions true swift)
+  #     uses: ./.github/workflows/common_quickstart.yml
+  #     strategy:
+  #       matrix:
+  #         quickstart_type: [objc, swift]
+  #     with:
+  #       product: Functions
+  #       is_legacy: true
+  #       setup_command: |
+  #         scripts/setup_quickstart.sh functions
+  #         sed -i '' 's/REVERSED_CLIENT_ID/com.googleusercontent.apps.1025801074639-6p6ebi8amuklcjrto20gvpe295smm8u6/' quickstart-ios/functions/LegacyFunctionsQuickstart/FunctionsExample/Info.plist
+  #       plist_src_path: scripts/gha-encrypted/qs-functions.plist.gpg
+  #       plist_dst_path: quickstart-ios/functions/GoogleService-Info.plist
+  #       quickstart_type: ${{ matrix.quickstart_type }}
+  #     secrets:
+  #       plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
 
   # quickstart-ftl-cron-only:
   #   # Don't run on private repo

+ 13 - 23
.github/workflows/inappmessaging.yml

@@ -12,6 +12,7 @@ on:
     - '.github/workflows/inappmessaging.yml'
     - '.github/workflows/common.yml'
     - '.github/workflows/common_cocoapods.yml'
+    - '.github/workflows/common_quickstart.yml'
     - 'Gemfile*'
   schedule:
     # Run every day at 11pm (PDT) / 2am (EDT) - cron uses UTC times
@@ -85,27 +86,16 @@ jobs:
       run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseInAppMessaging.podspec --platforms=${{ matrix.platform }} ${{ matrix.flags }}
 
   quickstart:
-    # 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'
-
-    env:
+    uses: ./.github/workflows/common_quickstart.yml
+    strategy:
+      matrix:
+        quickstart_type: [objc, swift]
+    with:
+      product: InAppMessaging
+      is_legacy: false
+      quickstart_type: ${{ matrix.quickstart_type }}
+      setup_command: scripts/setup_quickstart.sh inappmessaging
+      plist_src_path: scripts/gha-encrypted/qs-inappmessaging.plist.gpg
+      plist_dst_path: quickstart-ios/inappmessaging/GoogleService-Info.plist
+    secrets:
       plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-    runs-on: macos-15
-
-    steps:
-    - uses: actions/checkout@v4
-    - uses: actions/checkout@v4
-    - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
-    - name: Xcode
-      run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
-    - name: Setup quickstart
-      run: scripts/setup_quickstart.sh inappmessaging
-    - name: install secret googleservice-info.plist
-      run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-inappmessaging.plist.gpg \
-          quickstart-ios/inappmessaging/GoogleService-Info.plist "$plist_secret"
-    - name: Test objc quickstart
-      run: ([ -z $plist_secret ] ||
-            scripts/third_party/travis/retry.sh scripts/test_quickstart.sh InAppMessaging true)
-    - name: Test swift quickstart
-      run: ([ -z $plist_secret ] ||
-            scripts/third_party/travis/retry.sh scripts/test_quickstart.sh InAppMessaging true swift)

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

@@ -12,6 +12,7 @@ on:
     - '.github/workflows/common.yml'
     - '.github/workflows/common_cocoapods.yml'
     - '.github/workflows/common_catalyst.yml'
+    - '.github/workflows/common_quickstart.yml'
     - 'Gemfile*'
   schedule:
     # Run every day at 11pm (PDT) / 2am (EDT) - cron uses UTC times
@@ -48,23 +49,19 @@ jobs:
       plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
 
   quickstart:
-    # 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'
-
-    runs-on: macos-15
-    steps:
-    - uses: actions/checkout@v4
-    - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
-    - name: Xcode
-      run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
-    - name: Setup quickstart
-      run: scripts/setup_quickstart.sh installations
-    - name: Copy mock plist
-      run: cp quickstart-ios/mock-GoogleService-Info.plist quickstart-ios/installations/GoogleService-Info.plist
-    - name: Test objc quickstart
-      run: scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Installations true
-    - name: Test swift quickstart
-      run: scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Installations true swift
+    uses: ./.github/workflows/common_quickstart.yml
+    strategy:
+      matrix:
+        quickstart_type: [objc, swift]
+    with:
+      product: Installations
+      is_legacy: false
+      setup_command: scripts/setup_quickstart.sh installations
+      plist_src_path: scripts/gha-encrypted/Installations/GoogleService-Info.plist.gpg
+      plist_dst_path: quickstart-ios/installations/GoogleService-Info.plist
+      quickstart_type: ${{ matrix.quickstart_type }}
+    secrets:
+      plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
 
   quickstart-ftl-cron-only:
     # Don't run on private repo.

+ 13 - 24
.github/workflows/messaging.yml

@@ -19,6 +19,7 @@ on:
     - '.github/workflows/common.yml'
     - '.github/workflows/common_cocoapods.yml'
     - '.github/workflows/common_catalyst.yml'
+    - '.github/workflows/common_quickstart.yml'
     # Rebuild on Ruby infrastructure changes
     - 'Gemfile*'
   schedule:
@@ -80,32 +81,20 @@ jobs:
       run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/build.sh Messaging all)
 
   quickstart:
-    # 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'
-    env:
-      plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
+    uses: ./.github/workflows/common_quickstart.yml
     strategy:
       matrix:
-        include:
-          - os: macos-15
-            xcode: Xcode_16.4
-    runs-on: ${{ matrix.os }}
-    steps:
-    - uses: actions/checkout@v4
-    - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
-    - name: Setup quickstart
-      run: scripts/setup_quickstart.sh messaging
-    - name: Install Secret GoogleService-Info.plist
-      run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-messaging.plist.gpg \
-          quickstart-ios/messaging/GoogleService-Info.plist "$plist_secret"
-    - name: Xcode
-      run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
-    - name: Test objc quickstart
-      run: ([ -z $plist_secret ] ||
-            scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Messaging false)
-    - name: Test swift quickstart
-      run: ([ -z $plist_secret ] ||
-            scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Messaging false swift)
+        quickstart_type: [objc, swift]
+    with:
+      product: Messaging
+      is_legacy: false
+      quickstart_type: ${{ matrix.quickstart_type }}
+      setup_command: scripts/setup_quickstart.sh messaging
+      plist_src_path: scripts/gha-encrypted/qs-messaging.plist.gpg
+      plist_dst_path: quickstart-ios/messaging/GoogleService-Info.plist
+      run_tests: false
+    secrets:
+      plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
 
   quickstart-ftl-cron-only:
     # Don't run on private repo.

+ 11 - 19
.github/workflows/performance.yml

@@ -19,6 +19,7 @@ on:
     - '.github/workflows/common.yml'
     - '.github/workflows/common_cocoapods.yml'
     - '.github/workflows/common_catalyst.yml'
+    - '.github/workflows/common_quickstart.yml'
     # Rebuild on Ruby infrastructure changes
     - 'Gemfile*'
   schedule:
@@ -76,27 +77,18 @@ jobs:
       #TODO: tests are not supported with Xcode 15 because the test spec depends on the iOS 8 GDCWebServer
       buildonly_platforms: iOS, tvOS
 
+  # TODO: The legacy ObjC quickstarts don't run with Xcode 15, re-able if we get these working.
   quickstart:
-    if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
-
-    env:
+    uses: ./.github/workflows/common_quickstart.yml
+    with:
+      product: Performance
+      is_legacy: false
+      quickstart_type: swift
+      setup_command: scripts/setup_quickstart.sh performance
+      plist_src_path: scripts/gha-encrypted/qs-performance.plist.gpg
+      plist_dst_path: quickstart-ios/performance/GoogleService-Info.plist
+    secrets:
       plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-    runs-on: macos-15
-    steps:
-    - uses: actions/checkout@v4
-    - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
-    - name: Xcode
-      run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
-    - name: Setup quickstart
-      run: scripts/setup_quickstart.sh performance
-    - name: Install Secret GoogleService-Info.plist
-      run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-performance.plist.gpg \
-          quickstart-ios/performance/GoogleService-Info.plist "$plist_secret"
-    - name: Test swift quickstart
-      run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true swift)
-    # TODO: The legacy ObjC quickstarts don't run with Xcode 15, re-able if we get these working.
-    # - name: Test objc quickstart
-    #   run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true)
 
   quickstart-ftl-cron-only:
     if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'

+ 15 - 22
.github/workflows/remoteconfig.yml

@@ -13,6 +13,7 @@ on:
     - '.github/workflows/common.yml'
     - '.github/workflows/common_cocoapods.yml'
     - '.github/workflows/common_catalyst.yml'
+    - '.github/workflows/common_quickstart.yml'
     - 'Gemfile*'
     - 'scripts/generate_access_token.sh'
     - 'scripts/gha-encrypted/RemoteConfigSwiftAPI/**'
@@ -72,12 +73,12 @@ jobs:
     - name: Xcode
       run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
     - name: Fake Console API Tests
-      uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
-      with:
-        timeout_minutes: 15
-        max_attempts: 3
-        retry_wait_seconds: 120
-        command: scripts/build.sh RemoteConfig ${{ matrix.target }} fakeconsole
+     uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
+     with:
+       timeout_minutes: 15
+       max_attempts: 3
+       retry_wait_seconds: 120
+       command: scripts/build.sh RemoteConfig ${{ matrix.target }} fakeconsole
     - name: IntegrationTest
       if: matrix.target == 'iOS'
       # No retry to avoid exhausting AccessToken quota.
@@ -89,23 +90,15 @@ jobs:
       product: FirebaseRemoteConfig
 
   quickstart:
-    # 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'
-    env:
+    uses: ./.github/workflows/common_quickstart.yml
+    with:
+      product: Config
+      is_legacy: false
+      setup_command: scripts/setup_quickstart.sh config
+      plist_src_path: scripts/gha-encrypted/qs-config.plist.gpg
+      plist_dst_path: quickstart-ios/config/GoogleService-Info.plist
+    secrets:
       plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-    runs-on: macos-15
-    steps:
-    - uses: actions/checkout@v4
-    - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
-    - name: Xcode
-      run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
-    - name: Setup quickstart
-      run: scripts/setup_quickstart.sh config
-    - name: Install Secret GoogleService-Info.plist
-      run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-config.plist.gpg \
-          quickstart-ios/config/GoogleService-Info.plist "$plist_secret"
-    - name: Test Swift Quickstart
-      run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Config true)
 
   # TODO(@sunmou99): currently have issue with this job, will re-enable it once the issue resolved.
   # quickstart-ftl-cron-only:

+ 11 - 25
.github/workflows/storage.yml

@@ -13,6 +13,7 @@ on:
     - '.github/workflows/common.yml'
     - '.github/workflows/common_cocoapods.yml'
     - '.github/workflows/common_catalyst.yml'
+    - '.github/workflows/common_quickstart.yml'
     # Rebuild on Ruby infrastructure changes.
     - 'Gemfile*'
   schedule:
@@ -77,33 +78,18 @@ jobs:
         command: ([ -z $plist_secret ] || scripts/build.sh Storage${{ matrix.language }} all)
 
   quickstart:
-    # 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'
     # TODO: See #12399 and restore Objective-C testing for Xcode 15 if GHA is fixed.
-    strategy:
-      matrix:
-        include:
-          #- os: macos-13
-          #  xcode: Xcode_14.2 # TODO: the legacy ObjC quickstart doesn't build with Xcode 15.
-          - swift: swift
-            os: macos-15
-            xcode: Xcode_16.4
-    env:
+    uses: ./.github/workflows/common_quickstart.yml
+    with:
+      product: Storage
+      quickstart_type: swift
+      is_legacy: true
+      setup_command: scripts/setup_quickstart.sh storage
+      plist_src_path: scripts/gha-encrypted/qs-storage.plist.gpg
+      plist_dst_path: quickstart-ios/storage/GoogleService-Info.plist
+      run_tests: false
+    secrets:
       plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-      LEGACY: true
-    runs-on: ${{ matrix.os }}
-    steps:
-    - uses: actions/checkout@v4
-    - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
-    - name: Setup quickstart
-      run: scripts/setup_quickstart.sh storage
-    - name: Install Secret GoogleService-Info.plist
-      run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-storage.plist.gpg \
-          quickstart-ios/storage/GoogleService-Info.plist "$plist_secret"
-    - name: Xcode
-      run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer
-    - name: Test quickstart
-      run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Storage false ${{ matrix.swift }})
 
   quickstart-ftl-cron-only:
     # Don't run on private repo.