Skip to content

Commit e14163e

Browse files
feat(infra): Add script to set up SPM-based quickstarts (#15295)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 881611e commit e14163e

15 files changed

+1035
-806
lines changed

.github/workflows/abtesting.yml

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -25,70 +25,70 @@ concurrency:
2525
cancel-in-progress: true
2626

2727
jobs:
28-
spm:
29-
uses: ./.github/workflows/common.yml
30-
with:
31-
target: ABTestingUnit
28+
# spm:
29+
# uses: ./.github/workflows/common.yml
30+
# with:
31+
# target: ABTestingUnit
3232

33-
catalyst:
34-
uses: ./.github/workflows/common_catalyst.yml
35-
with:
36-
product: FirebaseABTesting
37-
target: FirebaseABTesting-Unit-unit
33+
# catalyst:
34+
# uses: ./.github/workflows/common_catalyst.yml
35+
# with:
36+
# product: FirebaseABTesting
37+
# target: FirebaseABTesting-Unit-unit
3838

39-
pod_lib_lint:
40-
uses: ./.github/workflows/common_cocoapods.yml
41-
with:
42-
product: FirebaseABTesting
39+
# pod_lib_lint:
40+
# uses: ./.github/workflows/common_cocoapods.yml
41+
# with:
42+
# product: FirebaseABTesting
4343

4444
quickstart:
4545
uses: ./.github/workflows/common_quickstart.yml
4646
with:
4747
product: ABTesting
48-
is_legacy: true
49-
setup_command: scripts/setup_quickstart.sh abtesting
48+
is_legacy: false
49+
setup_command: QUICKSTART_BRANCH=mc/spm scripts/setup_quickstart_spm.sh abtesting
5050
plist_src_path: scripts/gha-encrypted/qs-database.plist.gpg
5151
plist_dst_path: quickstart-ios/database/GoogleService-Info.plist
5252
secrets:
5353
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
5454

55-
quickstart-ftl-cron-only:
56-
# Don't run on private repo.
57-
if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
55+
# quickstart-ftl-cron-only:
56+
# # Don't run on private repo.
57+
# if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
5858

59-
env:
60-
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
61-
runs-on: macos-15
62-
steps:
63-
- uses: actions/checkout@v4
64-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
65-
- uses: actions/setup-python@v5
66-
with:
67-
python-version: '3.11'
68-
- name: Setup quickstart
69-
env:
70-
LEGACY: true
71-
run: scripts/setup_quickstart.sh abtesting
72-
- name: Install Secret GoogleService-Info.plist
73-
run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
74-
quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
75-
- name: Xcode
76-
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
77-
- name: Build swift quickstart
78-
env:
79-
LEGACY: true
80-
run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh ABTesting)
81-
- id: ftl_test
82-
uses: FirebaseExtended/github-actions/[email protected]
83-
with:
84-
credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
85-
testapp_dir: quickstart-ios/build-for-testing
86-
test_type: "xctest"
59+
# env:
60+
# plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
61+
# runs-on: macos-15
62+
# steps:
63+
# - uses: actions/checkout@v4
64+
# - uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
65+
# - uses: actions/setup-python@v5
66+
# with:
67+
# python-version: '3.11'
68+
# - name: Setup quickstart
69+
# env:
70+
# LEGACY: true
71+
# run: scripts/setup_quickstart.sh abtesting
72+
# - name: Install Secret GoogleService-Info.plist
73+
# run: scripts/decrypt_gha_secret.sh scripts/gha-encrypted/qs-abtesting.plist.gpg \
74+
# quickstart-ios/abtesting/GoogleService-Info.plist "$plist_secret"
75+
# - name: Xcode
76+
# run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
77+
# - name: Build swift quickstart
78+
# env:
79+
# LEGACY: true
80+
# run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/test_quickstart_ftl.sh ABTesting)
81+
# - id: ftl_test
82+
# uses: FirebaseExtended/github-actions/[email protected]
83+
# with:
84+
# credentials_json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CREDENTIALS }}
85+
# testapp_dir: quickstart-ios/build-for-testing
86+
# test_type: "xctest"
8787

88-
abtesting-cron-only:
89-
needs: pod_lib_lint
90-
uses: ./.github/workflows/common_cocoapods_cron.yml
91-
with:
92-
product: FirebaseABTesting
93-
platforms: '[ "ios", "tvos", "macos" ]'
94-
flags: '[ "--use-static-frameworks" ]'
88+
# abtesting-cron-only:
89+
# needs: pod_lib_lint
90+
# uses: ./.github/workflows/common_cocoapods_cron.yml
91+
# with:
92+
# product: FirebaseABTesting
93+
# platforms: '[ "ios", "tvos", "macos" ]'
94+
# flags: '[ "--use-static-frameworks" ]'

.github/workflows/auth.yml

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -29,76 +29,76 @@ concurrency:
2929
cancel-in-progress: true
3030

3131
jobs:
32-
spm:
33-
uses: ./.github/workflows/common.yml
34-
with:
35-
target: AuthUnit
36-
buildonly_platforms: macOS
32+
# spm:
33+
# uses: ./.github/workflows/common.yml
34+
# with:
35+
# target: AuthUnit
36+
# buildonly_platforms: macOS
3737

38-
catalyst:
39-
uses: ./.github/workflows/common_catalyst.yml
40-
with:
41-
product: FirebaseAuth
42-
target: FirebaseAuth-Unit-unit
43-
buildonly: true
38+
# catalyst:
39+
# uses: ./.github/workflows/common_catalyst.yml
40+
# with:
41+
# product: FirebaseAuth
42+
# target: FirebaseAuth-Unit-unit
43+
# buildonly: true
4444

45-
pod_lib_lint:
46-
strategy:
47-
matrix:
48-
product: [FirebaseAuthInterop, FirebaseAuth]
49-
uses: ./.github/workflows/common_cocoapods.yml
50-
with:
51-
product: ${{ matrix.product }}
52-
buildonly_platforms: macOS
45+
# pod_lib_lint:
46+
# strategy:
47+
# matrix:
48+
# product: [FirebaseAuthInterop, FirebaseAuth]
49+
# uses: ./.github/workflows/common_cocoapods.yml
50+
# with:
51+
# product: ${{ matrix.product }}
52+
# buildonly_platforms: macOS
5353

54-
integration-tests:
55-
# Don't run on private repo unless it is a PR.
56-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
57-
needs: spm
58-
strategy:
59-
matrix:
60-
scheme: [ObjCApiTests, SwiftApiTests, AuthenticationExampleUITests]
61-
env:
62-
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
63-
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
64-
runs-on: macos-15
65-
steps:
66-
- uses: actions/checkout@v4
67-
- uses: actions/cache/restore@v4
68-
with:
69-
path: .build
70-
key: ${{ needs.spm.outputs.cache_key }}
71-
- name: Install Secrets
72-
run: |
73-
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthCredentials.h.gpg \
74-
FirebaseAuth/Tests/SampleSwift/ObjCApiTests/AuthCredentials.h "$plist_secret"
75-
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/SwiftApplication.plist.gpg \
76-
FirebaseAuth/Tests/SampleSwift/AuthenticationExample/SwiftApplication.plist "$plist_secret"
77-
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/AuthCredentials.h.gpg \
78-
FirebaseAuth/Tests/SampleSwift/AuthCredentials.h "$plist_secret"
79-
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info.plist.gpg \
80-
FirebaseAuth/Tests/SampleSwift/GoogleService-Info.plist "$plist_secret"
81-
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info_multi.plist.gpg \
82-
FirebaseAuth/Tests/SampleSwift/GoogleService-Info_multi.plist "$plist_secret"
83-
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Sample.entitlements.gpg \
84-
FirebaseAuth/Tests/SampleSwift/Sample.entitlements "$plist_secret"
85-
scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Credentials.swift.gpg \
86-
FirebaseAuth/Tests/SampleSwift/SwiftApiTests/Credentials.swift "$plist_secret"
87-
- name: Xcode
88-
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
89-
- uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
90-
with:
91-
timeout_minutes: 15
92-
max_attempts: 3
93-
retry_wait_seconds: 120
94-
command: ([ -z $plist_secret ] || scripts/build.sh Auth iOS ${{ matrix.scheme }})
54+
# integration-tests:
55+
# # Don't run on private repo unless it is a PR.
56+
# if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
57+
# needs: spm
58+
# strategy:
59+
# matrix:
60+
# scheme: [ObjCApiTests, SwiftApiTests, AuthenticationExampleUITests]
61+
# env:
62+
# plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
63+
# FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
64+
# runs-on: macos-15
65+
# steps:
66+
# - uses: actions/checkout@v4
67+
# - uses: actions/cache/restore@v4
68+
# with:
69+
# path: .build
70+
# key: ${{ needs.spm.outputs.cache_key }}
71+
# - name: Install Secrets
72+
# run: |
73+
# scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthCredentials.h.gpg \
74+
# FirebaseAuth/Tests/SampleSwift/ObjCApiTests/AuthCredentials.h "$plist_secret"
75+
# scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/SwiftApplication.plist.gpg \
76+
# FirebaseAuth/Tests/SampleSwift/AuthenticationExample/SwiftApplication.plist "$plist_secret"
77+
# scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/AuthCredentials.h.gpg \
78+
# FirebaseAuth/Tests/SampleSwift/AuthCredentials.h "$plist_secret"
79+
# scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info.plist.gpg \
80+
# FirebaseAuth/Tests/SampleSwift/GoogleService-Info.plist "$plist_secret"
81+
# scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info_multi.plist.gpg \
82+
# FirebaseAuth/Tests/SampleSwift/GoogleService-Info_multi.plist "$plist_secret"
83+
# scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Sample.entitlements.gpg \
84+
# FirebaseAuth/Tests/SampleSwift/Sample.entitlements "$plist_secret"
85+
# scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Credentials.swift.gpg \
86+
# FirebaseAuth/Tests/SampleSwift/SwiftApiTests/Credentials.swift "$plist_secret"
87+
# - name: Xcode
88+
# run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
89+
# - uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
90+
# with:
91+
# timeout_minutes: 15
92+
# max_attempts: 3
93+
# retry_wait_seconds: 120
94+
# command: ([ -z $plist_secret ] || scripts/build.sh Auth iOS ${{ matrix.scheme }})
9595

9696
quickstart:
9797
uses: ./.github/workflows/common_quickstart.yml
9898
with:
9999
product: Authentication
100100
is_legacy: false
101-
setup_command: scripts/setup_quickstart.sh authentication
101+
setup_command: QUICKSTART_BRANCH=mc/spm scripts/setup_quickstart_spm.sh authentication
102102
plist_src_path: scripts/gha-encrypted/qs-authentication.plist.gpg
103103
plist_dst_path: quickstart-ios/authentication/GoogleService-Info.plist
104104
run_tests: false
@@ -133,13 +133,13 @@ jobs:
133133
# testapp_dir: quickstart-ios/build-for-testing
134134
# test_type: "xctest"
135135

136-
auth-cron-only:
137-
needs: pod_lib_lint
138-
uses: ./.github/workflows/common_cocoapods_cron.yml
139-
with:
140-
product: FirebaseAuth
141-
platforms: '[ "ios", "tvos --skip-tests", "macos --skip-tests", "watchos --skip-tests" ]'
142-
flags: '[ "--use-static-frameworks" ]'
143-
setup_command: scripts/configure_test_keychain.sh
144-
secrets:
145-
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
136+
# auth-cron-only:
137+
# needs: pod_lib_lint
138+
# uses: ./.github/workflows/common_cocoapods_cron.yml
139+
# with:
140+
# product: FirebaseAuth
141+
# platforms: '[ "ios", "tvos --skip-tests", "macos --skip-tests", "watchos --skip-tests" ]'
142+
# flags: '[ "--use-static-frameworks" ]'
143+
# setup_command: scripts/configure_test_keychain.sh
144+
# secrets:
145+
# plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}

.github/workflows/common_quickstart.yml

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,6 @@ on:
4444
type: string
4545
required: true
4646

47-
# The type of quickstart to test.
48-
#
49-
# Options: [swift, objc]
50-
quickstart_type:
51-
type: string
52-
required: false
53-
default: objc
54-
5547
# Whether to run tests or just build. Defaults to true.
5648
run_tests:
5749
type: boolean
@@ -77,38 +69,44 @@ jobs:
7769
steps:
7870
- uses: actions/checkout@v4
7971
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
72+
- name: Prereqs
73+
run: gem install xcpretty
8074
- name: Xcode
8175
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
8276
- name: Run setup command.
8377
run: ${{ inputs.setup_command }}
84-
- name: Install Secret GoogleService-Info.plist
85-
run: |
86-
scripts/decrypt_gha_secret.sh \
87-
${{ inputs.plist_src_path }} \
88-
${{ inputs.plist_dst_path }} \
89-
"$plist_secret"
90-
- name: Build ${{ inputs.product }} Quickstart (${{ inputs.quickstart_type }} / ${{ inputs.is_legacy && 'Legacy' || 'Non-Legacy' }})
78+
# - name: Install Secret GoogleService-Info.plist
79+
# run: |
80+
# scripts/decrypt_gha_secret.sh \
81+
# ${{ inputs.plist_src_path }} \
82+
# ${{ inputs.plist_dst_path }} \
83+
# "$plist_secret"
84+
- name: Build ${{ inputs.product }} Quickstart (${{ inputs.is_legacy && 'Legacy' || 'Non-Legacy' }})
9185
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
9286
with:
9387
timeout_minutes: 15
9488
max_attempts: 3
9589
retry_wait_seconds: 120
9690
command: |
97-
scripts/test_quickstart.sh \
98-
${{ inputs.product }} \
99-
${{ inputs.run_tests }} \
100-
${{ inputs.quickstart_type }}
91+
SPM=true DIR=${{ inputs.product }} scripts/test_quickstart.sh ${{ inputs.product }} false
92+
# command: |
93+
# SPM=true DIR=${{ inputs.product }} scripts/test_quickstart.sh ${{ inputs.product }} ${{ inputs.run_tests }}
94+
# scripts/test_quickstart.sh \
95+
# ${{ inputs.product }} \
96+
# ${{ inputs.run_tests }} \
97+
# ${{ inputs.quickstart_type }}
98+
10199
# Failure sequence to upload artifact.
102-
- id: lowercase_product
103-
if: ${{ failure() }}
104-
run: |
105-
lowercase_product=$(echo "${{ inputs.product }}" | tr '[:upper:]' '[:lower:]')
106-
echo "lowercase_product=$lowercase_product" >> $GITHUB_OUTPUT
107-
- name: Remove data before upload.
108-
if: ${{ failure() }}
109-
run: scripts/remove_data.sh ${{ steps.lowercase_product.outputs.lowercase_product }}
110-
- uses: actions/upload-artifact@v4
111-
if: ${{ failure() }}
112-
with:
113-
name: quickstart_artifacts_${{ steps.lowercase_product.outputs.lowercase_product }}
114-
path: quickstart-ios/
100+
# - id: lowercase_product
101+
# if: ${{ failure() }}
102+
# run: |
103+
# lowercase_product=$(echo "${{ inputs.product }}" | tr '[:upper:]' '[:lower:]')
104+
# echo "lowercase_product=$lowercase_product" >> $GITHUB_OUTPUT
105+
# - name: Remove data before upload.
106+
# if: ${{ failure() }}
107+
# run: scripts/remove_data.sh ${{ steps.lowercase_product.outputs.lowercase_product }}
108+
# - uses: actions/upload-artifact@v4
109+
# if: ${{ failure() }}
110+
# with:
111+
# name: quickstart_artifacts_${{ steps.lowercase_product.outputs.lowercase_product }}
112+
# path: quickstart-ios/

0 commit comments

Comments
 (0)