Explorar el Código

refactor(ci): Consolidate quickstart jobs in prerelease.yml (#15252)

Nick Cooke hace 7 meses
padre
commit
176f0839ae
Se han modificado 2 ficheros con 81 adiciones y 298 borrados
  1. 81 298
      .github/workflows/prerelease.yml
  2. 0 0
      scripts/gha-encrypted/qs-authentication.plist.gpg

+ 81 - 298
.github/workflows/prerelease.yml

@@ -215,172 +215,6 @@ jobs:
         pod repo add --silent "${local_repo}" https://"$botaccess"@github.com/Firebase/SpecsTesting.git
         BOT_TOKEN="${botaccess}" .build/debug/spec-repo-builder --sdk-repo $(pwd) --local-spec-repo-name "${local_repo}" --sdk-repo-name SpecsTesting --github-account Firebase --pod-sources 'https://${BOT_TOKEN}@github.com/Firebase/SpecsTesting' "https://github.com/firebase/SpecsDev.git" "https://github.com/firebase/SpecsStaging.git" "https://cdn.cocoapods.org/" "FirebaseFirestoreTestingSupport" "FirebaseAuthTestingSupport" "FirebaseCombineSwift" --keep-repo --include-pods "${updated_podspecs[@]}"
 
-  abtesting_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 == 'workflow_dispatch'
-
-    needs: buildup_SpecsTesting_repo
-    env:
-      plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-      botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }}
-    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 testing repo and quickstart
-      env:
-        LEGACY: true
-      run: BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh abtesting prerelease_testing
-    - 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)
-    - name: Remove data before upload
-      env:
-        LEGACY: true
-      if: ${{ failure() }}
-      run: scripts/remove_data.sh config
-    - uses: actions/upload-artifact@v4
-      if: ${{ failure() }}
-      with:
-        name: quickstart_artifacts_abtesting
-        path: quickstart-ios/
-
-  auth_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 == 'workflow_dispatch'
-    needs: buildup_SpecsTesting_repo
-    env:
-      plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-      botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }}
-    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 testing repo and quickstart
-      run: BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh Authentication prerelease_testing
-    - 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)
-    - name: Remove data before upload
-      if: ${{ failure() }}
-      run: scripts/remove_data.sh authentication
-    - uses: actions/upload-artifact@v4
-      if: ${{ failure() }}
-      with:
-        name: quickstart_artifacts_auth
-        path: quickstart-ios/
-
-  crashlytics_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 == 'workflow_dispatch'
-    needs: buildup_SpecsTesting_repo
-    env:
-      plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-      botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }}
-    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 testing repo and quickstart
-      env:
-        LEGACY: true
-      run: BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh Crashlytics prerelease_testing
-    - 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
-      env:
-        LEGACY: true
-      run: |
-        mkdir -p 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)
-    - name: Remove data before upload
-      env:
-        LEGACY: true
-      if: ${{ failure() }}
-      run: scripts/remove_data.sh crashlytics
-    - uses: actions/upload-artifact@v4
-      if: ${{ failure() }}
-      with:
-        name: quickstart_artifacts_crashlytics
-        path: quickstart-ios/
-
-  database_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 == 'workflow_dispatch'
-    needs: buildup_SpecsTesting_repo
-    env:
-      plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-      botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }}
-    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 testing repo and quickstart
-      run: BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh database prerelease_testing
-    - 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: 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)
-    - name: Remove data before upload
-      if: ${{ failure() }}
-      run: scripts/remove_data.sh database
-    - uses: actions/upload-artifact@v4
-      if: ${{ failure() }}
-      with:
-        name: quickstart_artifacts_database
-        path: quickstart-ios/
-
-  firestore_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 == 'workflow_dispatch'
-    needs: buildup_SpecsTesting_repo
-    env:
-      plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-      botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }}
-    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 testing repo and quickstart
-      run: BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh firestore prerelease_testing
-    - 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)
-    - name: Remove data before upload
-      if: ${{ failure() }}
-      run: scripts/remove_data.sh firestore
-    - uses: actions/upload-artifact@v4
-      if: ${{ failure() }}
-      with:
-        name: quickstart_artifacts_firestore
-        path: quickstart-ios/
-
   # TODO: The functions quickstart uses Material which isn't supported by Xcode 15
   #functions_quickstart:
     # Don't run on private repo unless it is a PR.
@@ -419,156 +253,105 @@ jobs:
     #     name: quickstart_artifacts_functions
     #     path: quickstart-ios/
 
-  inappmessaging_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 == 'workflow_dispatch'
-    needs: buildup_SpecsTesting_repo
-    env:
-      plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-      botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }}
-    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 testing repo and quickstart
-      run: BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh inappmessaging prerelease_testing
-    - 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)
-    - name: Remove data before upload
-      if: ${{ failure() }}
-      run: scripts/remove_data.sh inappmessaging
-    - uses: actions/upload-artifact@v4
-      if: ${{ failure() }}
-      with:
-        name: quickstart_artifacts_inappmessaging
-        path: quickstart-ios/
-
-  messaging_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 == 'workflow_dispatch'
-    needs: buildup_SpecsTesting_repo
-    env:
-      plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-      botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }}
-    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 testing repo and quickstart
-      run: BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh messaging prerelease_testing
-    - 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: 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)
-    - name: Remove data before upload
-      if: ${{ failure() }}
-      run: scripts/remove_data.sh messaging
-    - uses: actions/upload-artifact@v4
-      if: ${{ failure() }}
-      with:
-        name: quickstart_artifacts_messaging
-        path: quickstart-ios/
-
-  remoteconfig_quickstart:
+  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 == 'workflow_dispatch'
     needs: buildup_SpecsTesting_repo
+    strategy:
+      matrix:
+        include:
+          - product: Performance
+            run_tests: true
+            swift: true
+          - product: Storage
+            is_legacy: true
+            run_tests: true
+            swift: true
+          - product: Config
+            run_tests: true
+            objc: true
+          - product: Messaging
+            run_tests: false
+            swift: true
+            objc: true
+          - product: InAppMessaging
+            run_tests: true
+            swift: true
+            objc: true
+          - product: Firestore
+            run_tests: false
+          - product: Database
+            run_tests: false
+            swift: true
+            objc: true
+          - product: Authentication
+            run_tests: false
+            objc: true
+          - product: Crashlytics
+            is_legacy: true
+            run_tests: true
+            objc: false
+            swift: true
+            setup_command: |
+              mkdir -p 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/
+          - product: ABTesting
+            is_legacy: true
+            run_tests: true
+            objc: true
     env:
       plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
       botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }}
+      LEGACY: ${{ matrix.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: Get lowercase product name.
+      id: lowercase_product
+      run: |
+        lowercase_product=$(echo "${{ matrix.product }}" | tr '[:upper:]' '[:lower:]')
+        echo "lowercase_product=$lowercase_product" >> $GITHUB_OUTPUT
     - name: Setup testing repo and quickstart
-      run: BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh config prerelease_testing
+      run: |
+        lowercase_product=${{ steps.lowercase_product.outputs.lowercase_product }}
+        BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh $lowercase_product prerelease_testing
     - 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)
-    - name: Remove data before upload
-      if: ${{ failure() }}
-      run: scripts/remove_data.sh config
-    - uses: actions/upload-artifact@v4
-      if: ${{ failure() }}
+      run: |
+        lowercase_product = ${{ steps.lowercase_product.outputs.lowercase_product }}
+        scripts/decrypt_gha_secret.sh \
+          scripts/gha-encrypted/qs-$lowercase_product.plist.gpg \
+          quickstart-ios/$lowercase_product/GoogleService-Info.plist \
+          "$plist_secret"
+    - name: Run setup command, if needed.
+      if: matrix.setup_command != ''
+      run: ${{ matrix.setup_command }}
+    - name: Build Swift quickstart
+      if: matrix.swift == true
+      uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
       with:
-        name: quickstart_artifacts_config
-        path: quickstart-ios/
-
-  storage_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 == 'workflow_dispatch'
-    needs: buildup_SpecsTesting_repo
-    env:
-      plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-      botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }}
-      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: Setup testing repo and quickstart
-      run: BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh storage prerelease_testing
-    - 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: Test swift quickstart
-      run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Storage true swift)
-    - name: Remove data before upload
-      if: ${{ failure() }}
-      run: scripts/remove_data.sh storage
-    - uses: actions/upload-artifact@v4
-      if: ${{ failure() }}
+        timeout_minutes: 15
+        max_attempts: 3
+        retry_wait_seconds: 120
+        command: scripts/test_quickstart.sh ${{ matrix.product }} ${{ matrix.run_tests }} swift
+    - name: Build Obj-C quickstart
+      if: matrix.objc == true
+      uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
       with:
-        name: quickstart_artifacts_storage
-        path: quickstart-ios/
-
-  performance_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 == 'workflow_dispatch'
-    needs: buildup_SpecsTesting_repo
-    env:
-      plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-      botaccess: ${{ secrets.PRERELEASE_TESTING_PAT }}
-    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 testing repo and quickstart
-      run: BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh Performance prerelease_testing
-    - 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)
-    - name: Remove data before upload
+        timeout_minutes: 15
+        max_attempts: 3
+        retry_wait_seconds: 120
+        command: scripts/test_quickstart.sh ${{ matrix.product }} ${{ matrix.run_tests }}
+    # Failure sequence to upload artifact.
+    - name: Remove data before upload.
       if: ${{ failure() }}
-      run: scripts/remove_data.sh performance
+      run: scripts/remove_data.sh ${{ steps.lowercase_product.outputs.lowercase_product }}
     - uses: actions/upload-artifact@v4
       if: ${{ failure() }}
       with:
-        name: quickstart_artifacts_performance
+        name: quickstart_artifacts_${{ steps.lowercase_product.outputs.lowercase_product }}
         path: quickstart-ios/

+ 0 - 0
scripts/gha-encrypted/qs-auth.plist.gpg → scripts/gha-encrypted/qs-authentication.plist.gpg