Skip to content

Commit 0aa20f4

Browse files
authored
[Infra] Add re-usable workflow for catalyst jobs (#14762)
1 parent 48af4cb commit 0aa20f4

16 files changed

+147
-281
lines changed

.github/workflows/abtesting.yml

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ jobs:
2222
with:
2323
target: ABTestingUnit
2424

25+
catalyst:
26+
uses: ./.github/workflows/common_catalyst.yml
27+
with:
28+
product: FirebaseABTesting
29+
target: FirebaseABTesting-Unit-unit
30+
2531
pod-lib-lint:
2632
# Don't run on private repo unless it is a PR.
2733
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
@@ -60,29 +66,6 @@ jobs:
6066
retry_wait_seconds: 120
6167
command: scripts/pod_lib_lint.rb FirebaseABTesting.podspec --platforms=${{ matrix.target }}
6268

63-
catalyst:
64-
# Don't run on private repo unless it is a PR.
65-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
66-
67-
runs-on: macos-15
68-
steps:
69-
- uses: actions/checkout@v4
70-
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
71-
with:
72-
cache_key: catalyst${{ matrix.os }}
73-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
74-
- name: Setup Bundler
75-
run: scripts/setup_bundler.sh
76-
- name: Xcode
77-
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
78-
- uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
79-
with:
80-
timeout_minutes: 120
81-
max_attempts: 3
82-
retry_on: error
83-
retry_wait_seconds: 120
84-
command: scripts/test_catalyst.sh FirebaseABTesting test FirebaseABTesting-Unit-unit
85-
8669
quickstart:
8770
# Don't run on private repo unless it is a PR.
8871
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

.github/workflows/appdistribution.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ jobs:
2222
target: AppDistributionUnit
2323
platforms: iOS
2424

25+
catalyst:
26+
uses: ./.github/workflows/common_catalyst.yml
27+
with:
28+
product: FirebaseAppDistribution
29+
target: FirebaseAppDistribution-Unit-unit
30+
2531
pod-lib-lint:
2632
# Don't run on private repo unless it is a PR.
2733
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
@@ -46,24 +52,6 @@ jobs:
4652
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAppDistribution.podspec \
4753
--platforms=ios
4854
49-
catalyst:
50-
# Don't run on private repo unless it is a PR.
51-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
52-
53-
runs-on: macos-15
54-
steps:
55-
- uses: actions/checkout@v4
56-
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
57-
with:
58-
cache_key: catalyst${{ matrix.os }}
59-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
60-
- name: Setup Bundler
61-
run: scripts/setup_bundler.sh
62-
- name: Xcode
63-
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
64-
- name: Setup project and Build for Catalyst
65-
run: scripts/test_catalyst.sh FirebaseAppDistribution test FirebaseAppDistribution-Unit-unit
66-
6755
appdistribution-cron-only:
6856
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
6957

.github/workflows/auth.yml

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ jobs:
2727
target: AuthUnit
2828
buildonly_platforms: macOS
2929

30+
catalyst:
31+
uses: ./.github/workflows/common_catalyst.yml
32+
with:
33+
product: FirebaseAuth
34+
target: FirebaseAuth-Unit-unit
35+
buildonly: true
36+
3037
pod-lib-lint:
3138
# Don't run on private repo unless it is a PR.
3239
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
@@ -123,28 +130,6 @@ jobs:
123130
retry_wait_seconds: 120
124131
command: ([ -z $plist_secret ] || scripts/build.sh Auth iOS ${{ matrix.scheme }})
125132

126-
catalyst:
127-
# Don't run on private repo unless it is a PR.
128-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
129-
runs-on: macos-15
130-
steps:
131-
- uses: actions/checkout@v4
132-
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
133-
with:
134-
cache_key: catalyst${{ matrix.os }}
135-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
136-
- name: Setup Bundler
137-
run: scripts/setup_bundler.sh
138-
- name: Xcode
139-
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
140-
- uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
141-
with:
142-
timeout_minutes: 120
143-
max_attempts: 3
144-
retry_on: error
145-
retry_wait_seconds: 120
146-
command: scripts/test_catalyst.sh FirebaseAuth build FirebaseAuth-Unit-unit
147-
148133
quickstart:
149134
# Don't run on private repo unless it is a PR.
150135
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

.github/workflows/common_catalyst.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: common_catalyst
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
# The product to test be tested (e.g. `FirebaseABTesting`).
10+
product:
11+
type: string
12+
required: true
13+
14+
# The target scheme to be tested (e.g. `FirebaseABTesting-Unit-unit`.
15+
target:
16+
type: string
17+
required: true
18+
19+
# Whether to build-only. Defaults to false.
20+
buildonly:
21+
type: boolean
22+
required: false
23+
default: false
24+
25+
jobs:
26+
# TODO: Can this be built via SPM?
27+
catalyst:
28+
# Run on the main repo's scheduled jobs or pull requests and manual workflow invocations.
29+
if: (github.repository == 'firebase/firebase-ios-sdk' && github.event_name == 'schedule') || contains(fromJSON('["pull_request", "workflow_dispatch"]'), github.event_name)
30+
runs-on: macos-15
31+
steps:
32+
- uses: actions/checkout@v4
33+
# TODO: Remove in favor of ccache.
34+
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
35+
with:
36+
cache_key: catalyst${{ matrix.os }}
37+
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
38+
- name: Setup Bundler
39+
run: scripts/setup_bundler.sh
40+
- name: Xcode
41+
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
42+
- uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
43+
with:
44+
timeout_minutes: 120
45+
max_attempts: 3
46+
retry_on: error
47+
retry_wait_seconds: 120
48+
command: |
49+
scripts/test_catalyst.sh \
50+
${{ inputs.product }} \
51+
${{ inputs.buildonly == true && 'build' || 'test' }} \
52+
${{ inputs.target }}

.github/workflows/core.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ jobs:
2121
with:
2222
target: CoreUnit
2323

24+
catalyst:
25+
uses: ./.github/workflows/common_catalyst.yml
26+
with:
27+
product: FirebaseCore
28+
target: FirebaseCore-Unit-unit
29+
2430
pod-lib-lint:
2531
# Don't run on private repo unless it is a PR.
2632
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
@@ -72,24 +78,6 @@ jobs:
7278
path: .build
7379
key: ${{ steps.generate_cache_key.outputs.cache_key }}
7480

75-
catalyst:
76-
# Don't run on private repo unless it is a PR.
77-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
78-
79-
runs-on: macos-15
80-
steps:
81-
- uses: actions/checkout@v4
82-
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
83-
with:
84-
cache_key: ${{ matrix.os }}
85-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
86-
- name: Setup Bundler
87-
run: scripts/setup_bundler.sh
88-
- name: Xcode
89-
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
90-
- name: Setup project and Build Catalyst
91-
run: scripts/test_catalyst.sh FirebaseCore test FirebaseCore-Unit-unit
92-
9381
core-cron-only:
9482
# Don't run on private repo.
9583
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'

.github/workflows/core_internal.yml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ jobs:
1818
with:
1919
target: FirebaseCoreInternalTests
2020

21+
catalyst:
22+
strategy:
23+
matrix:
24+
target: [FirebaseCoreInternal-Unit-Unit, FirebaseCoreInternal-Unit-Integration]
25+
uses: ./.github/workflows/common_catalyst.yml
26+
with:
27+
product: FirebaseCoreInternal
28+
target: ${{ matrix.target }}
29+
2130
pod-lib-lint:
2231
# Don't run on private repo unless it is a PR.
2332
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
@@ -47,25 +56,6 @@ jobs:
4756
- name: Build and test
4857
run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCoreInternal.podspec --platforms=${{ matrix.target }}
4958

50-
catalyst:
51-
# Don't run on private repo unless it is a PR.
52-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
53-
runs-on: macos-15
54-
steps:
55-
- uses: actions/checkout@v4
56-
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
57-
with:
58-
cache_key: catalyst${{ matrix.os }}
59-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
60-
- name: Setup Bundler
61-
run: scripts/setup_bundler.sh
62-
- name: Xcode
63-
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
64-
- name: Setup Catalyst project and run unit tests
65-
run: scripts/test_catalyst.sh FirebaseCoreInternal test FirebaseCoreInternal-Unit-Unit
66-
- name: Setup Catalyst project and run integration tests
67-
run: scripts/test_catalyst.sh FirebaseCoreInternal test FirebaseCoreInternal-Unit-Integration
68-
6959
core-internal-cron-only:
7060
# Don't run on private repo.
7161
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'

.github/workflows/crashlytics.yml

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ jobs:
2323
with:
2424
target: FirebaseCrashlyticsUnit
2525

26+
catalyst:
27+
uses: ./.github/workflows/common_catalyst.yml
28+
with:
29+
product: FirebaseCrashlytics
30+
target: FirebaseCrashlytics-Unit-unit
31+
2632
pod-lib-lint:
2733
# Don't run on private repo unless it is a PR.
2834
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
@@ -57,29 +63,6 @@ jobs:
5763
retry_wait_seconds: 120
5864
command: scripts/pod_lib_lint.rb FirebaseCrashlytics.podspec --platforms=${{ matrix.target }} ${{ matrix.build-env.tests }} ${{ matrix.flags }}
5965

60-
catalyst:
61-
# Don't run on private repo unless it is a PR.
62-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
63-
64-
runs-on: macos-15
65-
steps:
66-
- uses: actions/checkout@v4
67-
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
68-
with:
69-
cache_key: catalyst${{ matrix.os }}
70-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
71-
- name: Setup Bundler
72-
run: scripts/setup_bundler.sh
73-
- name: Xcode
74-
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
75-
- uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
76-
with:
77-
timeout_minutes: 120
78-
max_attempts: 5
79-
retry_on: error
80-
retry_wait_seconds: 120
81-
command: scripts/test_catalyst.sh FirebaseCrashlytics test FirebaseCrashlytics-Unit-unit
82-
8366
quickstart:
8467
# Don't run on private repo unless it is a PR.
8568
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

.github/workflows/database.yml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ jobs:
2929
with:
3030
target: ${{ matrix.target }}
3131

32+
catalyst:
33+
uses: ./.github/workflows/common_catalyst.yml
34+
with:
35+
product: FirebaseDatabase
36+
target: FirebaseDatabase-Unit-unit
37+
3238
pod-lib-lint:
3339
# Don't run on private repo unless it is a PR.
3440
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
@@ -71,23 +77,6 @@ jobs:
7177
# Only iOS to mitigate flakes.
7278
run: scripts/third_party/travis/retry.sh scripts/build.sh Database iOS integration
7379

74-
catalyst:
75-
# Don't run on private repo unless it is a PR.
76-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
77-
runs-on: macos-15
78-
steps:
79-
- uses: actions/checkout@v4
80-
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
81-
with:
82-
cache_key: catalyst${{ matrix.os }}
83-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
84-
- name: Setup Bundler
85-
run: scripts/setup_bundler.sh
86-
- name: Xcode
87-
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
88-
- name: Setup project and Build for Catalyst
89-
run: scripts/test_catalyst.sh FirebaseDatabase test FirebaseDatabase-Unit-unit
90-
9180
quickstart:
9281
# Don't run on private repo unless it is a PR.
9382
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

.github/workflows/firebase_app_check.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ jobs:
2424
with:
2525
target: ${{ matrix.target }}
2626

27+
catalyst:
28+
uses: ./.github/workflows/common_catalyst.yml
29+
with:
30+
product: FirebaseAppCheck
31+
target: FirebaseAppCheck-Unit-unit
32+
2733
pod_lib_lint:
2834
# Don't run on private repo unless it is a PR.
2935
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
@@ -49,20 +55,6 @@ jobs:
4955
- name: FirebaseAppCheck
5056
run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} --platforms=${{ matrix.target }}
5157

52-
catalyst:
53-
# Don't run on private repo unless it is a PR.
54-
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
55-
runs-on: macos-15
56-
steps:
57-
- uses: actions/checkout@v4
58-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
59-
- name: Setup Bundler
60-
run: scripts/setup_bundler.sh
61-
- name: Xcode
62-
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
63-
- name: Setup project and Build for Catalyst
64-
run: scripts/test_catalyst.sh FirebaseAppCheck test FirebaseAppCheck-Unit-unit
65-
6658
diagnostics:
6759
# Don't run on private repo unless it is a PR.
6860
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

0 commit comments

Comments
 (0)