Skip to content

Commit 394eaa7

Browse files
committed
dataconnect.yml fixup
1 parent d8f4eff commit 394eaa7

File tree

1 file changed

+49
-33
lines changed

1 file changed

+49
-33
lines changed

.github/workflows/dataconnect.yml

Lines changed: 49 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,11 @@ jobs:
100100

101101
- name: Enable KVM Group Permissions for Android Emulator
102102
run: |
103-
./firebase-dataconnect/ci.zsh \
104-
kvm_setup
103+
set -euo pipefail
104+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
105+
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
106+
sudo udevadm control --reload-rules
107+
sudo udevadm trigger --name-match=kvm
105108
106109
- name: Restore AVD Cache
107110
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # 4.2.2
@@ -135,23 +138,42 @@ jobs:
135138
~/.android/adb*
136139
key: avd-cache-zhdsn586je-api${{ env.FDC_ANDROID_EMULATOR_API_LEVEL }}-${{ github.run_id }}
137140

138-
- name: Start Firebase Emulators
141+
- name: Data Connect Emulator Start
142+
id: data-connect-emulator
139143
run: |
140-
./firebase-dataconnect/ci.zsh \
141-
start_firebase_emulators \
142-
-firebase_command '${{ env.FDC_FIREBASE_COMMAND }}' \
143-
-postgres_connection_url 'postgresql://postgres:[email protected]:5432?sslmode=disable' \
144-
-log_file firebase.emulators.log \
145-
-enable_debug_logs ${{ runner.debug || '0' }}
144+
set -euo pipefail
145+
set -xv
146+
147+
echo 'emulator.postgresConnectionUrl=postgresql://postgres:[email protected]:5432?sslmode=disable' > firebase-dataconnect/dataconnect.local.properties
148+
149+
./gradlew \
150+
${{ (inputs.gradleInfoLog && '--info') || '' }} \
151+
:firebase-dataconnect:connectors:runDebugDataConnectEmulator \
152+
>firebase.emulator.dataconnect.log 2>&1 &
153+
154+
echo "FIREBASE_DATA_CONNECT_EMULATOR_PID=$!" >> "$GITHUB_ENV"
155+
156+
- name: Firebase Auth Emulator Start
157+
id: firebase-auth-emulator
158+
run: |
159+
set -euo pipefail
160+
set -xv
161+
162+
cd firebase-dataconnect/emulator
163+
${{ env.FDC_FIREBASE_COMMAND }} emulators:start --only=auth >firebase.emulator.auth.log 2>&1 &
164+
165+
echo "FIREBASE_AUTH_EMULATOR_PID=$!" >> "$GITHUB_ENV"
146166
147167
- name: Logcat Log Capture Start
148168
id: logcat-capture
149169
continue-on-error: true
150170
run: |
151-
./firebase-dataconnect/ci.zsh \
152-
start_logcat_capture \
153-
-adb_command "$ANDROID_HOME/platform-tools/adb" \
154-
-log_file logcat.log
171+
set -euo pipefail
172+
set -xv
173+
174+
"$ANDROID_HOME/platform-tools/adb" logcat >logcat.log 2>&1 &
175+
176+
echo "LOGCAT_PID=$!" >> "$GITHUB_ENV"
155177
156178
- name: Gradle connectedCheck
157179
id: connectedCheck
@@ -185,10 +207,11 @@ jobs:
185207
compression-level: 9
186208

187209
- name: Verify "Gradle connectedCheck" Step Was Successful
210+
if: steps.connectedCheck.outcome != 'success'
188211
run: |
189-
./firebase-dataconnect/ci.zsh \
190-
verify_connected_check_success \
191-
-connected_check_step_outcome '${{ steps.connectedCheck.outcome }}'
212+
set -euo pipefail
213+
echo 'Failing because the outcome of the "Gradle connectedCheck" step ("${{ steps.connectedCheck.outcome }}") was not successful'
214+
exit 1
192215
193216
# Check this yml file with "actionlint": https://github.com/rhysd/actionlint
194217
# To run actionlint yourself, run `brew install actionlint` followed by
@@ -212,17 +235,12 @@ jobs:
212235
issues: write
213236
runs-on: ubuntu-latest
214237
steps:
215-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
216-
with:
217-
show-progress: false
218-
sparse-checkout: 'firebase-dataconnect/ci.zsh'
219-
220238
- name: Post Comment on Issue
221239
#if: github.event_name == 'schedule'
222240
env:
223241
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
224242
run: |
225-
set -eu
243+
set -euo pipefail
226244
227245
if [[ '${{ github.event_name }}' == 'schedule' ]] ; then
228246
readonly github_notification_issue=6857
@@ -231,14 +249,12 @@ jobs:
231249
readonly github_notification_issue=6863
232250
fi
233251
234-
./firebase-dataconnect/ci.zsh \
235-
send_notifications \
236-
-github_notification_issue $github_notification_issue \
237-
-github_workflow_name '${{ github.workflow }}' \
238-
-github_repository '${{ github.repository }}' \
239-
-job_status '${{ job.status }}' \
240-
-git_commit_hash '${{ github.sha }}' \
241-
-run_url '${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}' \
242-
-run_id '${{ github.run_id }}' \
243-
-run_number '${{ github.run_number }}' \
244-
-run_attempt '${{ github.run_attempt }}'
252+
cat >message.txt <<EOF
253+
Result of workflow ${{ github.workflow }} at ${{ github.ref }}: ${{ job.status }}
254+
${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}
255+
job=${{ github.job }} run_id=${{ github.run_id }} run_number=${{ github.run_number }} run_attempt=${{ github.run_attempt }}
256+
EOF
257+
258+
echo "Posting comment on GitHub Issue: https://github.com/firebase/firebase-android-sdk/issues/$github_notification_issue:"
259+
cat message.txt
260+
gh issue comment $github_notification_issue --body-file message.txt -R ${{ github.repository }}

0 commit comments

Comments
 (0)