Skip to content

Commit c8e9a8c

Browse files
authored
[Firestore] Add a check to ensure FirestoreInternal has same public headers as Firestore (#12575)
1 parent e159d94 commit c8e9a8c

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/firestore.yml

+31
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,37 @@ jobs:
483483
- name: Swift Build
484484
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift iOS spmbuildonly
485485

486+
check-firestore-internal-public-headers:
487+
# Either a scheduled run from public repo, or a pull request with firestore changes.
488+
if: |
489+
(github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') ||
490+
(github.event_name == 'pull_request' && needs.changes.outputs.changed == 'true')
491+
runs-on: macos-12
492+
needs: check
493+
steps:
494+
- uses: actions/checkout@v4
495+
- name: Assert that Firestore and FirestoreInternal have identically named headers.
496+
run: |
497+
fst_dir=Firestore/Source/Public/FirebaseFirestore/
498+
fst_internal_dir=FirebaseFirestoreInternal/FirebaseFirestore/
499+
500+
comparison=$(comm -3 <(ls $fst_dir | sort) <(ls $fst_internal_dir | sort))
501+
502+
if [[ -z "$comparison" ]]; then
503+
echo "Success: Directories '$fst_dir' and '$fst_internal_dir' match."
504+
else
505+
echo "Error: Directories '$fst_dir' and '$fst_internal_dir' differ:"
506+
echo "Files only in '$fst_dir':"
507+
# Files in this set do not start with whitespace. Grep for them and a
508+
# dashed prefix for nicer formatting.
509+
echo "$comparison" | grep -v '^\s' | sed 's/^/- /'
510+
echo "Files only in '$fst_internal_dir':"
511+
# Files in this set start with whitespace. Grep for them and a dashed
512+
# prefix for nicer formatting.
513+
echo "$comparison" | grep '^\s' | sed 's/^ /- /'
514+
exit 1
515+
fi
516+
486517
# TODO: Re-enable either in or after #11706.
487518
# spm-source-cron:
488519
# # Don't run on private repo.

0 commit comments

Comments
 (0)