Skip to content

Commit f6ad97a

Browse files
authored
Timeout & retry "install integration test deps" step (#785)
1 parent a9ad95c commit f6ad97a

File tree

2 files changed

+90
-49
lines changed

2 files changed

+90
-49
lines changed

.github/workflows/integration_tests.yml

Lines changed: 89 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,12 @@ jobs:
145145
with:
146146
python-version: ${{ env.pythonVersion }}
147147
- name: Install python deps
148-
run: pip install -r scripts/gha/requirements.txt
148+
uses: nick-invision/retry@v2
149+
with:
150+
timeout_minutes: 1
151+
max_attempts: 3
152+
shell: bash
153+
command: pip install -r scripts/gha/requirements.txt
149154
- id: matrix_config
150155
run: |
151156
if [[ "${{ steps.set_outputs.outputs.requested_tests }}" == "expanded" ]]; then
@@ -260,30 +265,40 @@ jobs:
260265
# homebrew. This prevents errors arising from the shut down of
261266
# binutils, used by older version of homebrew for hosting packages.
262267
brew update
263-
- name: Install SDK Desktop prerequisites
264-
run: |
265-
python scripts/gha/install_prereqs_desktop.py
266-
- name: Prepare for integration tests
267-
run: |
268-
pip install -r scripts/gha/requirements.txt
269-
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
268+
- name: Install Desktop SDK & integration tests prerequisites
269+
uses: nick-invision/retry@v2
270+
with:
271+
timeout_minutes: 2
272+
max_attempts: 3
273+
command: |
274+
python scripts/gha/install_prereqs_desktop.py
275+
pip install -r scripts/gha/requirements.txt
276+
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
270277
- name: Install OpenSSL (Windows)
271-
if: matrix.ssl_variant == 'openssl' &&
272-
startsWith(matrix.os, 'windows')
273-
run: |
274-
choco install openssl -r
278+
if: matrix.ssl_variant == 'openssl' && startsWith(matrix.os, 'windows')
279+
uses: nick-invision/retry@v2
280+
with:
281+
timeout_minutes: 4
282+
max_attempts: 3
283+
shell: bash
284+
command: choco install openssl -r
275285
- name: Install OpenSSL (macOS)
276-
if: matrix.ssl_variant == 'openssl' &&
277-
startsWith(matrix.os, 'macos')
278-
run: |
279-
brew install openssl
280-
# brew won't overwrite MacOS system default OpenSSL, so force it here.
281-
echo "OPENSSL_ROOT_DIR=/usr/local/opt/[email protected]" >> $GITHUB_ENV
286+
if: matrix.ssl_variant == 'openssl' && startsWith(matrix.os, 'macos')
287+
uses: nick-invision/retry@v2
288+
with:
289+
timeout_minutes: 2
290+
max_attempts: 3
291+
command: |
292+
brew install openssl
293+
# brew won't overwrite MacOS system default OpenSSL, so force it here.
294+
echo "OPENSSL_ROOT_DIR=/usr/local/opt/[email protected]" >> $GITHUB_ENV
282295
- name: Install OpenSSL (Linux)
283-
if: matrix.ssl_variant == 'openssl' &&
284-
startsWith(matrix.os, 'ubuntu')
285-
run: |
286-
sudo apt install openssl
296+
if: matrix.ssl_variant == 'openssl' && startsWith(matrix.os, 'ubuntu')
297+
uses: nick-invision/retry@v2
298+
with:
299+
timeout_minutes: 2
300+
max_attempts: 3
301+
command: sudo apt install openssl
287302
- name: Fetch prebuilt packaged SDK from previous run
288303
uses: dawidd6/action-download-artifact@v2
289304
if: ${{ github.event.inputs.test_packaged_sdk != '' }}
@@ -429,14 +444,16 @@ jobs:
429444
# homebrew. This prevents errors arising from the shut down of
430445
# binutils, used by older version of homebrew for hosting packages.
431446
brew update
432-
- name: Install SDK Android prerequisites
433-
shell: bash
434-
run: |
435-
build_scripts/android/install_prereqs.sh
436-
- name: Prepare for integration tests
437-
run: |
438-
pip install -r scripts/gha/requirements.txt
439-
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
447+
- name: Install Android SDK & integration tests prerequisites
448+
uses: nick-invision/retry@v2
449+
with:
450+
timeout_minutes: 10
451+
max_attempts: 3
452+
shell: bash
453+
command: |
454+
build_scripts/android/install_prereqs.sh
455+
pip install -r scripts/gha/requirements.txt
456+
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
440457
- name: Fetch prebuilt packaged SDK from previous run
441458
uses: dawidd6/action-download-artifact@v2
442459
if: ${{ github.event.inputs.test_packaged_sdk != '' }}
@@ -544,12 +561,15 @@ jobs:
544561
# homebrew. This prevents errors arising from the shut down of
545562
# binutils, used by older version of homebrew for hosting packages.
546563
brew update
547-
- name: Install SDK iOS prerequisites
548-
run: build_scripts/ios/install_prereqs.sh
549-
- name: Prepare for integration tests
550-
run: |
551-
pip install -r scripts/gha/requirements.txt
552-
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
564+
- name: Install iOS SDK & integration tests prerequisites
565+
uses: nick-invision/retry@v2
566+
with:
567+
timeout_minutes: 2
568+
max_attempts: 3
569+
command: |
570+
build_scripts/ios/install_prereqs.sh
571+
pip install -r scripts/gha/requirements.txt
572+
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
553573
- name: Fetch prebuilt packaged SDK from previous run
554574
uses: dawidd6/action-download-artifact@v2
555575
if: ${{ github.event.inputs.test_packaged_sdk != '' }}
@@ -652,12 +672,15 @@ jobs:
652672
# homebrew. This prevents errors arising from the shut down of
653673
# binutils, used by older version of homebrew for hosting packages.
654674
brew update
655-
- name: Install SDK tvOS prerequisites
656-
run: build_scripts/tvos/install_prereqs.sh
657-
- name: Prepare for integration tests
658-
run: |
659-
pip install -r scripts/gha/requirements.txt
660-
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
675+
- name: Install tvOS SDK & integration tests prerequisites
676+
uses: nick-invision/retry@v2
677+
with:
678+
timeout_minutes: 2
679+
max_attempts: 3
680+
command: |
681+
build_scripts/tvos/install_prereqs.sh
682+
pip install -r scripts/gha/requirements.txt
683+
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
661684
- name: Fetch prebuilt packaged SDK from previous run
662685
uses: dawidd6/action-download-artifact@v2
663686
if: ${{ github.event.inputs.test_packaged_sdk != '' }}
@@ -763,9 +786,14 @@ jobs:
763786
run: |
764787
npm install -g firebase-tools
765788
- name: Setup integration test deps
766-
run: |
767-
pip install -r scripts/gha/requirements.txt
768-
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}" --artifact testapps
789+
uses: nick-invision/retry@v2
790+
with:
791+
timeout_minutes: 2
792+
max_attempts: 3
793+
shell: bash
794+
command: |
795+
pip install -r scripts/gha/requirements.txt
796+
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}" --artifact testapps
769797
- name: Run Desktop integration tests
770798
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 }}"'
771799
env:
@@ -835,7 +863,12 @@ jobs:
835863
with:
836864
python-version: ${{ env.pythonVersion }}
837865
- name: Install python deps
838-
run: pip install -r scripts/gha/requirements.txt
866+
uses: nick-invision/retry@v2
867+
with:
868+
timeout_minutes: 1
869+
max_attempts: 3
870+
shell: bash
871+
command: pip install -r scripts/gha/requirements.txt
839872
- id: get-device-type
840873
run: |
841874
echo "::set-output name=device_type::$( python scripts/gha/print_matrix_configuration.py -d -k ${{ matrix.android_device }} )"
@@ -933,7 +966,11 @@ jobs:
933966
with:
934967
python-version: ${{ env.pythonVersion }}
935968
- name: Install python deps
936-
run: pip install -r scripts/gha/requirements.txt
969+
uses: nick-invision/retry@v2
970+
with:
971+
timeout_minutes: 1
972+
max_attempts: 3
973+
command: pip install -r scripts/gha/requirements.txt
937974
- id: get-device-type
938975
run: |
939976
echo "::set-output name=device_type::$( python scripts/gha/print_matrix_configuration.py -d -k ${{ matrix.ios_device }} )"
@@ -1032,7 +1069,11 @@ jobs:
10321069
with:
10331070
python-version: ${{ env.pythonVersion }}
10341071
- name: Install python deps
1035-
run: pip install -r scripts/gha/requirements.txt
1072+
uses: nick-invision/retry@v2
1073+
with:
1074+
timeout_minutes: 1
1075+
max_attempts: 3
1076+
command: pip install -r scripts/gha/requirements.txt
10361077
- name: Setup Firebase Emulators
10371078
run: |
10381079
npm install -g firebase-tools

build_scripts/android/install_prereqs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ if [[ -z "${NDK_ROOT}" || -z $(grep "Pkg\.Revision = 16\." "${NDK_ROOT}/source.p
8282
sleep 300
8383
done
8484
set -e
85-
(cd /tmp && unzip -q android-ndk-r16b.zip && rm -f android-ndk-r16b.zip)
85+
(cd /tmp && unzip -oq android-ndk-r16b.zip && rm -f android-ndk-r16b.zip)
8686
echo "NDK r16b has been downloaded into /tmp/android-ndk-r16b"
8787
fi
8888
fi

0 commit comments

Comments
 (0)