Skip to content

Commit 5dcc3fb

Browse files
authored
[Infra] Break up env-dependent GHA steps into separate job to reduce artifact collisions (#11814)
1 parent 455de9c commit 5dcc3fb

File tree

1 file changed

+46
-12
lines changed

1 file changed

+46
-12
lines changed

.github/workflows/firestore.yml

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -316,30 +316,69 @@ jobs:
316316
--allow-warnings \
317317
--no-analyze
318318
319-
spm:
319+
spm-source:
320320
# Either a scheduled run from public repo, or a pull request with firestore changes.
321321
if: |
322322
(github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') ||
323323
(github.event_name == 'pull_request' && needs.changes.outputs.changed == 'true')
324324
runs-on: macos-12
325325
needs: check
326+
env:
327+
FIREBASE_SOURCE_FIRESTORE: 1
326328
steps:
327329
- uses: actions/checkout@v3
328330
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
329331
with:
330332
cache_key: ${{ matrix.os }}
331333
- name: Initialize xcodebuild
332334
run: scripts/setup_spm_tests.sh
333-
- name: iOS Build Test – Binary
335+
- name: iOS Build Test
334336
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore iOS spmbuildonly
335-
- name: iOS Build Test – Source
337+
- name: Swift Build
338+
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift iOS spmbuildonly
339+
340+
spm-binary:
341+
# Either a scheduled run from public repo, or a pull request with firestore changes.
342+
if: |
343+
(github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') ||
344+
(github.event_name == 'pull_request' && needs.changes.outputs.changed == 'true')
345+
runs-on: macos-12
346+
needs: check
347+
steps:
348+
- uses: actions/checkout@v3
349+
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
350+
with:
351+
cache_key: ${{ matrix.os }}
352+
- name: Initialize xcodebuild
353+
run: scripts/setup_spm_tests.sh
354+
- name: iOS Build Test
336355
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore iOS spmbuildonly
337-
env:
338-
FIREBASE_SOURCE_FIRESTORE: 1
339356
- name: Swift Build
340357
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift iOS spmbuildonly
341358

342-
spm-cron:
359+
# TODO: Re-enable either in or after #11706.
360+
# spm-source-cron:
361+
# # Don't run on private repo.
362+
# if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
363+
# runs-on: macos-12
364+
# strategy:
365+
# matrix:
366+
# target: [tvOS, macOS, catalyst]
367+
# env:
368+
# FIREBASE_SOURCE_FIRESTORE: 1
369+
# steps:
370+
# - uses: actions/checkout@v3
371+
# - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
372+
# with:
373+
# cache_key: ${{ matrix.os }}
374+
# - name: Initialize xcodebuild
375+
# run: scripts/setup_spm_tests.sh
376+
# - name: Build Test - Binary
377+
# run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore ${{ matrix.target }} spmbuildonly
378+
# - name: Swift Build
379+
# run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift ${{ matrix.target }} spmbuildonly
380+
381+
spm-binary-cron:
343382
# Don't run on private repo.
344383
if: github.event_name == 'schedule' && github.repository == 'Firebase/firebase-ios-sdk'
345384
runs-on: macos-12
@@ -355,11 +394,6 @@ jobs:
355394
run: scripts/setup_spm_tests.sh
356395
- name: Build Test - Binary
357396
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore ${{ matrix.target }} spmbuildonly
358-
# TODO: Re-enable either in or after #11706.
359-
# - name: Build Test – Source
360-
# run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestore ${{ matrix.target }} spmbuildonly
361-
# env:
362-
# FIREBASE_SOURCE_FIRESTORE: 1
363397
- name: Swift Build
364398
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift ${{ matrix.target }} spmbuildonly
365399

@@ -369,7 +403,7 @@ jobs:
369403
runs-on: ubuntu-latest
370404
if: always()
371405
name: Check all required Firestore tests results
372-
needs: [cmake, cmake-prod-db, xcodebuild, spm]
406+
needs: [cmake, cmake-prod-db, xcodebuild, spm-source, spm-binary]
373407
steps:
374408
- name: Check test matrix
375409
if: needs.cmake.result == 'failure' || needs.cmake-prod-db.result == 'failure' || needs.xcodebuild.result == 'failure' || needs.spm.result == 'failure'

0 commit comments

Comments
 (0)