From 04c11addb79269349b0ed934627db64437c5313b Mon Sep 17 00:00:00 2001 From: Mou Date: Thu, 2 Dec 2021 15:09:22 -0800 Subject: [PATCH 1/2] timeout & retry "install integration test deps" step --- .github/workflows/integration_tests.yml | 137 +++++++++++++++--------- 1 file changed, 89 insertions(+), 48 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 494159b07..60ebc9752 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -145,7 +145,12 @@ jobs: with: python-version: ${{ env.pythonVersion }} - name: Install python deps - run: pip install -r scripts/gha/requirements.txt + uses: nick-invision/retry@v2 + with: + timeout_minutes: 1 + max_attempts: 3 + shell: bash + command: pip install -r scripts/gha/requirements.txt - id: matrix_config run: | if [[ "${{ steps.set_outputs.outputs.requested_tests }}" == "expanded" ]]; then @@ -260,30 +265,40 @@ jobs: # homebrew. This prevents errors arising from the shut down of # binutils, used by older version of homebrew for hosting packages. brew update - - name: Install SDK Desktop prerequisites - run: | - python scripts/gha/install_prereqs_desktop.py - - name: Prepare for integration tests - run: | - pip install -r scripts/gha/requirements.txt - python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}" + - name: Install Desktop SDK & integration tests prerequisites + uses: nick-invision/retry@v2 + with: + timeout_minutes: 2 + max_attempts: 3 + command: | + python scripts/gha/install_prereqs_desktop.py + pip install -r scripts/gha/requirements.txt + python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}" - name: Install OpenSSL (Windows) - if: matrix.ssl_variant == 'openssl' && - startsWith(matrix.os, 'windows') - run: | - choco install openssl -r + if: matrix.ssl_variant == 'openssl' && startsWith(matrix.os, 'windows') + uses: nick-invision/retry@v2 + with: + timeout_minutes: 4 + max_attempts: 3 + shell: bash + command: choco install openssl -r - name: Install OpenSSL (macOS) - if: matrix.ssl_variant == 'openssl' && - startsWith(matrix.os, 'macos') - run: | - brew install openssl - # brew won't overwrite MacOS system default OpenSSL, so force it here. - echo "OPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1" >> $GITHUB_ENV + if: matrix.ssl_variant == 'openssl' && startsWith(matrix.os, 'macos') + uses: nick-invision/retry@v2 + with: + timeout_minutes: 2 + max_attempts: 3 + command: | + brew install openssl + # brew won't overwrite MacOS system default OpenSSL, so force it here. + echo "OPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1" >> $GITHUB_ENV - name: Install OpenSSL (Linux) - if: matrix.ssl_variant == 'openssl' && - startsWith(matrix.os, 'ubuntu') - run: | - sudo apt install openssl + if: matrix.ssl_variant == 'openssl' && startsWith(matrix.os, 'ubuntu') + uses: nick-invision/retry@v2 + with: + timeout_minutes: 2 + max_attempts: 3 + command: sudo apt install openssl - name: Fetch prebuilt packaged SDK from previous run uses: dawidd6/action-download-artifact@v2 if: ${{ github.event.inputs.test_packaged_sdk != '' }} @@ -429,14 +444,16 @@ jobs: # homebrew. This prevents errors arising from the shut down of # binutils, used by older version of homebrew for hosting packages. brew update - - name: Install SDK Android prerequisites - shell: bash - run: | - build_scripts/android/install_prereqs.sh - - name: Prepare for integration tests - run: | - pip install -r scripts/gha/requirements.txt - python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}" + - name: Install Android SDK & integration tests prerequisites + uses: nick-invision/retry@v2 + with: + timeout_minutes: 10 + max_attempts: 3 + shell: bash + command: | + build_scripts/android/install_prereqs.sh + pip install -r scripts/gha/requirements.txt + python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}" - name: Fetch prebuilt packaged SDK from previous run uses: dawidd6/action-download-artifact@v2 if: ${{ github.event.inputs.test_packaged_sdk != '' }} @@ -544,12 +561,15 @@ jobs: # homebrew. This prevents errors arising from the shut down of # binutils, used by older version of homebrew for hosting packages. brew update - - name: Install SDK iOS prerequisites - run: build_scripts/ios/install_prereqs.sh - - name: Prepare for integration tests - run: | - pip install -r scripts/gha/requirements.txt - python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}" + - name: Install iOS SDK & integration tests prerequisites + uses: nick-invision/retry@v2 + with: + timeout_minutes: 2 + max_attempts: 3 + command: | + build_scripts/ios/install_prereqs.sh + pip install -r scripts/gha/requirements.txt + python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}" - name: Fetch prebuilt packaged SDK from previous run uses: dawidd6/action-download-artifact@v2 if: ${{ github.event.inputs.test_packaged_sdk != '' }} @@ -652,12 +672,15 @@ jobs: # homebrew. This prevents errors arising from the shut down of # binutils, used by older version of homebrew for hosting packages. brew update - - name: Install SDK tvOS prerequisites - run: build_scripts/tvos/install_prereqs.sh - - name: Prepare for integration tests - run: | - pip install -r scripts/gha/requirements.txt - python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}" + - name: Install tvOS SDK & integration tests prerequisites + uses: nick-invision/retry@v2 + with: + timeout_minutes: 2 + max_attempts: 3 + command: | + build_scripts/tvos/install_prereqs.sh + pip install -r scripts/gha/requirements.txt + python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}" - name: Fetch prebuilt packaged SDK from previous run uses: dawidd6/action-download-artifact@v2 if: ${{ github.event.inputs.test_packaged_sdk != '' }} @@ -763,9 +786,14 @@ jobs: run: | npm install -g firebase-tools - name: Setup integration test deps - run: | - pip install -r scripts/gha/requirements.txt - python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}" --artifact testapps + uses: nick-invision/retry@v2 + with: + timeout_minutes: 2 + max_attempts: 3 + shell: bash + command: | + pip install -r scripts/gha/requirements.txt + python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}" --artifact testapps - name: Run Desktop integration tests run: firebase emulators:exec --only firestore --project demo-example 'python scripts/gha/desktop_tester.py --testapp_dir testapps --logfile_name "desktop-${{ matrix.os }}-${{ matrix.ssl_variant }}"' env: @@ -835,7 +863,12 @@ jobs: with: python-version: ${{ env.pythonVersion }} - name: Install python deps - run: pip install -r scripts/gha/requirements.txt + uses: nick-invision/retry@v2 + with: + timeout_minutes: 1 + max_attempts: 3 + shell: bash + command: pip install -r scripts/gha/requirements.txt - id: get-device-type run: | echo "::set-output name=device_type::$( python scripts/gha/print_matrix_configuration.py -d -k ${{ matrix.android_device }} )" @@ -933,7 +966,11 @@ jobs: with: python-version: ${{ env.pythonVersion }} - name: Install python deps - run: pip install -r scripts/gha/requirements.txt + uses: nick-invision/retry@v2 + with: + timeout_minutes: 1 + max_attempts: 3 + command: pip install -r scripts/gha/requirements.txt - id: get-device-type run: | echo "::set-output name=device_type::$( python scripts/gha/print_matrix_configuration.py -d -k ${{ matrix.ios_device }} )" @@ -1032,7 +1069,11 @@ jobs: with: python-version: ${{ env.pythonVersion }} - name: Install python deps - run: pip install -r scripts/gha/requirements.txt + uses: nick-invision/retry@v2 + with: + timeout_minutes: 1 + max_attempts: 3 + command: pip install -r scripts/gha/requirements.txt - name: Setup Firebase Emulators run: | npm install -g firebase-tools From 5ff7f3baa68d53cb857d4116040cd157f2114139 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Thu, 2 Dec 2021 15:24:21 -0800 Subject: [PATCH 2/2] Add -o option to unzip of NDK. --- build_scripts/android/install_prereqs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_scripts/android/install_prereqs.sh b/build_scripts/android/install_prereqs.sh index ff2744a32..ffc601da2 100755 --- a/build_scripts/android/install_prereqs.sh +++ b/build_scripts/android/install_prereqs.sh @@ -82,7 +82,7 @@ if [[ -z "${NDK_ROOT}" || -z $(grep "Pkg\.Revision = 16\." "${NDK_ROOT}/source.p sleep 300 done set -e - (cd /tmp && unzip -q android-ndk-r16b.zip && rm -f android-ndk-r16b.zip) + (cd /tmp && unzip -oq android-ndk-r16b.zip && rm -f android-ndk-r16b.zip) echo "NDK r16b has been downloaded into /tmp/android-ndk-r16b" fi fi