diff --git a/.github/workflows/firestore.yml b/.github/workflows/firestore.yml index cc257911e3f..8552922accc 100644 --- a/.github/workflows/firestore.yml +++ b/.github/workflows/firestore.yml @@ -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.