Skip to content

Commit 7a13328

Browse files
authored
Fix Android Testapp build timeout & some code cleaning (#391)
1 parent 258b481 commit 7a13328

File tree

9 files changed

+137
-266
lines changed

9 files changed

+137
-266
lines changed

.github/workflows/build_android.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,26 @@ jobs:
104104
echo "ANDROID_NDK_HOME=/tmp/android-ndk-r21e" >> $GITHUB_ENV
105105
106106
- name: Install Unity installer (U3D)
107-
shell: bash
108-
run: gem install u3d -v 1.2.3
107+
uses: nick-invision/retry@v2
108+
with:
109+
timeout_minutes: 10
110+
max_attempts: 3
111+
shell: bash
112+
command: gem install u3d -v 1.2.3
109113

110114
- name: Install python deps
111115
shell: bash
112116
run: |
113117
pip install -r scripts/gha/requirements.txt
114118
115119
- name: Install Unity
116-
shell: bash
117-
run: |
118-
python scripts/gha/unity_installer.py --install --platforms ${{ inputs.unity_platform_name }} --version ${{ inputs.unity_version }}
120+
uses: nick-invision/retry@v2
121+
with:
122+
timeout_minutes: 15
123+
max_attempts: 3
124+
shell: bash
125+
command: |
126+
python scripts/gha/unity_installer.py --install --platforms ${{ inputs.unity_platform_name }} --version ${{ inputs.unity_version }}
119127
120128
- name: Setup Unity path
121129
shell: bash
@@ -128,6 +136,7 @@ jobs:
128136
swig -version
129137
130138
- name: Build SDK (Android)
139+
timeout-minutes: 90
131140
shell: bash
132141
run: |
133142
# TODO add handling cmake_extras

.github/workflows/build_ios.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,25 +83,34 @@ jobs:
8383
cd ..
8484
8585
- name: Install Unity installer (U3D)
86-
shell: bash
87-
run: gem install u3d -v 1.2.3
86+
uses: nick-invision/retry@v2
87+
with:
88+
timeout_minutes: 10
89+
max_attempts: 3
90+
shell: bash
91+
command: gem install u3d -v 1.2.3
8892

8993
- name: Install python deps
9094
shell: bash
9195
run: |
9296
pip install -r scripts/gha/requirements.txt
9397
9498
- name: Install Unity
95-
shell: bash
96-
run: |
97-
python scripts/gha/unity_installer.py --install --platforms ${{ inputs.unity_platform_name }} --version ${{ inputs.unity_version }}
99+
uses: nick-invision/retry@v2
100+
with:
101+
timeout_minutes: 15
102+
max_attempts: 3
103+
shell: bash
104+
command: |
105+
python scripts/gha/unity_installer.py --install --platforms ${{ inputs.unity_platform_name }} --version ${{ inputs.unity_version }}
98106
99107
- name: Setup Unity path
100108
shell: bash
101109
run: |
102110
echo "UNITY_ROOT_DIR=$( python scripts/gha/print_matrix_configuration.py -u ${{ inputs.unity_version }} -k unity_path )" >> $GITHUB_ENV
103111
104112
- name: Build SDK (iOS)
113+
timeout-minutes: 90
105114
shell: bash
106115
run: |
107116
# TODO add handling cmake_extras

.github/workflows/build_linux.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,12 @@ jobs:
6969
ruby-version: 3.0.2
7070

7171
- name: Install Unity installer (U3D)
72-
shell: bash
73-
run: gem install u3d -v 1.2.3
72+
uses: nick-invision/retry@v2
73+
with:
74+
timeout_minutes: 10
75+
max_attempts: 3
76+
shell: bash
77+
command: gem install u3d -v 1.2.3
7478

7579
- name: Setup python
7680
uses: actions/setup-python@v2
@@ -95,9 +99,13 @@ jobs:
9599
sudo apt install openssl
96100
97101
- name: Install Unity
98-
shell: bash
99-
run: |
100-
python scripts/gha/unity_installer.py --install --platforms ${{ inputs.unity_platform_name }} --version ${{ inputs.unity_version }}
102+
uses: nick-invision/retry@v2
103+
with:
104+
timeout_minutes: 15
105+
max_attempts: 3
106+
shell: bash
107+
command: |
108+
python scripts/gha/unity_installer.py --install --platforms ${{ inputs.unity_platform_name }} --version ${{ inputs.unity_version }}
101109
102110
- name: Setup Unity path
103111
shell: bash
@@ -108,6 +116,7 @@ jobs:
108116
echo "SWIG_DIR=$(swig -swiglib)" >> $GITHUB_ENV
109117
110118
- name: Build SDK (Linux)
119+
timeout-minutes: 90
111120
shell: bash
112121
run: |
113122
# TODO add handling cmake_extras

.github/workflows/build_macos.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,12 @@ jobs:
6969
ruby-version: 3.0.2
7070

7171
- name: Install Unity installer (U3D)
72-
shell: bash
73-
run: gem install u3d -v 1.2.3
72+
uses: nick-invision/retry@v2
73+
with:
74+
timeout_minutes: 10
75+
max_attempts: 3
76+
shell: bash
77+
command: gem install u3d -v 1.2.3
7478

7579
- name: Setup python
7680
uses: actions/setup-python@v2
@@ -101,9 +105,13 @@ jobs:
101105
echo "OPENSSL_ROOT_DIR=$(brew --prefix openssl --installed)" >> $GITHUB_ENV
102106
103107
- name: Install Unity
104-
shell: bash
105-
run: |
106-
python scripts/gha/unity_installer.py --install --platforms ${{ inputs.unity_platform_name }} --version ${{ inputs.unity_version }}
108+
uses: nick-invision/retry@v2
109+
with:
110+
timeout_minutes: 15
111+
max_attempts: 3
112+
shell: bash
113+
command: |
114+
python scripts/gha/unity_installer.py --install --platforms ${{ inputs.unity_platform_name }} --version ${{ inputs.unity_version }}
107115
108116
- name: Setup Unity path
109117
shell: bash
@@ -114,6 +122,7 @@ jobs:
114122
echo "SWIG_DIR=$(swig -swiglib)" >> $GITHUB_ENV
115123
116124
- name: Build SDK (MacOS)
125+
timeout-minutes: 90
117126
shell: bash
118127
run: |
119128
# TODO add handling cmake_extras

.github/workflows/build_starter.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ name: Firebase Unity SDK build
44
on:
55
schedule:
66
- cron: "0 7 * * *" # 7am UTC = 11pm PST / 12am PDT
7+
8+
pull_request:
9+
types: [ labeled, closed ]
710

811
workflow_dispatch:
912
inputs:
@@ -218,7 +221,6 @@ jobs:
218221
uses: ./.github/workflows/package.yml
219222
if: (needs.check_and_prepare.outputs.should_trigger_package == 'true') && !cancelled() && !failure()
220223
with:
221-
triggered_by_callable: true
222224
release_label: ${{ needs.check_and_prepare.outputs.release_label }}
223225
skipIntegrationTests: ${{ needs.check_and_prepare.outputs.skipIntegrationTests }}
224226
build_run_id: ${{ github.run_id }}

.github/workflows/build_windows.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,12 @@ jobs:
7272
ruby-version: 3.0.2
7373

7474
- name: Install Unity installer (U3D)
75-
shell: bash
76-
run: gem install u3d -v 1.2.3
75+
uses: nick-invision/retry@v2
76+
with:
77+
timeout_minutes: 10
78+
max_attempts: 3
79+
shell: bash
80+
command: gem install u3d -v 1.2.3
7781

7882
- name: Setup python
7983
uses: actions/setup-python@v2
@@ -101,9 +105,13 @@ jobs:
101105
choco install openssl -r
102106
103107
- name: Install Unity
104-
shell: bash
105-
run: |
106-
python scripts/gha/unity_installer.py --install --platforms ${{ inputs.unity_platform_name }} --version ${{ inputs.unity_version }}
108+
uses: nick-invision/retry@v2
109+
with:
110+
timeout_minutes: 15
111+
max_attempts: 3
112+
shell: bash
113+
command: |
114+
python scripts/gha/unity_installer.py --install --platforms ${{ inputs.unity_platform_name }} --version ${{ inputs.unity_version }}
107115
108116
- name: Setup Unity path
109117
shell: bash
@@ -114,6 +122,7 @@ jobs:
114122
echo "SWIG_DIR=$(swig -swiglib)" >> $GITHUB_ENV
115123
116124
- name: Build SDK (Windows)
125+
timeout-minutes: 90
117126
shell: bash
118127
run: |
119128
# TODO add handling cmake_extras

.github/workflows/integration_tests.yml

Lines changed: 44 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99

1010
workflow_dispatch:
1111
inputs:
12+
packaged_sdk_run_id:
13+
description: 'run # of "Firebase Unity SDK build" workflow'
14+
default: '0'
15+
required: true
1216
unity_versions:
1317
description: 'Unity version'
1418
default: '2019'
@@ -29,16 +33,10 @@ on:
2933
description: 'Run mobile tests on real and/or virtual devices? (separated by commas)'
3034
default: 'real,virtual'
3135
required: true
32-
sdk_url:
33-
description: 'Download unity sdk from this URL'
34-
default: 'https://dl.google.com/firebase/sdk/unity/firebase_unity_sdk_8.7.0.zip'
35-
required: true
3636
use_expanded_matrix:
3737
description: 'Use an expanded matrix? Note: above config will be ignored.'
3838
default: '0'
3939
required: true
40-
test_packaged_sdk:
41-
description: 'Optional: Packaging run # to build against? (sdk_url will be ignored.)'
4240
test_pull_request:
4341
description: 'Optional: Pull request # to build and test? (With optional commit hash, separated by a colon. Specify the FULL hash.)'
4442

@@ -215,12 +213,14 @@ jobs:
215213
steps:
216214
- uses: actions/checkout@v2
217215
- name: Install Unity installer (U3D)
218-
timeout-minutes: 10
219-
shell: bash
220-
run: |
221-
gem install u3d -v 1.2.3
222-
u3d available
223-
# u3d available -u ${{ matrix.unity_version }} -p
216+
uses: nick-invision/retry@v2
217+
with:
218+
timeout_minutes: 10
219+
max_attempts: 3
220+
shell: bash
221+
command: |
222+
gem install u3d -v 1.2.3
223+
u3d available
224224
- name: Setup python
225225
uses: actions/setup-python@v2
226226
with:
@@ -231,12 +231,15 @@ jobs:
231231
run: |
232232
pip install -r scripts/gha/requirements.txt
233233
- name: Install Unity
234-
timeout-minutes: 30
235-
shell: bash
236-
run: |
237-
python scripts/gha/unity_installer.py --install \
238-
--platforms ${{ matrix.platform }} \
239-
--version ${{ matrix.unity_version }}
234+
uses: nick-invision/retry@v2
235+
with:
236+
timeout_minutes: 30
237+
max_attempts: 3
238+
shell: bash
239+
command: |
240+
python scripts/gha/unity_installer.py --install \
241+
--platforms ${{ matrix.platform }} \
242+
--version ${{ matrix.unity_version }}
240243
- name: Activate Unity license
241244
timeout-minutes: 10
242245
shell: bash
@@ -254,26 +257,15 @@ jobs:
254257
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
255258
- name: Fetch prebuilt packaged SDK from previous run
256259
uses: dawidd6/action-download-artifact@v2
257-
if: ${{ github.event.inputs.test_packaged_sdk != '' }}
258260
with:
259261
name: 'firebase_unity_sdk.zip'
260-
workflow: 'packaging.yml'
261-
run_id: ${{ github.event.inputs.test_packaged_sdk }}
262-
262+
workflow: 'build_starter.yml'
263+
run_id: ${{ github.event.inputs.packaged_sdk_run_id }}
263264
- name: Build integration tests
265+
timeout-minutes: 180
264266
shell: bash
265267
run: |
266-
if [[ -n "${{ github.event.inputs.test_packaged_sdk }}" ]]; then
267-
unzip -q firebase_unity_sdk.zip -d ~/Downloads/
268-
else
269-
if [[ -z "${{ github.event.inputs.sdk_url }}" ]];then
270-
sdk_url="https://dl.google.com/firebase/sdk/unity/firebase_unity_sdk_8.7.0.zip"
271-
else
272-
sdk_url=${{ github.event.inputs.sdk_url }}
273-
fi
274-
curl ${sdk_url} -o ~/Downloads/firebase_unity_sdk.zip
275-
unzip -q ~/Downloads/firebase_unity_sdk.zip -d ~/Downloads/
276-
fi
268+
unzip -q firebase_unity_sdk.zip -d ~/Downloads/
277269
python scripts/gha/build_testapps.py \
278270
--t ${{ needs.check_and_prepare.outputs.apis }} \
279271
--u $( python scripts/gha/print_matrix_configuration.py -k version -u ${{matrix.unity_version}}) \
@@ -411,12 +403,14 @@ jobs:
411403
steps:
412404
- uses: actions/checkout@v2
413405
- name: Install Unity installer (U3D)
414-
timeout-minutes: 10
415-
shell: bash
416-
run: |
417-
gem install u3d
418-
u3d available
419-
# u3d available -u ${{ matrix.unity_version }} -p
406+
uses: nick-invision/retry@v2
407+
with:
408+
timeout_minutes: 10
409+
max_attempts: 3
410+
shell: bash
411+
command: |
412+
gem install u3d
413+
u3d available
420414
- name: Setup python
421415
uses: actions/setup-python@v2
422416
with:
@@ -427,11 +421,14 @@ jobs:
427421
run: |
428422
pip install -r scripts/gha/requirements.txt
429423
- name: Install Unity
430-
timeout-minutes: 30
431-
shell: bash
432-
run: |
433-
python scripts/gha/unity_installer.py --install \
434-
--version ${{ matrix.unity_version }}
424+
uses: nick-invision/retry@v2
425+
with:
426+
timeout_minutes: 15
427+
max_attempts: 3
428+
shell: bash
429+
command: |
430+
python scripts/gha/unity_installer.py --install \
431+
--version ${{ matrix.unity_version }}
435432
- name: Activate Unity license
436433
timeout-minutes: 10
437434
shell: bash
@@ -449,26 +446,14 @@ jobs:
449446
python scripts/gha/restore_secrets.py --passphrase "${{ secrets.TEST_SECRET }}"
450447
- name: Fetch prebuilt packaged SDK from previous run
451448
uses: dawidd6/action-download-artifact@v2
452-
if: ${{ github.event.inputs.test_packaged_sdk != '' }}
453449
with:
454450
name: 'firebase_unity_sdk.zip'
455-
workflow: 'packaging.yml'
456-
run_id: ${{ github.event.inputs.test_packaged_sdk }}
457-
451+
workflow: 'build_starter.yml'
452+
run_id: ${{ github.event.inputs.packaged_sdk_run_id }}
458453
- name: Run Playmode (in editor mode) integration tests
459454
shell: bash
460455
run: |
461-
if [[ -n "${{ github.event.inputs.test_packaged_sdk }}" ]]; then
462-
unzip -q firebase_unity_sdk.zip -d ~/Downloads/
463-
else
464-
if [[ -z "${{ github.event.inputs.sdk_url }}" ]];then
465-
sdk_url="https://dl.google.com/firebase/sdk/unity/firebase_unity_sdk_8.7.0.zip"
466-
else
467-
sdk_url=${{ github.event.inputs.sdk_url }}
468-
fi
469-
curl ${sdk_url} -o ~/Downloads/firebase_unity_sdk.zip
470-
unzip -q ~/Downloads/firebase_unity_sdk.zip -d ~/Downloads/
471-
fi
456+
unzip -q firebase_unity_sdk.zip -d ~/Downloads/
472457
python scripts/gha/build_testapps.py \
473458
--t ${{ needs.check_and_prepare.outputs.apis }} \
474459
--u $( python scripts/gha/print_matrix_configuration.py -k version -u ${{matrix.unity_version}}) \

0 commit comments

Comments
 (0)