-
Notifications
You must be signed in to change notification settings - Fork 641
dataconnect: use firebase-tools to launch fdc emulator instead of launching it directly #6896
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
Merged
dconeybe
merged 6 commits into
main
from
dconeybe/dataconnect/FirebaseToolsForDataConnectEmulator
Apr 18, 2025
+70
−33
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
887ff86
dataconnect.yml: use firebase-tools to launch fdc emulator instead of…
dconeybe 76bddf8
work
dconeybe b9d41e6
add missing emulator versions
dconeybe 603f93d
dataconnect_demo_app.yml: upgrade firebase-tools from 13.28.0 to 14.2.0
dconeybe f5d3077
dataconnect.yml: specify DATACONNECT_EMULATOR_BINARY_PATH to match th…
dconeybe 3d2db81
dataconnect.yml: fix -n to -z
dconeybe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ env: | |
FDC_JAVA_VERSION: ${{ inputs.javaVersion || '17' }} | ||
FDC_ANDROID_EMULATOR_API_LEVEL: ${{ inputs.androidEmulatorApiLevel || '34' }} | ||
FDC_NODEJS_VERSION: ${{ inputs.nodeJsVersion || '20' }} | ||
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '13.29.1' }} | ||
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.2.0' }} | ||
FDC_FIREBASE_TOOLS_DIR: /tmp/firebase-tools | ||
FDC_FIREBASE_COMMAND: /tmp/firebase-tools/node_modules/.bin/firebase | ||
FDC_PYTHON_VERSION: ${{ inputs.pythonVersion || '3.13' }} | ||
|
@@ -76,7 +76,6 @@ jobs: | |
npm install --fund=false --audit=false --save --save-exact firebase-tools@${{ env.FDC_FIREBASE_TOOLS_VERSION }} | ||
|
||
- name: Restore Gradle Cache | ||
id: restore-gradle-cache | ||
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # 4.2.2 | ||
if: github.event_name != 'schedule' | ||
with: | ||
|
@@ -172,43 +171,28 @@ jobs: | |
~/.android/adb* | ||
key: avd-cache-zhdsn586je-api${{ env.FDC_ANDROID_EMULATOR_API_LEVEL }}-${{ github.run_id }} | ||
|
||
- name: Data Connect Emulator Start | ||
id: data-connect-emulator | ||
- name: Start Firebase Emulators | ||
run: | | ||
set -euo pipefail | ||
set -xv | ||
|
||
echo 'emulator.postgresConnectionUrl=postgresql://postgres:[email protected]:5432?sslmode=disable' > firebase-dataconnect/dataconnect.local.properties | ||
|
||
./gradlew \ | ||
${{ (inputs.gradleInfoLog && '--info') || '' }} \ | ||
:firebase-dataconnect:connectors:runDebugDataConnectEmulator \ | ||
>firebase.emulator.dataconnect.log 2>&1 & | ||
|
||
echo "FIREBASE_DATA_CONNECT_EMULATOR_PID=$!" >> "$GITHUB_ENV" | ||
set -xveuo pipefail | ||
|
||
- name: Firebase Auth Emulator Start | ||
id: firebase-auth-emulator | ||
run: | | ||
set -euo pipefail | ||
set -xv | ||
# Use the same dataconnect binary as was used for code generation in gradle assemble | ||
DATACONNECT_EMULATOR_BINARY_PATH="$(find "$PWD"/firebase-dataconnect/connectors/build/intermediates/dataconnect/debug/executable -type f)" | ||
if [[ -z $DATACONNECT_EMULATOR_BINARY_PATH ]] ; then | ||
echo "INTERNAL ERROR v7kg2dfhbc: unable to find data connect binary" >&2 | ||
dconeybe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
exit 1 | ||
fi | ||
export DATACONNECT_EMULATOR_BINARY_PATH | ||
|
||
export FIREBASE_DATACONNECT_POSTGRESQL_STRING='postgresql://postgres:[email protected]:5432?sslmode=disable' | ||
cd firebase-dataconnect/emulator | ||
${{ env.FDC_FIREBASE_COMMAND }} emulators:start --only=auth >firebase.emulator.auth.log 2>&1 & | ||
${{ env.FDC_FIREBASE_COMMAND }} emulators:start --only=auth,dataconnect >firebase.emulators.log 2>&1 & | ||
|
||
echo "FIREBASE_AUTH_EMULATOR_PID=$!" >> "$GITHUB_ENV" | ||
|
||
- name: Logcat Log Capture Start | ||
id: logcat-capture | ||
- name: Start Logcat Capture | ||
continue-on-error: true | ||
run: | | ||
set -euo pipefail | ||
set -xv | ||
|
||
set -xveuo pipefail | ||
"$ANDROID_HOME/platform-tools/adb" logcat >logcat.log 2>&1 & | ||
|
||
echo "LOGCAT_PID=$!" >> "$GITHUB_ENV" | ||
|
||
- name: Gradle connectedCheck | ||
id: connectedCheck | ||
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d #v2.33.0 | ||
|
@@ -360,7 +344,6 @@ jobs: | |
run: echo '${{ secrets.GITHUB_TOKEN }}' | gh auth login --with-token | ||
|
||
- name: Create Job Results File | ||
id: create-job-results-file | ||
run: | | ||
set -xveuo pipefail | ||
cat >'${{ runner.temp }}/job_results.txt' <<EOF | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.