Skip to content

Commit 8e1256f

Browse files
authored
refactor: add .github/workflows/common_quickstart_framework.yml (#15540)
1 parent f59ae0c commit 8e1256f

File tree

2 files changed

+251
-362
lines changed

2 files changed

+251
-362
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: common_quickstart_framework
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
# The product to test be tested (e.g. `ABTesting`).
10+
product:
11+
required: true
12+
type: string
13+
# The Run ID of a successful zip packaging workflow.
14+
zip_run_id:
15+
required: true
16+
type: string
17+
# The name of the artifact from the zip packaging workflow to download.
18+
artifact_name:
19+
required: true
20+
type: string
21+
# A command to execute before testing.
22+
#
23+
# Example: `scripts/setup_quickstart.sh functions`
24+
setup_command:
25+
required: true
26+
type: string
27+
# The path to the encrypted `GoogleService-Info.plist` file.
28+
plist_src_path:
29+
required: true
30+
type: string
31+
# The destination path for the decrypted `GoogleService-Info.plist` file.
32+
plist_dst_path:
33+
required: true
34+
type: string
35+
# The runner to use.
36+
os:
37+
required: false
38+
type: string
39+
default: macos-15
40+
# The version of Xcode to use.
41+
xcode:
42+
required: false
43+
type: string
44+
default: Xcode_16.4
45+
secrets:
46+
# The passphrase for decrypting the GoogleService-Info.plist.
47+
plist_secret:
48+
required: true
49+
50+
jobs:
51+
quickstart_framework:
52+
if: ${{ !cancelled() }}
53+
env:
54+
plist_secret: ${{ secrets.plist_secret }}
55+
SDK: ${{ inputs.product }}
56+
runs-on: ${{ inputs.os }}
57+
steps:
58+
- uses: actions/checkout@v4
59+
- name: Get framework dir
60+
uses: actions/download-artifact@v4.1.7
61+
with:
62+
name: ${{ inputs.artifact_name }}
63+
run-id: ${{ inputs.zip_run_id }}
64+
github-token: ${{ secrets.github_token }}
65+
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
66+
- name: Xcode
67+
run: sudo xcode-select -s /Applications/${{ inputs.xcode }}.app/Contents/Developer
68+
- name: Setup Bundler
69+
run: ./scripts/setup_bundler.sh
70+
- name: Move frameworks
71+
run: |
72+
mkdir -p "${HOME}"/ios_frameworks/
73+
find "${GITHUB_WORKSPACE}" -name "Firebase*latest.zip" -exec unzip -d "${HOME}"/ios_frameworks/ {} +
74+
- name: Setup quickstart
75+
run: ${{ inputs.setup_command }}
76+
- name: Install Secret GoogleService-Info.plist
77+
run: scripts/decrypt_gha_secret.sh ${{ inputs.plist_src_path }} \
78+
${{ inputs.plist_dst_path }} "$plist_secret"
79+
- name: Test Quickstart
80+
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
81+
with:
82+
timeout_minutes: 15
83+
max_attempts: 2
84+
retry_wait_seconds: 120
85+
command: ([ -z $plist_secret ] || scripts/test_quickstart_framework.sh "${SDK}")
86+
# Failure sequence to upload artifact.
87+
- uses: actions/upload-artifact@v4
88+
if: failure()
89+
with:
90+
name: quickstart_artifacts_${{ inputs.product }}_${{ inputs.artifact_name }}
91+
path: |
92+
quickstart-ios/
93+
!quickstart-ios/**/GoogleService-Info.plist

0 commit comments

Comments
 (0)