Skip to content

[Infra] Add re-usable workflow for catalyst jobs #14762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 6 additions & 23 deletions .github/workflows/abtesting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@
with:
target: ABTestingUnit

catalyst:
uses: ./.github/workflows/common_catalyst.yml
with:
product: FirebaseABTesting
target: FirebaseABTesting-Unit-unit

pod-lib-lint:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

Expand Down Expand Up @@ -60,29 +66,6 @@
retry_wait_seconds: 120
command: scripts/pod_lib_lint.rb FirebaseABTesting.podspec --platforms=${{ matrix.target }}

catalyst:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
with:
cache_key: catalyst${{ matrix.os }}
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Xcode
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
- uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
with:
timeout_minutes: 120
max_attempts: 3
retry_on: error
retry_wait_seconds: 120
command: scripts/test_catalyst.sh FirebaseABTesting test FirebaseABTesting-Unit-unit

quickstart:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
Expand Down
24 changes: 6 additions & 18 deletions .github/workflows/appdistribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@
target: AppDistributionUnit
platforms: iOS

catalyst:
uses: ./.github/workflows/common_catalyst.yml
with:
product: FirebaseAppDistribution
target: FirebaseAppDistribution-Unit-unit

pod-lib-lint:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

Expand All @@ -46,24 +52,6 @@
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAppDistribution.podspec \
--platforms=ios

catalyst:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
with:
cache_key: catalyst${{ matrix.os }}
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Xcode
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
- name: Setup project and Build for Catalyst
run: scripts/test_catalyst.sh FirebaseAppDistribution test FirebaseAppDistribution-Unit-unit

appdistribution-cron-only:
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'

Expand Down
29 changes: 7 additions & 22 deletions .github/workflows/auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@
target: AuthUnit
buildonly_platforms: macOS

catalyst:
uses: ./.github/workflows/common_catalyst.yml
with:
product: FirebaseAuth
target: FirebaseAuth-Unit-unit
buildonly: true

pod-lib-lint:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

Expand Down Expand Up @@ -123,28 +130,6 @@
retry_wait_seconds: 120
command: ([ -z $plist_secret ] || scripts/build.sh Auth iOS ${{ matrix.scheme }})

catalyst:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
with:
cache_key: catalyst${{ matrix.os }}
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Xcode
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
- uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
with:
timeout_minutes: 120
max_attempts: 3
retry_on: error
retry_wait_seconds: 120
command: scripts/test_catalyst.sh FirebaseAuth build FirebaseAuth-Unit-unit

quickstart:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/common_catalyst.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: common_catalyst

permissions:
contents: read

on:
workflow_call:
inputs:
# The product to test be tested (e.g. `FirebaseABTesting`).
product:
type: string
required: true

# The target scheme to be tested (e.g. `FirebaseABTesting-Unit-unit`.
target:
type: string
required: true

# Whether to build-only. Defaults to false.
buildonly:
type: boolean
required: false
default: false

jobs:
# TODO: Can this be built via SPM?
catalyst:
# Run on the main repo's scheduled jobs or pull requests and manual workflow invocations.
if: (github.repository == 'firebase/firebase-ios-sdk' && github.event_name == 'schedule') || contains(fromJSON('["pull_request", "workflow_dispatch"]'), github.event_name)
runs-on: macos-15
steps:
- uses: actions/checkout@v4
# TODO: Remove in favor of ccache.
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
with:
cache_key: catalyst${{ matrix.os }}
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Xcode
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
- uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
with:
timeout_minutes: 120
max_attempts: 3
retry_on: error
retry_wait_seconds: 120
command: |
scripts/test_catalyst.sh \
${{ inputs.product }} \
${{ inputs.buildonly == true && 'build' || 'test' }} \
${{ inputs.target }}
24 changes: 6 additions & 18 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@
with:
target: CoreUnit

catalyst:
uses: ./.github/workflows/common_catalyst.yml
with:
product: FirebaseCore
target: FirebaseCore-Unit-unit

pod-lib-lint:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
strategy:
Expand Down Expand Up @@ -72,24 +78,6 @@
path: .build
key: ${{ steps.generate_cache_key.outputs.cache_key }}

catalyst:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
with:
cache_key: ${{ matrix.os }}
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Xcode
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
- name: Setup project and Build Catalyst
run: scripts/test_catalyst.sh FirebaseCore test FirebaseCore-Unit-unit

core-cron-only:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
Expand Down
28 changes: 9 additions & 19 deletions .github/workflows/core_internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@
with:
target: FirebaseCoreInternalTests

catalyst:
strategy:
matrix:
target: [FirebaseCoreInternal-Unit-Unit, FirebaseCoreInternal-Unit-Integration]
uses: ./.github/workflows/common_catalyst.yml
with:
product: FirebaseCoreInternal
target: ${{ matrix.target }}

pod-lib-lint:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
strategy:
Expand Down Expand Up @@ -47,25 +56,6 @@
- name: Build and test
run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCoreInternal.podspec --platforms=${{ matrix.target }}

catalyst:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
with:
cache_key: catalyst${{ matrix.os }}
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Xcode
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
- name: Setup Catalyst project and run unit tests
run: scripts/test_catalyst.sh FirebaseCoreInternal test FirebaseCoreInternal-Unit-Unit
- name: Setup Catalyst project and run integration tests
run: scripts/test_catalyst.sh FirebaseCoreInternal test FirebaseCoreInternal-Unit-Integration

core-internal-cron-only:
# Don't run on private repo.
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
Expand Down
29 changes: 6 additions & 23 deletions .github/workflows/crashlytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@
with:
target: FirebaseCrashlyticsUnit

catalyst:
uses: ./.github/workflows/common_catalyst.yml
with:
product: FirebaseCrashlytics
target: FirebaseCrashlytics-Unit-unit

pod-lib-lint:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

Expand Down Expand Up @@ -57,29 +63,6 @@
retry_wait_seconds: 120
command: scripts/pod_lib_lint.rb FirebaseCrashlytics.podspec --platforms=${{ matrix.target }} ${{ matrix.build-env.tests }} ${{ matrix.flags }}

catalyst:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
with:
cache_key: catalyst${{ matrix.os }}
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Xcode
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
- uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3
with:
timeout_minutes: 120
max_attempts: 5
retry_on: error
retry_wait_seconds: 120
command: scripts/test_catalyst.sh FirebaseCrashlytics test FirebaseCrashlytics-Unit-unit

quickstart:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
Expand Down
23 changes: 6 additions & 17 deletions .github/workflows/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@
with:
target: ${{ matrix.target }}

catalyst:
uses: ./.github/workflows/common_catalyst.yml
with:
product: FirebaseDatabase
target: FirebaseDatabase-Unit-unit

pod-lib-lint:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
strategy:
Expand Down Expand Up @@ -71,23 +77,6 @@
# Only iOS to mitigate flakes.
run: scripts/third_party/travis/retry.sh scripts/build.sh Database iOS integration

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

quickstart:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
Expand Down
20 changes: 6 additions & 14 deletions .github/workflows/firebase_app_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@
with:
target: ${{ matrix.target }}

catalyst:
uses: ./.github/workflows/common_catalyst.yml
with:
product: FirebaseAppCheck
target: FirebaseAppCheck-Unit-unit

pod_lib_lint:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
strategy:
Expand All @@ -49,20 +55,6 @@
- name: FirebaseAppCheck
run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} --platforms=${{ matrix.target }}

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

diagnostics:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
Expand Down
Loading
Loading