|
9 | 9 | workflow_dispatch:
|
10 | 10 | inputs:
|
11 | 11 | platforms:
|
12 |
| - description: 'CSV of Desktop, Android and/or iOS' |
13 |
| - default: 'Desktop,Android,iOS' |
| 12 | + description: 'CSV of Desktop, Android, iOS and/or tvOS' |
| 13 | + default: 'Desktop,Android,iOS,tvOS' |
14 | 14 | required: true
|
15 | 15 | apis:
|
16 | 16 | description: 'CSV of apis to build and test'
|
|
26 | 26 | required: true
|
27 | 27 | mobile_test_on:
|
28 | 28 | description: 'Run mobile tests on real and/or virtual devices? (separated by commas)'
|
29 |
| - default: 'real' |
| 29 | + default: 'real,virtual' |
30 | 30 | required: true
|
31 | 31 | use_expanded_matrix:
|
32 | 32 | description: 'Use an expanded matrix? Note: above config will be ignored.'
|
@@ -150,6 +150,7 @@ jobs:
|
150 | 150 | mobile_test_on: ${{ steps.export-result.outputs.mobile_test_on }}
|
151 | 151 | android_device: ${{ steps.export-result.outputs.android_device }}
|
152 | 152 | ios_device: ${{ steps.export-result.outputs.ios_device }}
|
| 153 | + tvos_device: ${{ steps.export-result.outputs.tvos_device }} |
153 | 154 | github_ref: ${{ steps.export-result.outputs.github_ref }}
|
154 | 155 | steps:
|
155 | 156 | - uses: actions/checkout@v2
|
@@ -189,6 +190,7 @@ jobs:
|
189 | 190 | echo "::set-output name=mobile_test_on::${mobile_test_on}"
|
190 | 191 | echo "::set-output name=android_device::$( python scripts/gha/print_matrix_configuration.py -w integration_tests ${EXPANDED_MATRIX_PARAM} -k android_device -t ${mobile_test_on} )"
|
191 | 192 | echo "::set-output name=ios_device::$( python scripts/gha/print_matrix_configuration.py -w integration_tests ${EXPANDED_MATRIX_PARAM} -k ios_device -t ${mobile_test_on} )"
|
| 193 | + echo "::set-output name=tvos_device::$( python scripts/gha/print_matrix_configuration.py -w integration_tests ${EXPANDED_MATRIX_PARAM} -k tvos_device -t ${mobile_test_on} )" |
192 | 194 | if [[ -z "${{github.event.inputs.test_pull_request}}" ]]; then
|
193 | 195 | echo "::warning ::Running on https://github.com/${{github.repository}}/commits/$GITHUB_SHA"
|
194 | 196 | echo "::set-output name=github_ref::$GITHUB_SHA"
|
@@ -378,19 +380,6 @@ jobs:
|
378 | 380 | with:
|
379 | 381 | ref: ${{needs.prepare_matrix.outputs.github_ref}}
|
380 | 382 | submodules: true
|
381 |
| - - name: Set env vars (Linux) |
382 |
| - if: startsWith(matrix.os, 'ubuntu') |
383 |
| - run: echo "VCPKG_TRIPLET=x64-linux" >> $GITHUB_ENV |
384 |
| - - name: Set env vars (macOS) |
385 |
| - if: startsWith(matrix.os, 'macos') |
386 |
| - run: echo "VCPKG_TRIPLET=x64-osx" >> $GITHUB_ENV |
387 |
| - - name: Set env vars (Windows) |
388 |
| - shell: bash |
389 |
| - if: startsWith(matrix.os, 'Windows') |
390 |
| - run: echo "VCPKG_TRIPLET=x64-windows-static" >> $GITHUB_ENV |
391 |
| - - name: Set env vars (all) |
392 |
| - shell: bash |
393 |
| - run: echo "VCPKG_RESPONSE_FILE=external/vcpkg_${{ env.VCPKG_TRIPLET }}_response_file.txt" >> $GITHUB_ENV |
394 | 383 | - name: Add msbuild to PATH (Windows)
|
395 | 384 | if: startsWith(matrix.os, 'windows')
|
396 | 385 |
|
@@ -495,11 +484,6 @@ jobs:
|
495 | 484 | with:
|
496 | 485 | ref: ${{needs.prepare_matrix.outputs.github_ref}}
|
497 | 486 | submodules: true
|
498 |
| - - name: Set env vars (macOS) |
499 |
| - run: echo "VCPKG_TRIPLET=x64-osx" >> $GITHUB_ENV |
500 |
| - - name: Set env vars (all) |
501 |
| - shell: bash |
502 |
| - run: echo "VCPKG_RESPONSE_FILE=external/vcpkg_${{ env.VCPKG_TRIPLET }}_response_file.txt" >> $GITHUB_ENV |
503 | 487 | - name: Setup python
|
504 | 488 | uses: actions/setup-python@v2
|
505 | 489 | with:
|
@@ -581,6 +565,98 @@ jobs:
|
581 | 565 | exit 1
|
582 | 566 | fi
|
583 | 567 |
|
| 568 | + build_tvos: |
| 569 | + name: build-tvos-macos-latest |
| 570 | + needs: [check_trigger, prepare_matrix] |
| 571 | + runs-on: macos-latest |
| 572 | + if: contains(needs.prepare_matrix.outputs.matrix_platform, 'tvOS') && contains(needs.prepare_matrix.outputs.matrix_os, 'macos-latest') && needs.prepare_matrix.outputs.apis != '' && !cancelled() && !failure() |
| 573 | + strategy: |
| 574 | + fail-fast: false |
| 575 | + steps: |
| 576 | + - uses: actions/checkout@v2 |
| 577 | + with: |
| 578 | + ref: ${{needs.prepare_matrix.outputs.github_ref}} |
| 579 | + submodules: true |
| 580 | + - name: Setup python |
| 581 | + uses: actions/setup-python@v2 |
| 582 | + with: |
| 583 | + python-version: ${{ env.pythonVersion }} |
| 584 | + - name: Update homebrew (avoid bintray errors) |
| 585 | + run: | |
| 586 | + # Temporarily here until Github runners have updated their version of |
| 587 | + # homebrew. This prevents errors arising from the shut down of |
| 588 | + # binutils, used by older version of homebrew for hosting packages. |
| 589 | + brew update |
| 590 | + - name: Install SDK tvOS prerequisites |
| 591 | + run: build_scripts/tvos/install_prereqs.sh |
| 592 | + - name: Prepare for integration tests |
| 593 | + run: | |
| 594 | + pip install -r scripts/gha/requirements.txt |
| 595 | + python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}" |
| 596 | + - name: Fetch prebuilt packaged SDK from previous run |
| 597 | + uses: dawidd6/action-download-artifact@v2 |
| 598 | + if: ${{ github.event.inputs.test_packaged_sdk != '' }} |
| 599 | + with: |
| 600 | + name: 'firebase_cpp_sdk.zip' |
| 601 | + workflow: 'cpp-packaging.yml' |
| 602 | + run_id: ${{ github.event.inputs.test_packaged_sdk }} |
| 603 | + - name: Build integration tests |
| 604 | + shell: bash |
| 605 | + run: | |
| 606 | + declare -a additional_flags |
| 607 | + if [[ -n "${{ github.event.inputs.test_packaged_sdk }}" ]]; then |
| 608 | + # Building integration tests against a packaged SDK. |
| 609 | + mkdir downloaded_sdk |
| 610 | + cd downloaded_sdk |
| 611 | + unzip -q ../firebase_cpp_sdk.zip |
| 612 | + cd .. |
| 613 | + additional_flags+=(--packaged_sdk downloaded_sdk/firebase_cpp_sdk) |
| 614 | + fi |
| 615 | + python scripts/gha/build_testapps.py --p tvOS \ |
| 616 | + --t ${{ needs.prepare_matrix.outputs.apis }} \ |
| 617 | + --output_directory "${{ github.workspace }}" \ |
| 618 | + --artifact_name "tvos-macos-latest" \ |
| 619 | + --noadd_timestamp \ |
| 620 | + --short_output_paths \ |
| 621 | + ${additional_flags[*]} |
| 622 | + - name: Upload tvOS integration tests artifact |
| 623 | + |
| 624 | + if: ${{ !cancelled() }} |
| 625 | + with: |
| 626 | + name: testapps-tvos-macos-latest |
| 627 | + path: testapps-tvos-macos-latest |
| 628 | + retention-days: ${{ env.artifactRetentionDays }} |
| 629 | + - name: Upload tvOS build results artifact |
| 630 | + |
| 631 | + if: ${{ !cancelled() }} |
| 632 | + with: |
| 633 | + name: log-artifact |
| 634 | + path: build-results-tvos-macos-latest* |
| 635 | + retention-days: ${{ env.artifactRetentionDays }} |
| 636 | + - name: Download log artifacts |
| 637 | + if: ${{ needs.check_trigger.outputs.should_update_pr && failure() && !cancelled() }} |
| 638 | + |
| 639 | + with: |
| 640 | + path: test_results |
| 641 | + name: log-artifact |
| 642 | + - name: Update PR label and comment |
| 643 | + if: ${{ needs.check_trigger.outputs.should_update_pr && failure() && !cancelled() }} |
| 644 | + run: | |
| 645 | + python scripts/gha/it_workflow.py --stage progress \ |
| 646 | + --token ${{github.token}} \ |
| 647 | + --issue_number ${{needs.check_trigger.outputs.pr_number}}\ |
| 648 | + --actor ${{github.actor}} \ |
| 649 | + --commit ${{needs.prepare_matrix.outputs.github_ref}} \ |
| 650 | + --run_id ${{github.run_id}} |
| 651 | + - name: Summarize build results |
| 652 | + if: ${{ !cancelled() }} |
| 653 | + shell: bash |
| 654 | + run: | |
| 655 | + cat build-results-tvos-macos-latest.log |
| 656 | + if [[ "${{ job.status }}" != "success" ]]; then |
| 657 | + exit 1 |
| 658 | + fi |
| 659 | +
|
584 | 660 | test_desktop:
|
585 | 661 | name: test-desktop-${{ matrix.os }}-${{ matrix.ssl_variant }}
|
586 | 662 | needs: [check_trigger, prepare_matrix, build_desktop]
|
@@ -796,9 +872,70 @@ jobs:
|
796 | 872 | exit 1
|
797 | 873 | fi
|
798 | 874 |
|
| 875 | + test_tvos: |
| 876 | + name: test-tvos-macos-latest-${{ matrix.tvos_device }} |
| 877 | + needs: [check_trigger, prepare_matrix, build_tvos] |
| 878 | + runs-on: macos-latest |
| 879 | + if: contains(needs.prepare_matrix.outputs.matrix_platform, 'tvOS') && needs.prepare_matrix.outputs.apis != '' && !cancelled() |
| 880 | + strategy: |
| 881 | + fail-fast: false |
| 882 | + matrix: |
| 883 | + tvos_device: ${{ fromJson(needs.prepare_matrix.outputs.tvos_device) }} |
| 884 | + steps: |
| 885 | + - uses: actions/checkout@v2 |
| 886 | + with: |
| 887 | + ref: ${{needs.prepare_matrix.outputs.github_ref}} |
| 888 | + - name: Download tvOS integration tests artifact |
| 889 | + |
| 890 | + with: |
| 891 | + path: testapps |
| 892 | + name: testapps-tvos-macos-latest |
| 893 | + - name: Setup python |
| 894 | + uses: actions/setup-python@v2 |
| 895 | + with: |
| 896 | + python-version: ${{ env.pythonVersion }} |
| 897 | + - name: Install python deps |
| 898 | + run: pip install -r scripts/gha/requirements.txt |
| 899 | + - name: Run tvOS integration tests on Simulator locally |
| 900 | + run: | |
| 901 | + python scripts/gha/test_simulator.py --testapp_dir testapps \ |
| 902 | + --tvos_device "${{ matrix.tvos_device }}" \ |
| 903 | + --logfile_name "tvos-macos-latest-${{ matrix.tvos_device }}" \ |
| 904 | + --ci |
| 905 | + - name: Upload tvOS test results artifact |
| 906 | + if: ${{ !cancelled() }} |
| 907 | + |
| 908 | + with: |
| 909 | + name: log-artifact |
| 910 | + path: testapps/test-results-tvos-macos-latest-${{ matrix.tvos_device }}* |
| 911 | + retention-days: ${{ env.artifactRetentionDays }} |
| 912 | + - name: Download log artifacts |
| 913 | + if: ${{ needs.check_trigger.outputs.should_update_pr && failure() && !cancelled() }} |
| 914 | + |
| 915 | + with: |
| 916 | + path: test_results |
| 917 | + name: log-artifact |
| 918 | + - name: Update PR label and comment |
| 919 | + if: ${{ needs.check_trigger.outputs.should_update_pr && failure() && !cancelled() }} |
| 920 | + run: | |
| 921 | + python scripts/gha/it_workflow.py --stage progress \ |
| 922 | + --token ${{github.token}} \ |
| 923 | + --issue_number ${{needs.check_trigger.outputs.pr_number}}\ |
| 924 | + --actor ${{github.actor}} \ |
| 925 | + --commit ${{needs.prepare_matrix.outputs.github_ref}} \ |
| 926 | + --run_id ${{github.run_id}} |
| 927 | + - name: Summarize test results |
| 928 | + if: ${{ !cancelled() }} |
| 929 | + shell: bash |
| 930 | + run: | |
| 931 | + cat "testapps/test-results-tvos-macos-latest-${{ matrix.tvos_device }}.log" |
| 932 | + if [[ "${{ job.status }}" != "success" ]]; then |
| 933 | + exit 1 |
| 934 | + fi |
| 935 | +
|
799 | 936 | summarize_results:
|
800 | 937 | name: "summarize-results"
|
801 |
| - needs: [check_trigger, prepare_matrix, test_desktop, test_android, test_ios] |
| 938 | + needs: [check_trigger, prepare_matrix, test_desktop, test_android, test_ios, test_tvos] |
802 | 939 | runs-on: ubuntu-latest
|
803 | 940 | if: ${{ !cancelled() }}
|
804 | 941 | steps:
|
|
0 commit comments