|
15 | 15 | description: 'public version # to test against'
|
16 | 16 | downloadPreviousRun:
|
17 | 17 | description: 'previous run # to test against'
|
| 18 | + runIntegrationTests: |
| 19 | + description: 'run integration tests?' |
| 20 | + default: 0 |
18 | 21 |
|
19 | 22 | env:
|
20 | 23 | # Packaging prerequisites
|
@@ -601,45 +604,75 @@ jobs:
|
601 | 604 | firebase-cpp-sdk-android-c++-package
|
602 | 605 | failOnError: false
|
603 | 606 |
|
604 |
| - run_integration_tests: |
605 |
| - name: run-integration-tests |
| 607 | + tests: |
606 | 608 | needs: [merge_packages, download_sdk_package]
|
607 |
| - if: always() |
608 |
| - runs-on: ubuntu-latest |
| 609 | + if: github.event.inputs.runIntegrationTests != 0 && !cancelled() |
| 610 | + runs-on: ${{ matrix.os }} |
| 611 | + strategy: |
| 612 | + matrix: |
| 613 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 614 | + target_platform: [Desktop, Android, iOS] |
| 615 | + exclude: |
| 616 | + - os: ubuntu-latest |
| 617 | + target_platform: iOS |
| 618 | + - os: windows-latest |
| 619 | + target_platform: iOS |
| 620 | + fail-fast: false |
| 621 | + env: |
| 622 | + apis: admob,analytics,auth,database,dynamic_links,firestore,functions,instance_id,messaging,remote_config,storage |
| 623 | + android_device: flame |
| 624 | + android_api: 29 |
| 625 | + ios_device: iphone11pro |
| 626 | + ios_version: 13.3 |
609 | 627 | steps:
|
610 |
| - - name: setup Xcode version (macos) |
611 |
| - if: runner.os == 'macOS' |
612 |
| - run: sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer |
613 |
| - |
614 |
| - - name: download SDK zip |
615 |
| - uses: actions/download-artifact@v2 |
616 |
| - with: |
617 |
| - name: firebase_cpp_sdk.zip |
618 |
| - path: . |
619 |
| - |
620 |
| - - name: download hash |
621 |
| - uses: actions/download-artifact@v2 |
622 |
| - with: |
623 |
| - name: firebase_cpp_sdk_hash.txt |
624 |
| - path: . |
625 |
| - |
626 |
| - - name: List binary SDK files. |
627 |
| - run: | |
628 |
| - # Verify zipfile hash first. |
629 |
| - ${{ env.hashCommand }} -c --quiet firebase_cpp_sdk_hash.txt |
| 628 | + - name: Checkout repo |
| 629 | + |
| 630 | + with: |
| 631 | + ref: ${{ github.event.inputs.commitIdToPackage }} |
| 632 | + - name: Setup Xcode version (macos) |
| 633 | + if: runner.os == 'macOS' |
| 634 | + run: sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer |
| 635 | + - name: Download Firebase C++ SDK |
| 636 | + uses: actions/download-artifact@v2 |
| 637 | + with: |
| 638 | + name: firebase_cpp_sdk.zip |
| 639 | + - name: Unzip Firebase C++ SDK |
| 640 | + shell: bash |
| 641 | + run: | |
| 642 | + ls |
| 643 | + if [ "$RUNNER_OS" == "Windows" ]; then |
| 644 | + 7z x firebase_cpp_sdk.zip |
| 645 | + else |
630 | 646 | unzip -q firebase_cpp_sdk.zip
|
631 |
| - find . -print |
632 |
| -
|
633 |
| - - name: Verify SDK package files. |
634 |
| - run: | |
635 |
| - if [[ -r firebase_cpp_sdk/file_hashes.txt ]]; then |
636 |
| - ${{ env.hashCommand }} -c --quiet firebase_cpp_sdk/file_hashes.txt |
637 |
| - else |
638 |
| - echo "::warning ::SDK package does not contain file_hashes.txt, cannot verify files in package." |
639 |
| - fi |
640 |
| -
|
641 |
| - - name: fetch integration test source |
642 |
| - |
643 |
| - with: |
644 |
| - path: src |
645 |
| - ref: ${{ github.event.inputs.commitIdToPackage }} |
| 647 | + fi |
| 648 | + - name: Setup python |
| 649 | + uses: actions/setup-python@v2 |
| 650 | + with: |
| 651 | + python-version: '3.7' |
| 652 | + - name: Add msbuild to PATH (windows) |
| 653 | + if: runner.os == 'Windows' |
| 654 | + |
| 655 | + - name: Prepare for integration tests |
| 656 | + run: | |
| 657 | + pip install -r scripts/gha/requirements.txt |
| 658 | + python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}" |
| 659 | + - name: Build integration tests (and run Desktop tests) |
| 660 | + run: | |
| 661 | + python scripts/gha/build_testapps.py --t ${{ env.apis }} --p ${{ matrix.target_platform }} --sdk_dir firebase_cpp_sdk --output_directory ${{ github.workspace }} --execute_desktop_testapp --noadd_timestamp |
| 662 | +
|
| 663 | + # Workaround for https://github.com/GoogleCloudPlatform/github-actions/issues/100 |
| 664 | + # Must be run after the Python setup action |
| 665 | + - name: Set CLOUDSDK_PYTHON (Windows) |
| 666 | + if: runner.os == 'Windows' && !cancelled() |
| 667 | + run: echo "CLOUDSDK_PYTHON=${{env.pythonLocation}}\python.exe" >> $GITHUB_ENV |
| 668 | + - name: Install Cloud SDK |
| 669 | + if: ${{ !cancelled() }} |
| 670 | + uses: GoogleCloudPlatform/github-actions/setup-gcloud@master |
| 671 | + - name: Upload Desktop Artifacts to GCS |
| 672 | + if: ${{ !cancelled() }} |
| 673 | + run: | |
| 674 | + python scripts/gha/gcs_uploader.py --testapp_dir testapps --key_file scripts/gha-encrypted/gcs_key_file.json |
| 675 | + - name: Run mobile integration tests |
| 676 | + if: matrix.target_platform != 'Desktop' && !cancelled() |
| 677 | + run: | |
| 678 | + python scripts/gha/test_lab.py --android_model ${{ env.android_device }} --android_api ${{ env.android_api }} --ios_model ${{ env.ios_device }} --ios_version ${{ env.ios_version }} --testapp_dir testapps --code_platform cpp --key_file scripts/gha-encrypted/gcs_key_file.json |
0 commit comments