-
Notifications
You must be signed in to change notification settings - Fork 641
dataconnect: dataconnect.yml: some minor improvements #6838
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
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
dbd115c
dataconnect.yml: lots of improvements, especially terminating async c…
dconeybe d9b7abf
dataconnect.yml: remove call to adb logcat since it livelocks waiting…
dconeybe 2c9a721
empty commit to trigger github actions
dconeybe ebd6d02
dataconnect.yml: use -eq instead of == when comparing integers
dconeybe 84d1f92
Merge remote-tracking branch 'origin/main' into AdbGithubActionsFix
dconeybe 02beb1e
dataconnect.yml: more robustly kill async processes
dconeybe df34a52
dataconnect.yml: use set -xv instead of manually echoing information
dconeybe 821c9f4
dataconnect.yml: don't bother killing the async processes because it'…
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 |
---|---|---|
|
@@ -64,15 +64,16 @@ jobs: | |
with: | ||
node-version: ${{ env.FDC_NODEJS_VERSION }} | ||
|
||
- name: install firebase-tools | ||
- name: Install Firebase Tools ("firebase" command-line tool) | ||
run: | | ||
set -euo pipefail | ||
set -v | ||
mkdir -p ${{ env.FDC_FIREBASE_TOOLS_DIR }} | ||
cd ${{ env.FDC_FIREBASE_TOOLS_DIR }} | ||
echo '{}' > package.json | ||
npm install --fund=false --audit=false --save --save-exact firebase-tools@${{ env.FDC_FIREBASE_TOOLS_VERSION }} | ||
|
||
- name: Restore Gradle cache | ||
- name: Restore Gradle Cache | ||
id: restore-gradle-cache | ||
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # 4.2.2 | ||
if: github.event_name != 'schedule' | ||
|
@@ -84,9 +85,11 @@ jobs: | |
restore-keys: | | ||
gradle-cache-jqnvfzw6w7- | ||
|
||
- name: tool versions | ||
- name: Print Command-Line Tool Versions | ||
continue-on-error: true | ||
run: | | ||
set -euo pipefail | ||
|
||
function run_cmd { | ||
echo "===============================================================================" | ||
echo "Running Command: $*" | ||
|
@@ -105,6 +108,7 @@ jobs: | |
|
||
- name: Gradle assembleDebugAndroidTest | ||
run: | | ||
set -euo pipefail | ||
set -v | ||
|
||
# Speed up build times and also avoid configuring firebase-crashlytics-ndk | ||
|
@@ -117,7 +121,7 @@ jobs: | |
${{ (inputs.gradleInfoLog && '--info') || '' }} \ | ||
:firebase-dataconnect:assembleDebugAndroidTest | ||
|
||
- name: Save Gradle cache | ||
- name: Save Gradle Cache | ||
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # 4.2.2 | ||
if: github.event_name == 'schedule' | ||
with: | ||
|
@@ -126,14 +130,15 @@ jobs: | |
~/.gradle/wrapper | ||
key: gradle-cache-jqnvfzw6w7-${{ github.run_id }} | ||
|
||
- name: Enable KVM group permissions for Android Emulator | ||
- name: Enable KVM Group Permissions for Android Emulator | ||
run: | | ||
set -euo pipefail | ||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \ | ||
| sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
sudo udevadm control --reload-rules | ||
sudo udevadm trigger --name-match=kvm | ||
|
||
- name: Restore AVD cache | ||
- name: Restore AVD Cache | ||
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # 4.2.2 | ||
if: github.event_name != 'schedule' | ||
id: restore-avd-cache | ||
|
@@ -156,7 +161,7 @@ jobs: | |
disable-animations: true | ||
script: 'echo "Generated AVD snapshot for caching; event_name=${{ github.event_name }}, cache-matched-key=${{ steps.restore-avd-cache.outputs.cache-matched-key }}"' | ||
|
||
- name: Save AVD cache | ||
- name: Save AVD Cache | ||
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # 4.2.2 | ||
if: github.event_name == 'schedule' | ||
with: | ||
|
@@ -165,8 +170,10 @@ jobs: | |
~/.android/adb* | ||
key: avd-cache-zhdsn586je-api${{ env.FDC_ANDROID_EMULATOR_API_LEVEL }}-${{ github.run_id }} | ||
|
||
- name: Data Connect Emulator | ||
- name: Data Connect Emulator Start | ||
id: data-connect-emulator | ||
run: | | ||
set -euo pipefail | ||
set -x | ||
|
||
echo 'emulator.postgresConnectionUrl=postgresql://postgres:[email protected]:5432?sslmode=disable' > firebase-dataconnect/dataconnect.local.properties | ||
|
@@ -175,15 +182,26 @@ jobs: | |
${{ (inputs.gradleInfoLog && '--info') || '' }} \ | ||
:firebase-dataconnect:connectors:runDebugDataConnectEmulator \ | ||
>firebase.emulator.dataconnect.log 2>&1 & | ||
echo "FIREBASE_DATA_CONNECT_EMULATOR_PID=$!" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Firebase Auth Emulator | ||
- name: Firebase Auth Emulator Start | ||
id: firebase-auth-emulator | ||
run: | | ||
set -euo pipefail | ||
set -x | ||
cd firebase-dataconnect/emulator | ||
${{ env.FDC_FIREBASE_COMMAND }} emulators:start --only=auth >firebase.emulator.auth.log 2>&1 & | ||
echo "FIREBASE_AUTH_EMULATOR_PID=$!" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Logcat Log Capture Start | ||
id: logcat-capture | ||
continue-on-error: true | ||
run: | | ||
set -euo pipefail | ||
set -v | ||
|
||
- name: Capture Logcat Logs | ||
run: adb logcat >logcat.log & | ||
"$ANDROID_HOME/platform-tools/adb" logcat >logcat.log & | ||
echo "LOGCAT_PID=$!" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Gradle connectedCheck | ||
id: connectedCheck | ||
|
@@ -201,25 +219,83 @@ jobs: | |
script: | | ||
set -eux && ./gradlew ${{ (inputs.gradleInfoLog && '--info') || '' }} :firebase-dataconnect:connectedCheck :firebase-dataconnect:connectors:connectedCheck | ||
|
||
- name: Upload log file artifacts | ||
- name: Logcat Log Capture Stop | ||
if: steps.logcat-capture.outcome == 'success' | ||
continue-on-error: true | ||
run: | | ||
set -euo pipefail | ||
set -v | ||
|
||
kill -s SIGINT ${{ steps.logcat-capture.outputs.LOGCAT_PID }} | ||
loop_count=0 | ||
while kill -0 ${{ steps.logcat-capture.outputs.LOGCAT_PID }} ; do | ||
loop_count=$((loop_count+1)) | ||
if [[ $loop_count == 60 ]] ; then | ||
echo "ERROR: timeout waiting for logcat process to terminate" >&2 | ||
exit 1 | ||
fi | ||
echo "Waiting for logcat process to terminate" | ||
sleep 1 | ||
done | ||
|
||
- name: Firebase Auth Emulator Stop | ||
continue-on-error: true | ||
run: | | ||
set -euo pipefail | ||
set -v | ||
|
||
kill -s SIGINT ${{ steps.firebase-auth-emulator.outputs.FIREBASE_AUTH_EMULATOR_PID }} | ||
|
||
loop_count=0 | ||
while kill -0 ${{ steps.firebase-auth-emulator.outputs.FIREBASE_AUTH_EMULATOR_PID }} ; do | ||
loop_count=$((loop_count+1)) | ||
if [[ $loop_count == 60 ]] ; then | ||
echo "ERROR: timeout waiting for Firebase Auth Emulator process to terminate" >&2 | ||
exit 1 | ||
fi | ||
echo "Waiting for Firebase Auth Emulator process to terminate" | ||
sleep 1 | ||
done | ||
|
||
- name: Data Connect Emulator Stop | ||
continue-on-error: true | ||
run: | | ||
set -euo pipefail | ||
set -v | ||
|
||
kill -s SIGINT ${{ steps.data-connect-emulator.outputs.FIREBASE_DATA_CONNECT_EMULATOR_PID }} | ||
|
||
loop_count=0 | ||
while kill -0 ${{ steps.data-connect-emulator.outputs.FIREBASE_DATA_CONNECT_EMULATOR_PID }} ; do | ||
loop_count=$((loop_count+1)) | ||
if [[ $loop_count == 60 ]] ; then | ||
echo "ERROR: timeout waiting for Firebase Data Connect Emulator process to terminate" >&2 | ||
exit 1 | ||
fi | ||
echo "Waiting for Firebase Data Connect Emulator process to terminate" | ||
sleep 1 | ||
done | ||
|
||
- name: Upload Log Files | ||
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 | ||
with: | ||
name: integration_test_logs | ||
path: "**/*.log" | ||
if-no-files-found: warn | ||
compression-level: 9 | ||
|
||
- name: Upload Gradle build report artifacts | ||
- name: Upload Gradle Build Reports | ||
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 | ||
with: | ||
name: integration_test_gradle_build_reports | ||
path: firebase-dataconnect/**/build/reports/ | ||
if-no-files-found: warn | ||
compression-level: 9 | ||
|
||
- name: Verify "Gradle connectedCheck" step was successful | ||
- name: Verify "Gradle connectedCheck" Step Was Successful | ||
if: steps.connectedCheck.outcome != 'success' | ||
run: | | ||
set -euo pipefail | ||
echo 'Failing because the outcome of the "Gradle connectedCheck" step ("${{ steps.connectedCheck.outcome }}") was not successful' | ||
exit 1 | ||
|
||
|
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.