Skip to content

Commit 9e15887

Browse files
committed
Merge remote-tracking branch 'upstream/main' into compnerd/swift
2 parents 2f70657 + 8cf0cec commit 9e15887

File tree

299 files changed

+16461
-4238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

299 files changed

+16461
-4238
lines changed

.github/workflows/build-report.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Generate Test Report Table
33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: "0 15 * * *" # 3pm UTC = 7am PST / 8am PDT, 6 hours after testapps run
6+
- cron: "0 21 * * *" # 9pm UTC = 1pm PST / 2pm PDT, 12 hours after testapps run
77

88
env:
99
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/checks.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Setup python
2626
uses: actions/setup-python@v4
2727
with:
28-
python-version: 3.7
28+
python-version: 3.8
2929
- name: Install prerequisites
3030
run: python scripts/gha/install_prereqs_desktop.py
3131
- name: log clang format version
@@ -57,7 +57,7 @@ jobs:
5757
- name: Setup python
5858
uses: actions/setup-python@v4
5959
with:
60-
python-version: 3.7
60+
python-version: 3.8
6161
- name: Install prerequisites
6262
run: |
6363
python scripts/gha/install_prereqs_desktop.py
@@ -111,16 +111,19 @@ jobs:
111111
- name: Check whether release notes have been updated
112112
# Skip this if the PR has the skipReleaseNotes label or if it's a merge to other than main.
113113
if: ${{!contains(github.event.pull_request.labels.*.name, env.skipReleaseNotesLabel) && (github.event.pull_request.base.ref == 'main')}}
114+
env:
115+
HEAD_REF: ${{github.event.pull_request.head.ref}}
116+
BASE_REF: ${{github.event.pull_request.base.ref}}
114117
run: |
115118
set -e
116119
# Filename to check.
117120
README_FILE=release_build_files/readme.md
118121
# Determine the github merge base - same logic as integration_tests.yml
119122
# "git merge-base main branch_name" will give the common ancestor of both branches.
120-
MERGE_BASE=$(git merge-base origin/${{github.event.pull_request.head.ref}} origin/${{github.event.pull_request.base.ref}} || true)
123+
MERGE_BASE=$(git merge-base "origin/${HEAD_REF}" "origin/${BASE_REF}" || true)
121124
# If MERGE_BASE can't be determined, ignore this check, something odd is going on.
122125
if [[ -n "${MERGE_BASE}" ]]; then
123-
DIFF_RESULT=$(git diff --name-only "origin/${{github.event.pull_request.head.ref}}..${MERGE_BASE}" -- "${README_FILE}")
126+
DIFF_RESULT=$(git diff --name-only "origin/${HEAD_REF}..${MERGE_BASE}" -- "${README_FILE}")
124127
if [[ "${DIFF_RESULT}" != "${README_FILE}" ]]; then
125128
echo "::error ::Please update release notes (${README_FILE}) or add '${{env.skipReleaseNotesLabel}}' label."
126129
exit 1

.github/workflows/checks_secure.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
if: steps.check.outputs.has-permission != 1 || github.event.pull_request.head.repo.full_name != github.repository
3232
uses: actions/setup-python@v4
3333
with:
34-
python-version: 3.7
34+
python-version: 3.8
3535
- name: Install prerequisites
3636
if: steps.check.outputs.has-permission != 1 || github.event.pull_request.head.repo.full_name != github.repository
3737
run: pip install -r scripts/gha/python_requirements.txt

.github/workflows/cpp-packaging.yml

+36-5
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
- name: Setup python
9898
uses: actions/setup-python@v4
9999
with:
100-
python-version: 3.7
100+
python-version: 3.8
101101

102102
- name: Fetch and build binutils
103103
run: |
@@ -207,7 +207,7 @@ jobs:
207207
- name: Setup python
208208
uses: actions/setup-python@v4
209209
with:
210-
python-version: 3.7
210+
python-version: 3.8
211211

212212
- name: install prerequisites
213213
run: sdk-src/build_scripts/ios/install_prereqs.sh
@@ -310,7 +310,7 @@ jobs:
310310
architecture: ["x64", "x86", "arm64"]
311311
msvc_runtime: ["static", "dynamic"]
312312
linux_abi: ["legacy", "c++11"]
313-
python_version: [3.7]
313+
python_version: [3.8]
314314
include:
315315
- os: windows-latest
316316
vcpkg_triplet_suffix: "windows-static"
@@ -518,7 +518,7 @@ jobs:
518518
- name: Setup python
519519
uses: actions/setup-python@v4
520520
with:
521-
python-version: 3.7
521+
python-version: 3.8
522522

523523
- name: Install prerequisites
524524
run: |
@@ -837,7 +837,7 @@ jobs:
837837
- name: Setup python
838838
uses: actions/setup-python@v4
839839
with:
840-
python-version: '3.7'
840+
python-version: '3.8'
841841
- name: Use expanded matrix
842842
if: github.event_name == 'schedule' || github.event.inputs.use_expanded_matrix == '1'
843843
run: |
@@ -893,3 +893,34 @@ jobs:
893893
-s 10 \
894894
-A ${verbose_flag}
895895
fi
896+
897+
898+
attempt_retry:
899+
name: "attempt-retry"
900+
needs: [trigger_integration_tests]
901+
runs-on: ubuntu-20.04
902+
if: ${{ failure() && !cancelled() && github.event_name == 'schedule' }}
903+
steps:
904+
- name: Checkout repo
905+
uses: actions/checkout@v3
906+
- name: Setup python
907+
uses: actions/setup-python@v4
908+
with:
909+
python-version: 3.8
910+
- name: Install python deps
911+
run: pip install -r scripts/gha/python_requirements.txt
912+
# The default token can't run workflows, so get an alternate token.
913+
- name: Generate token for GitHub API
914+
uses: tibdex/github-app-token@v1
915+
id: generate-token
916+
with:
917+
app_id: ${{ secrets.WORKFLOW_TRIGGER_APP_ID }}
918+
private_key: ${{ secrets.WORKFLOW_TRIGGER_APP_PRIVATE_KEY }}
919+
- name: Retry failed tests
920+
run: |
921+
echo "::warning ::Attempting to retry failed jobs"
922+
python scripts/gha/trigger_workflow.py -t ${{ steps.generate-token.outputs.token }} \
923+
-w retry-test-failures.yml \
924+
-p run_id ${{ github.run_id }} \
925+
-s 10 \
926+
-A

.github/workflows/desktop.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,10 @@ jobs:
343343
if [[ "${{ job.status }}" != "success" ]]; then
344344
exit 1
345345
fi
346-
- name: Set up Node (16)
346+
- name: Set up Node (18)
347347
uses: actions/setup-node@v3
348348
with:
349-
node-version: 16.x
349+
node-version: 18.x
350350
- name: Setup Firestore Emulator
351351
uses: nick-invision/retry@v2
352352
with:

.github/workflows/integration_tests.yml

+77-21
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ env:
4646
triggerLabelPrefix: "tests-requested: "
4747
triggerLabelFull: "tests-requested: full"
4848
triggerLabelQuick: "tests-requested: quick"
49-
pythonVersion: '3.7'
49+
pythonVersion: '3.8'
5050
xcodeVersion: '14.1'
5151
artifactRetentionDays: 2
5252
GITHUB_TOKEN: ${{ github.token }}
@@ -164,6 +164,9 @@ jobs:
164164
shell: bash
165165
command: pip install -r scripts/gha/python_requirements.txt
166166
- id: matrix_config
167+
env:
168+
HEAD_REF: ${{github.event.pull_request.head.ref}}
169+
BASE_REF: ${{github.event.pull_request.base.ref}}
167170
run: |
168171
if [[ "${{ steps.set_outputs.outputs.requested_tests }}" == "expanded" ]]; then
169172
TEST_MATRIX_PARAM=-e=1
@@ -174,12 +177,12 @@ jobs:
174177
elif [[ "${{ steps.set_outputs.outputs.requested_tests }}" == "auto" ]]; then
175178
# auto-diff only apply when running in a PR.
176179
# diff against the PR's base. "git merge-base main branch_name" will give the common ancestor of both branches.
177-
MERGE_BASE=$(git merge-base origin/${{github.event.pull_request.head.ref}} origin/${{github.event.pull_request.base.ref}} || true)
180+
MERGE_BASE=$(git merge-base "origin/${HEAD_REF}" "origin/${BASE_REF}" || true)
178181
# If origin/<branch> is no longer valid, then just run all tests.
179182
if [[ -n "${MERGE_BASE}" ]]; then
180-
echo "::warning ::Auto-diff origin/${{github.event.pull_request.head.ref}}..${MERGE_BASE}"
181-
git diff --name-only origin/${{github.event.pull_request.head.ref}}..${MERGE_BASE}
182-
TEST_MATRIX_PARAM="--auto_diff origin/${{github.event.pull_request.head.ref}}..${MERGE_BASE}"
183+
echo "::warning ::Auto-diff origin/${HEAD_REF}..${MERGE_BASE}"
184+
git diff --name-only "origin/${HEAD_REF}..${MERGE_BASE}"
185+
TEST_MATRIX_PARAM="--auto_diff origin/${HEAD_REF}..${MERGE_BASE}"
183186
fi
184187
fi
185188
@@ -188,12 +191,13 @@ jobs:
188191
if [[ "${{ github.event.schedule }}" == "0 9 * * *" ]]; then
189192
# at 1am PST/2am PDT. Running integration tests and generate test report for all testapps except firestore
190193
apis="analytics,app_check,auth,database,dynamic_links,functions,gma,installations,messaging,remote_config,storage"
194+
echo "::warning ::Running main nightly tests"
191195
elif [[ "${{ github.event.schedule }}" == "0 10 * * *" || "${{ github.event.schedule }}" == "0 11 * * *" ]]; then
192196
# at 2am PST/3am PDT and 3am PST/4am PDT. Running integration tests for firestore and generate test report.
193197
echo "::warning ::Running Firestore nightly tests"
194198
apis="firestore"
195199
else
196-
echo "::warning ::Running main nightly tests"
200+
echo "::warning ::Running pull request tests"
197201
apis=$( python scripts/gha/print_matrix_configuration.py -c -w integration_tests -k apis -o "${{github.event.inputs.apis}}" ${TEST_MATRIX_PARAM} )
198202
fi
199203
if [[ "${{ github.event.schedule }}" == "0 11 * * *" ]]; then
@@ -762,17 +766,22 @@ jobs:
762766
timeout_minutes: 15
763767
max_attempts: 3
764768
command: scripts/gha/install_test_workflow_prereqs.sh -p Desktop -t true -a '${{ matrix.arch }}' -s '${{ matrix.ssl_variant }}'
765-
- name: Set up Node (16)
769+
- name: Set up Node (18)
766770
uses: actions/setup-node@v3
767771
with:
768-
node-version: 16.x
772+
node-version: 18.x
769773
- name: Setup Firestore Emulator
770774
uses: nick-invision/retry@v2
771775
with:
772776
shell: bash
773777
timeout_minutes: 5
774778
max_attempts: 3
775-
command: npm install -g firebase-tools
779+
command: npm install firebase-tools
780+
- name: Add firebase-tools to PATH
781+
shell: bash
782+
run: |
783+
echo "$(npm root)" >> $GITHUB_PATH
784+
echo "$(npm root)/.bin" >> $GITHUB_PATH
776785
- name: Setup java
777786
uses: actions/setup-java@v3
778787
with:
@@ -983,7 +992,7 @@ jobs:
983992
test_android:
984993
name: test-android-${{ matrix.build_os }}-${{ matrix.android_device }}-${{ matrix.test_type }}
985994
needs: [check_and_prepare, build_android]
986-
runs-on: macos-12
995+
runs-on: ubuntu-20.04
987996
if: contains(needs.check_and_prepare.outputs.matrix_platform, 'Android') && needs.check_and_prepare.outputs.apis != '' && !cancelled()
988997
strategy:
989998
fail-fast: false
@@ -1020,7 +1029,7 @@ jobs:
10201029
id: device-info
10211030
run: |
10221031
echo "device_type=$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.android_device }} -get_device_type)" >> $GITHUB_OUTPUT
1023-
echo "device=$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.android_device }} -get_ftl_device)" >> $GITHUB_OUTPUT
1032+
echo "device=$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.android_device }} -get_ftl_device_list)" >> $GITHUB_OUTPUT
10241033
- name: Setup java 8 for test_simulator.py
10251034
uses: actions/setup-java@v3
10261035
with:
@@ -1037,15 +1046,17 @@ jobs:
10371046
--ci
10381047
- id: ftl_test
10391048
if: steps.device-info.outputs.device_type == 'ftl'
1040-
uses: FirebaseExtended/github-actions/firebase-test-lab@v1.2
1041-
timeout-minutes: 90
1049+
uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
1050+
timeout-minutes: 120
10421051
with:
10431052
credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
10441053
testapp_dir: testapps
10451054
test_type: "game-loop"
1046-
test_devices: ${{ steps.device-info.outputs.device }}
1055+
test_devices: '${{ steps.device-info.outputs.device }}'
1056+
test_device_selection: random
10471057
max_attempts: 3
10481058
validator: ${GITHUB_WORKSPACE}/scripts/gha/integration_testing/ftl_gha_validator.py
1059+
additional_flags: '--client-details matrixLabel=android-${{ github.run_id }}-${{ matrix.build_os }}-${{ matrix.android_device }}'
10491060
- name: Read FTL Test Result
10501061
if: ${{ steps.device-info.outputs.device_type == 'ftl' && !cancelled() }}
10511062
shell: bash
@@ -1147,11 +1158,11 @@ jobs:
11471158
id: device-info
11481159
run: |
11491160
echo "device_type=$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.ios_device }} -get_device_type)" >> $GITHUB_OUTPUT
1150-
echo "device=$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.ios_device }} -get_ftl_device)" >> $GITHUB_OUTPUT
1151-
- name: Set up Node (16)
1161+
echo "device=$( python scripts/gha/print_matrix_configuration.py -k ${{ matrix.ios_device }} -get_ftl_device_list)" >> $GITHUB_OUTPUT
1162+
- name: Set up Node (18)
11521163
uses: actions/setup-node@v3
11531164
with:
1154-
node-version: 16.x
1165+
node-version: 18.x
11551166
- name: Setup java for Firestore emulator
11561167
uses: actions/setup-java@v3
11571168
with:
@@ -1164,7 +1175,13 @@ jobs:
11641175
shell: bash
11651176
timeout_minutes: 5
11661177
max_attempts: 3
1167-
command: npm install -g firebase-tools
1178+
command: npm install firebase-tools
1179+
- name: Add firebase-tools to PATH
1180+
if: contains(needs.check_and_prepare.outputs.apis, 'firestore')
1181+
shell: bash
1182+
run: |
1183+
echo "$(npm root)" >> $GITHUB_PATH
1184+
echo "$(npm root)/.bin" >> $GITHUB_PATH
11681185
- name: Start Firestore Emulator
11691186
if: steps.device-info.outputs.device_type == 'virtual' && contains(needs.check_and_prepare.outputs.apis, 'firestore')
11701187
run: |
@@ -1180,15 +1197,17 @@ jobs:
11801197
--ci
11811198
- id: ftl_test
11821199
if: steps.device-info.outputs.device_type == 'ftl'
1183-
uses: FirebaseExtended/github-actions/firebase-test-lab@v1.2
1200+
uses: FirebaseExtended/github-actions/firebase-test-lab@v1.4
11841201
timeout-minutes: 90
11851202
with:
11861203
credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
11871204
testapp_dir: testapps
11881205
test_type: "game-loop"
1189-
test_devices: ${{ steps.device-info.outputs.device }}
1206+
test_devices: '${{ steps.device-info.outputs.device }}'
1207+
test_device_selection: random
11901208
max_attempts: 3
11911209
validator: ${GITHUB_WORKSPACE}/scripts/gha/integration_testing/ftl_gha_validator.py
1210+
additional_flags: '--client-details matrixLabel=ios-${{ github.run_id }}-${{ matrix.build_os }}-${{ matrix.ios_device }}'
11921211
- name: Read FTL Test Result
11931212
if: ${{ steps.device-info.outputs.device_type == 'ftl' && !cancelled() }}
11941213
shell: bash
@@ -1283,7 +1302,13 @@ jobs:
12831302
shell: bash
12841303
timeout_minutes: 5
12851304
max_attempts: 3
1286-
command: npm install -g firebase-tools
1305+
command: npm install firebase-tools
1306+
- name: Add firebase-tools to PATH
1307+
if: contains(needs.check_and_prepare.outputs.apis, 'firestore')
1308+
shell: bash
1309+
run: |
1310+
echo "$(npm root)" >> $GITHUB_PATH
1311+
echo "$(npm root)/.bin" >> $GITHUB_PATH
12871312
- name: Start Firestore Emulator
12881313
if: contains(needs.check_and_prepare.outputs.apis, 'firestore')
12891314
run: |
@@ -1408,3 +1433,34 @@ jobs:
14081433
${additional_flags[*]}
14091434
- name: Summarize results into GitHub log
14101435
run: python scripts/gha/summarize_test_results.py --dir test_results --github_log
1436+
1437+
attempt_retry:
1438+
name: "attempt-retry"
1439+
needs: [check_and_prepare, summarize_results]
1440+
runs-on: ubuntu-20.04
1441+
if: ${{ failure() && needs.check_and_prepare.outputs.trigger == 'scheduled_trigger' }}
1442+
steps:
1443+
- uses: actions/checkout@v3
1444+
with:
1445+
ref: ${{needs.check_and_prepare.outputs.github_ref}}
1446+
- name: Setup python
1447+
uses: actions/setup-python@v4
1448+
with:
1449+
python-version: ${{ env.pythonVersion }}
1450+
- name: Install python deps
1451+
run: pip install -r scripts/gha/python_requirements.txt
1452+
# The default token can't run workflows, so get an alternate token.
1453+
- name: Generate token for GitHub API
1454+
uses: tibdex/github-app-token@v1
1455+
id: generate-token
1456+
with:
1457+
app_id: ${{ secrets.WORKFLOW_TRIGGER_APP_ID }}
1458+
private_key: ${{ secrets.WORKFLOW_TRIGGER_APP_PRIVATE_KEY }}
1459+
- name: Retry failed tests
1460+
run: |
1461+
echo "::warning ::Attempting to retry failed tests"
1462+
python scripts/gha/trigger_workflow.py -t ${{ steps.generate-token.outputs.token }} \
1463+
-w retry-test-failures.yml \
1464+
-p run_id ${{ github.run_id }} \
1465+
-s 10 \
1466+
-A

.github/workflows/ios.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
- name: Setup python
6363
uses: actions/setup-python@v4
6464
with:
65-
python-version: 3.7
65+
python-version: 3.8
6666
architecture: "x64"
6767

6868
- name: Install prerequisites

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Setup python
2626
uses: actions/setup-python@v4
2727
with:
28-
python-version: 3.7
28+
python-version: 3.8
2929
- name: Install prerequisites
3030
run: |
3131
cd firebase

0 commit comments

Comments
 (0)