Skip to content

Commit 980b11c

Browse files
committed
yml cleanup
1 parent 93498e8 commit 980b11c

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

.github/workflows/dataconnect.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,25 @@ jobs:
364364
java-version: ${{ env.FDC_JAVA_VERSION }}
365365
distribution: temurin
366366

367+
- name: Restore Gradle Cache
368+
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # 4.2.2
369+
if: github.event_name != 'schedule'
370+
with:
371+
path: |
372+
~/.gradle/caches
373+
~/.gradle/wrapper
374+
key: gradle-cache-jqnvfzw6w7-${{ github.run_id }}
375+
restore-keys: |
376+
gradle-cache-jqnvfzw6w7-
377+
367378
- uses: google-github-actions/auth@71f986410dfbc7added4569d411d040a91dc6935 # v2.1.8
368379
with:
369380
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT }}
370381

371382
- uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a # v2.1.4
372383

373384
- name: Gradle updateJson
385+
id: update-json
374386
run: |
375387
set -euo pipefail
376388
set -x
@@ -392,15 +404,19 @@ jobs:
392404
393405
if diff DataConnectExecutableVersions.before.json DataConnectExecutableVersions.after.json ; then
394406
echo "${json_file} is up-to-date"
407+
echo "diff_result=same" >> "$GITHUB_OUTPUT"
395408
else
396409
echo "${json_file} is NOT up-to-date"
397410
echo "To update it, run: ./gradlew :firebase-dataconnect:updateJson"
398-
if [[ '${{ github.event_name }}' == 'schedule' ]] ; then
399-
echo "FAILING STEP BECAUSE github.event_name==schedule and JSON file is not up-to-date" >&2
400-
exit 1
401-
fi
411+
echo "diff_result=different" >> "$GITHUB_OUTPUT"
402412
fi
403413
414+
- name: "Fail if DataConnectExecutableVersions.json is not up-to-date during scheduled runs"
415+
if: github.event_name == 'schedule' && steps.update-json.outputs.diff_result != 'same'
416+
run: |
417+
echo "Force-failing because DataConnectExecutableVersions.json is NOT up-to-date" >&2
418+
exit 1
419+
404420
# The "send-notifications" job adds a comment to GitHub Issue
405421
# https://github.com/firebase/firebase-android-sdk/issues/6857 with the results of the scheduled
406422
# nightly runs. Interested parties can then subscribe to that issue to be aprised of the outcome

0 commit comments

Comments
 (0)