Skip to content

Commit

Permalink
[Firestore] Add a check to ensure FirestoreInternal has same public h…
Browse files Browse the repository at this point in the history
…eaders as Firestore (#12575)
  • Loading branch information
ncooke3 authored Mar 18, 2024
1 parent e159d94 commit c8e9a8c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/firestore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,37 @@ jobs:
- name: Swift Build
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift iOS spmbuildonly

check-firestore-internal-public-headers:
# 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-12
needs: check
steps:
- uses: actions/checkout@v4
- name: Assert that Firestore and FirestoreInternal have identically named headers.
run: |
fst_dir=Firestore/Source/Public/FirebaseFirestore/
fst_internal_dir=FirebaseFirestoreInternal/FirebaseFirestore/
comparison=$(comm -3 <(ls $fst_dir | sort) <(ls $fst_internal_dir | sort))
if [[ -z "$comparison" ]]; then
echo "Success: Directories '$fst_dir' and '$fst_internal_dir' match."
else
echo "Error: Directories '$fst_dir' and '$fst_internal_dir' differ:"
echo "Files only in '$fst_dir':"
# Files in this set do not start with whitespace. Grep for them and a
# dashed prefix for nicer formatting.
echo "$comparison" | grep -v '^\s' | sed 's/^/- /'
echo "Files only in '$fst_internal_dir':"
# Files in this set start with whitespace. Grep for them and a dashed
# prefix for nicer formatting.
echo "$comparison" | grep '^\s' | sed 's/^ /- /'
exit 1
fi
# TODO: Re-enable either in or after #11706.
# spm-source-cron:
# # Don't run on private repo.
Expand Down

0 comments on commit c8e9a8c

Please sign in to comment.