Skip to content

[Infra] Migrate firestore.yml to use reusable workflow jobs #14917

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 7 commits into from
Jun 3, 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
7 changes: 7 additions & 0 deletions .github/workflows/common_cocoapods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ on:
required: false
default: false

# Whether to lint with `--analyze`. Defaults to true.
analyze:
type: boolean
required: false
default: true

# Whether to additionally build with Swift 6. Defaults to false.
supports_swift6:
type: boolean
Expand Down Expand Up @@ -140,5 +146,6 @@ jobs:
command: |
scripts/pod_lib_lint.rb ${{ inputs.product }}.podspec --platforms=${{ matrix.platform }} \
${{ inputs.allow_warnings == true && '--allow-warnings' || '' }} \
${{ inputs.analyze == false && '--no-analyze' || '' }} \
${{ inputs.test_specs != '' && format('--test-specs={0}', inputs.test_specs) || '' }} \
${{ (contains(inputs.buildonly_platforms, matrix.platform) || contains(inputs.buildonly_platforms, 'all')) && '--skip-tests' || '' }}
62 changes: 17 additions & 45 deletions .github/workflows/firestore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@
# This workflow
- '.github/workflows/firestore.yml'

# Workflows this one depends on.
- '.github/workflows/common.yml'
- '.github/workflows/common_cocoapods.yml'

# Rebuild on Ruby infrastructure changes.
- 'Gemfile*'

Expand Down Expand Up @@ -379,37 +383,17 @@
export EXPERIMENTAL_MODE=true
scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ matrix.target }} xcodebuild


pod-lib-lint:
pod_lib_lint:
needs: check
# Either a scheduled run from public repo, or a pull request with firestore changes.
if: |
(github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') ||
(github.event_name == 'pull_request')
runs-on: macos-15
strategy:
matrix:
podspec: [
'FirebaseFirestoreInternal.podspec',
'FirebaseFirestore.podspec',
]

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.3.app/Contents/Developer

- name: Pod lib lint
# TODO(#9565, b/227461966): Remove --no-analyze when absl is fixed.
run: |
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} \
--platforms=ios \
--allow-warnings \
--no-analyze
product: ['FirebaseFirestoreInternal', 'FirebaseFirestore']
uses: ./.github/workflows/common_cocoapods.yml
with:
product: ${{ matrix.product }}
platforms: iOS
allow_warnings: true
analyze: false # TODO(#9565, b/227461966): Remove when absl is fixed.

# `pod lib lint` takes a long time so only run the other platforms and static frameworks build in the cron.
pod-lib-lint-cron:
Expand Down Expand Up @@ -524,25 +508,13 @@
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore ${{ matrix.target }} spmbuildonly

spm-binary:
needs: check
# Either a scheduled run from public repo, or a pull request with firestore changes.
if: |
(github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') ||
(github.event_name == 'pull_request' && needs.changes.outputs.changed == 'true')
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
with:
cache_key: spm-binary
- name: Xcode
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
- name: Initialize xcodebuild
run: scripts/setup_spm_tests.sh
- name: iOS Build Test
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore iOS spmbuildonly
uses: ./.github/workflows/common.yml
with:
target: FirebaseFirestore
platforms: iOS
buildonly_platforms: iOS

check-firestore-internal-public-headers:

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: {}
needs: check
# Either a scheduled run from public repo, or a pull request with firestore changes.
if: |
Expand Down
Loading