Skip to content

Commit 9973683

Browse files
authored
[Infra] Migrate firestore.yml to use reusable workflow jobs (#14917)
1 parent 0004edb commit 9973683

File tree

2 files changed

+24
-45
lines changed

2 files changed

+24
-45
lines changed

.github/workflows/common_cocoapods.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ on:
6969
required: false
7070
default: false
7171

72+
# Whether to lint with `--analyze`. Defaults to true.
73+
analyze:
74+
type: boolean
75+
required: false
76+
default: true
77+
7278
# Whether to additionally build with Swift 6. Defaults to false.
7379
supports_swift6:
7480
type: boolean
@@ -140,5 +146,6 @@ jobs:
140146
command: |
141147
scripts/pod_lib_lint.rb ${{ inputs.product }}.podspec --platforms=${{ matrix.platform }} \
142148
${{ inputs.allow_warnings == true && '--allow-warnings' || '' }} \
149+
${{ inputs.analyze == false && '--no-analyze' || '' }} \
143150
${{ inputs.test_specs != '' && format('--test-specs={0}', inputs.test_specs) || '' }} \
144151
${{ (contains(inputs.buildonly_platforms, matrix.platform) || contains(inputs.buildonly_platforms, 'all')) && '--skip-tests' || '' }}

.github/workflows/firestore.yml

Lines changed: 17 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ jobs:
8383
# This workflow
8484
- '.github/workflows/firestore.yml'
8585
86+
# Workflows this one depends on.
87+
- '.github/workflows/common.yml'
88+
- '.github/workflows/common_cocoapods.yml'
89+
8690
# Rebuild on Ruby infrastructure changes.
8791
- 'Gemfile*'
8892
@@ -379,37 +383,17 @@ jobs:
379383
export EXPERIMENTAL_MODE=true
380384
scripts/third_party/travis/retry.sh scripts/build.sh Firestore ${{ matrix.target }} xcodebuild
381385
382-
383-
pod-lib-lint:
386+
pod_lib_lint:
384387
needs: check
385-
# Either a scheduled run from public repo, or a pull request with firestore changes.
386-
if: |
387-
(github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') ||
388-
(github.event_name == 'pull_request')
389-
runs-on: macos-15
390388
strategy:
391389
matrix:
392-
podspec: [
393-
'FirebaseFirestoreInternal.podspec',
394-
'FirebaseFirestore.podspec',
395-
]
396-
397-
steps:
398-
- uses: actions/checkout@v4
399-
400-
- uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252 # v1
401-
- name: Setup Bundler
402-
run: ./scripts/setup_bundler.sh
403-
- name: Xcode
404-
run: sudo xcode-select -s /Applications/Xcode_16.3.app/Contents/Developer
405-
406-
- name: Pod lib lint
407-
# TODO(#9565, b/227461966): Remove --no-analyze when absl is fixed.
408-
run: |
409-
scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} \
410-
--platforms=ios \
411-
--allow-warnings \
412-
--no-analyze
390+
product: ['FirebaseFirestoreInternal', 'FirebaseFirestore']
391+
uses: ./.github/workflows/common_cocoapods.yml
392+
with:
393+
product: ${{ matrix.product }}
394+
platforms: iOS
395+
allow_warnings: true
396+
analyze: false # TODO(#9565, b/227461966): Remove when absl is fixed.
413397

414398
# `pod lib lint` takes a long time so only run the other platforms and static frameworks build in the cron.
415399
pod-lib-lint-cron:
@@ -524,23 +508,11 @@ jobs:
524508
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore ${{ matrix.target }} spmbuildonly
525509

526510
spm-binary:
527-
needs: check
528-
# Either a scheduled run from public repo, or a pull request with firestore changes.
529-
if: |
530-
(github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') ||
531-
(github.event_name == 'pull_request' && needs.changes.outputs.changed == 'true')
532-
runs-on: macos-15
533-
steps:
534-
- uses: actions/checkout@v4
535-
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
536-
with:
537-
cache_key: spm-binary
538-
- name: Xcode
539-
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
540-
- name: Initialize xcodebuild
541-
run: scripts/setup_spm_tests.sh
542-
- name: iOS Build Test
543-
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore iOS spmbuildonly
511+
uses: ./.github/workflows/common.yml
512+
with:
513+
target: FirebaseFirestore
514+
platforms: iOS
515+
buildonly_platforms: iOS
544516

545517
check-firestore-internal-public-headers:
546518
needs: check

0 commit comments

Comments
 (0)