Skip to content

Commit be9d960

Browse files
authored
refactor(ci): Consolidate cron jobs (#15273)
1 parent dba582f commit be9d960

18 files changed

+204
-361
lines changed

.github/workflows/abtesting.yml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- '.github/workflows/common_cocoapods.yml'
1515
- '.github/workflows/common_catalyst.yml'
1616
- '.github/workflows/common_quickstart.yml'
17+
- '.github/workflows/common_cocoapods_cron.yml'
1718
- 'Gemfile*'
1819
schedule:
1920
# Run every day at 2am (PDT) / 5am (EDT) - cron uses UTC times
@@ -85,25 +86,9 @@ jobs:
8586
test_type: "xctest"
8687

8788
abtesting-cron-only:
88-
# Don't run on private repo.
89-
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
90-
91-
runs-on: macos-15
92-
strategy:
93-
matrix:
94-
target: [ios, tvos, macos]
95-
flags: [
96-
'--use-static-frameworks'
97-
]
9889
needs: pod_lib_lint
99-
steps:
100-
- uses: actions/checkout@v4
101-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
102-
- name: Setup Bundler
103-
run: scripts/setup_bundler.sh
104-
- name: Xcode
105-
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
106-
- name: PodLibLint ABTesting Cron
107-
run: |
108-
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb \
109-
FirebaseABTesting.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}
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/appdistribution.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- '.github/workflows/common.yml'
1313
- '.github/workflows/common_cocoapods.yml'
1414
- '.github/workflows/common_catalyst.yml'
15+
- '.github/workflows/common_cocoapods_cron.yml'
1516
- 'Gemfile*'
1617
schedule:
1718
# Run every day at 2am (PDT) / 5am (EDT) - cron uses UTC times
@@ -41,24 +42,9 @@ jobs:
4142
platforms: iOS # App Distro only supports iOS.
4243

4344
appdistribution-cron-only:
44-
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
45-
46-
runs-on: macos-15
47-
strategy:
48-
matrix:
49-
target: [ios]
50-
flags: [
51-
'--use-static-frameworks'
52-
]
5345
needs: pod_lib_lint
54-
steps:
55-
- uses: actions/checkout@v4
56-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
57-
- name: Setup Xcode
58-
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
59-
- name: Setup Bundler
60-
run: scripts/setup_bundler.sh
61-
- name: PodLibLint App Distribution Cron
62-
run: |
63-
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAppDistribution.podspec \
64-
--platforms=${{ matrix.target }} ${{ matrix.flags }}
46+
uses: ./.github/workflows/common_cocoapods_cron.yml
47+
with:
48+
product: FirebaseAppDistribution
49+
platforms: '[ "ios" ]'
50+
flags: '[ "--use-static-frameworks" ]'

.github/workflows/auth.yml

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- '.github/workflows/common_cocoapods.yml'
1515
- '.github/workflows/common_catalyst.yml'
1616
- '.github/workflows/common_quickstart.yml'
17+
- '.github/workflows/common_cocoapods_cron.yml'
1718
- 'scripts/gha-encrypted/AuthSample/SwiftApplication.plist.gpg'
1819
- 'Gemfile*'
1920
schedule:
@@ -134,32 +135,12 @@ jobs:
134135
# test_type: "xctest"
135136

136137
auth-cron-only:
137-
# Don't run on private repo.
138-
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
139-
140-
runs-on: macos-15
141-
strategy:
142-
matrix:
143-
# The macos and tvos tests can hang, and watchOS doesn't have tests.
144-
target: [ios, tvos --skip-tests, macos --skip-tests, watchos --skip-tests]
145-
flags: [
146-
'--use-static-frameworks'
147-
]
148-
needs: pod_lib_lint
149-
env:
150-
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
151-
steps:
152-
- uses: actions/checkout@v4
153-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
154-
- name: Setup Xcode
155-
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
156-
- name: Setup Bundler
157-
run: scripts/setup_bundler.sh
158-
- name: Configure test keychain
159-
run: scripts/configure_test_keychain.sh
160-
- uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
161-
with:
162-
timeout_minutes: 15
163-
max_attempts: 3
164-
retry_wait_seconds: 120
165-
command: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAuth.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}
138+
needs: pod_lib_lint
139+
uses: ./.github/workflows/common_cocoapods_cron.yml
140+
with:
141+
product: FirebaseAuth
142+
platforms: '[ "ios", "tvos --skip-tests", "macos --skip-tests", "watchos --skip-tests" ]'
143+
flags: '[ "--use-static-frameworks" ]'
144+
setup_command: scripts/configure_test_keychain.sh
145+
secrets:
146+
plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: common_cocoapods_cron
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_call:
8+
secrets:
9+
plist_secret:
10+
required: false
11+
inputs:
12+
# The product to test be tested (e.g. `FirebaseABTesting`).
13+
product:
14+
type: string
15+
required: true
16+
17+
# JSON array of platforms to test against (e.g. `[ "ios", "tvos" ]`).
18+
platforms:
19+
type: string
20+
required: true
21+
22+
# JSON array of flags to pass to pod lib lint. Each string in the array
23+
# will create a separate matrix entry.
24+
# e.g. `[ "--use-static-frameworks" ]`.
25+
# To run with no flags, pass `[ "" ]`.
26+
flags:
27+
type: string
28+
required: false
29+
default: '[""]'
30+
31+
# A command to execute before testing.
32+
setup_command:
33+
type: string
34+
required: false
35+
default: ""
36+
37+
# The version of Xcode to use.
38+
xcode:
39+
type: string
40+
required: false
41+
default: "Xcode_16.4"
42+
43+
# The runner to use.
44+
runs_on:
45+
type: string
46+
required: false
47+
default: "macos-15"
48+
49+
jobs:
50+
cron-job:
51+
# This job is intended to be run on a schedule, on the main repo.
52+
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
53+
54+
runs-on: ${{ inputs.runs_on }}
55+
strategy:
56+
matrix:
57+
platform: ${{ fromJson(inputs.platforms) }}
58+
flags: ${{ fromJson(inputs.flags) }}
59+
60+
steps:
61+
- uses: actions/checkout@v4
62+
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
63+
- name: Setup Bundler
64+
run: scripts/setup_bundler.sh
65+
- name: Xcode
66+
run: sudo xcode-select -s /Applications/${{ inputs.xcode }}.app/Contents/Developer
67+
- name: Run setup command, if needed.
68+
if: inputs.setup_command != ''
69+
env:
70+
plist_secret: ${{ secrets.plist_secret }}
71+
run: ${{ inputs.setup_command }}
72+
- name: PodLibLint Cron
73+
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
74+
with:
75+
timeout_minutes: 15
76+
max_attempts: 3
77+
retry_wait_seconds: 120
78+
command: |
79+
scripts/pod_lib_lint.rb \
80+
${{ inputs.product }}.podspec \
81+
--platforms=${{ matrix.platform }} \
82+
${{ matrix.flags }}

.github/workflows/core.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- '.github/workflows/common.yml'
1313
- '.github/workflows/common_cocoapods.yml'
1414
- '.github/workflows/common_catalyst.yml'
15+
- '.github/workflows/common_cocoapods_cron.yml'
1516
- 'Gemfile*'
1617
schedule:
1718
# Run every day at 3am (PDT) / 6am (EDT) - cron uses UTC times
@@ -39,23 +40,11 @@ jobs:
3940
product: FirebaseCore
4041

4142
core-cron-only:
42-
# Don't run on private repo.
43-
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
44-
45-
runs-on: macos-14
46-
strategy:
47-
matrix:
48-
target: [ios, tvos, macos]
49-
flags: [
50-
'--use-static-frameworks'
51-
]
5243
needs: pod_lib_lint
53-
steps:
54-
- uses: actions/checkout@v4
55-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
56-
- name: Xcode
57-
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
58-
- name: Setup Bundler
59-
run: scripts/setup_bundler.sh
60-
- name: PodLibLint Core Cron
61-
run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCore.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}
44+
uses: ./.github/workflows/common_cocoapods_cron.yml
45+
with:
46+
product: FirebaseCore
47+
platforms: '[ "ios", "tvos", "macos" ]'
48+
flags: '[ "--use-static-frameworks" ]'
49+
runs_on: macos-14
50+
xcode: Xcode_16.2

.github/workflows/core_extension.yml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- '.github/workflows/core_extension.yml'
1313
- '.github/workflows/common.yml'
1414
- '.github/workflows/common_cocoapods.yml'
15+
- '.github/workflows/common_cocoapods_cron.yml'
1516
- 'Gemfile*'
1617
schedule:
1718
# Run every day at 3am (PDT) / 6am (EDT) - cron uses UTC times
@@ -24,23 +25,10 @@ jobs:
2425
with:
2526
product: FirebaseCoreExtension
2627

27-
core-internal-cron-only:
28-
# Don't run on private repo.
29-
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
30-
runs-on: macos-15
31-
strategy:
32-
matrix:
33-
target: [ios, tvos, macos]
34-
flags: [
35-
'--use-static-frameworks'
36-
]
28+
core-extension-cron-only:
3729
needs: pod_lib_lint
38-
steps:
39-
- uses: actions/checkout@v4
40-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
41-
- name: Xcode
42-
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
43-
- name: Setup Bundler
44-
run: scripts/setup_bundler.sh
45-
- name: PodLibLint CoreInternal Cron
46-
run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCoreExtension.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}
30+
uses: ./.github/workflows/common_cocoapods_cron.yml
31+
with:
32+
product: FirebaseCoreExtension
33+
platforms: '[ "ios", "tvos", "macos" ]'
34+
flags: '[ "--use-static-frameworks" ]'

.github/workflows/core_internal.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
- '.github/workflows/common.yml'
1414
- '.github/workflows/common_cocoapods.yml'
1515
- '.github/workflows/common_catalyst.yml'
16+
- '.github/workflows/common_cocoapods_cron.yml'
1617
- 'Gemfile*'
1718
schedule:
1819
# Run every day at 3am (PDT) / 6am (EDT) - cron uses UTC times
@@ -40,22 +41,9 @@ jobs:
4041
supports_swift6: true
4142

4243
core-internal-cron-only:
43-
# Don't run on private repo.
44-
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
45-
runs-on: macos-15
46-
strategy:
47-
matrix:
48-
target: [ios, tvos, macos]
49-
flags: [
50-
'--use-static-frameworks'
51-
]
5244
needs: pod_lib_lint
53-
steps:
54-
- uses: actions/checkout@v4
55-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
56-
- name: Xcode
57-
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
58-
- name: Setup Bundler
59-
run: scripts/setup_bundler.sh
60-
- name: PodLibLint CoreInternal Cron
61-
run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCoreInternal.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}
45+
uses: ./.github/workflows/common_cocoapods_cron.yml
46+
with:
47+
product: FirebaseCoreInternal
48+
platforms: '[ "ios", "tvos", "macos" ]'
49+
flags: '[ "--use-static-frameworks" ]'

.github/workflows/crashlytics.yml

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- '.github/workflows/common_cocoapods.yml'
1515
- '.github/workflows/common_catalyst.yml'
1616
- '.github/workflows/common_quickstart.yml'
17+
- '.github/workflows/common_cocoapods_cron.yml'
1718
- 'Interop/Analytics/Public/*.h'
1819
- 'Gemfile*'
1920
schedule:
@@ -98,29 +99,9 @@ jobs:
9899
test_type: "xctest"
99100

100101
crashlytics-cron-only:
101-
# Don't run on private repo.
102-
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
103-
104-
runs-on: macos-15
105-
strategy:
106-
matrix:
107-
# Disable watchos because it does not support XCTest.
108-
target: [ios, tvos, macos, watchos --skip-tests]
109-
flags: [
110-
'--use-static-frameworks',
111-
'--use-modular-headers --skip-tests'
112-
]
113102
needs: pod_lib_lint
114-
steps:
115-
- uses: actions/checkout@v4
116-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
117-
- name: Setup Bundler
118-
run: scripts/setup_bundler.sh
119-
- name: Xcode
120-
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
121-
- uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
122-
with:
123-
timeout_minutes: 15
124-
max_attempts: 3
125-
retry_wait_seconds: 120
126-
command: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCrashlytics.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }}
103+
uses: ./.github/workflows/common_cocoapods_cron.yml
104+
with:
105+
product: FirebaseCrashlytics
106+
platforms: '[ "ios", "tvos", "macos", "watchos --skip-tests" ]'
107+
flags: '[ "--use-static-frameworks", "--use-modular-headers --skip-tests" ]'

0 commit comments

Comments
 (0)