Skip to content
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

[Firestore] Add a check to ensure FirestoreInternal has same public headers as Firestore #12575

Merged
merged 5 commits into from
Mar 18, 2024
Merged
Changes from 2 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
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
Loading