Просмотр исходного кода

[Infra] Refactor prerelease.yml

Nick Cooke 1 год назад
Родитель
Сommit
d89febb976
1 измененных файлов с 16 добавлено и 42 удалено
  1. 16 42
      .github/workflows/prerelease.yml

+ 16 - 42
.github/workflows/prerelease.yml

@@ -589,17 +589,24 @@ jobs:
         name: quickstart_artifacts_config
         path: quickstart-ios/
 
-  storage_quickstart:
+  storage_and_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
+    strategy:
+      matrix:
+        include:
+          - product: storage
+            legacy: true
+          - product: performance
+            legacy: false
     env:
       plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
       signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
       bot_token_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
       testing_repo_dir: "/tmp/test/"
       testing_repo: "firebase-ios-sdk"
-      LEGACY: true
+      LEGACY: ${{ matrix.legacy }}
     runs-on: macos-14
     steps:
     - uses: actions/checkout@v4
@@ -610,52 +617,19 @@ jobs:
     - name: Setup testing repo and quickstart
       run: |
           botaccess=`cat bot-access.txt`
-          BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh storage prerelease_testing
+          BOT_TOKEN="${botaccess}" scripts/setup_quickstart.sh ${{ matrix.product }} 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"
+      run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-${{ matrix.product }}.plist.gpg \
+          quickstart-ios/${{ matrix.product }}/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() }}
-      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 }}
-      signin_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-      bot_token_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
-      testing_repo_dir: "/tmp/test/"
-      testing_repo: "firebase-ios-sdk"
-    runs-on: macos-14
-    steps:
-    - uses: actions/checkout@v4
-    - uses: ruby/setup-ruby@v1
-    - name: Get token
-      run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/prerelease-testing-token.txt.gpg \
-          bot-access.txt "$bot_token_secret"
-    - name: Setup testing repo and quickstart
-      run: |
-          botaccess=`cat bot-access.txt`
-          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"
+      run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh ${{ matrix.product }} true swift)
     - name: Test swift quickstart
-      run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh Performance true swift)
+      run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart.sh ${{ matrix.product }} true swift)
     - name: Remove data before upload
       if: ${{ failure() }}
-      run: scripts/remove_data.sh performance
+      run: scripts/remove_data.sh ${{ matrix.product }}
     - uses: actions/upload-artifact@v4
       if: ${{ failure() }}
       with:
-        name: quickstart_artifacts_performance
+        name: quickstart_artifacts_${{ matrix.product }}
         path: quickstart-ios/