- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.7k
 
refactor(ci): Introduce common, re-usable quickstart workflow #15245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            29 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      67c8af8
              
                refactor(ci): Introduce common, re-usable quickstart workflow
              
              
                ncooke3 4892f96
              
                syntax
              
              
                ncooke3 402f572
              
                fixes
              
              
                ncooke3 a1da3f2
              
                fixes
              
              
                ncooke3 6673bf9
              
                expecting build failure
              
              
                ncooke3 609152f
              
                pass secret
              
              
                ncooke3 c9d7d1e
              
                leg flag
              
              
                ncooke3 53430ea
              
                database
              
              
                ncooke3 c412f7d
              
                secrets:
              
              
                ncooke3 e256cd9
              
                Try to fix syntax
              
              
                ncooke3 4c4d8b4
              
                more
              
              
                ncooke3 c4f8183
              
                Merge branch 'main' into nc/common_quickstart
              
              
                ncooke3 b56b93d
              
                more migration
              
              
                ncooke3 af0198d
              
                comment out
              
              
                ncooke3 abc979b
              
                trailing:
              
              
                ncooke3 639dd8d
              
                Remove guardS
              
              
                ncooke3 5ca5414
              
                fis
              
              
                ncooke3 9f35987
              
                doc comment
              
              
                ncooke3 fadcd65
              
                fst
              
              
                ncooke3 f42d423
              
                add comments
              
              
                ncooke3 3bc88ad
              
                docs
              
              
                ncooke3 61d63fa
              
                Merge branch 'main' into nc/common_quickstart
              
              
                ncooke3 cd517c4
              
                test
              
              
                ncooke3 88ff632
              
                m
              
              
                ncooke3 07b5446
              
                m
              
              
                ncooke3 d6db29a
              
                m
              
              
                ncooke3 56a3978
              
                m
              
              
                ncooke3 493ab6e
              
                Add triggers
              
              
                ncooke3 0a10a6a
              
                re-enable
              
              
                ncooke3 File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -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/ | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.