@@ -364,13 +364,25 @@ jobs:
364
364
java-version : ${{ env.FDC_JAVA_VERSION }}
365
365
distribution : temurin
366
366
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
+
367
378
- uses : google-github-actions/auth@71f986410dfbc7added4569d411d040a91dc6935 # v2.1.8
368
379
with :
369
380
credentials_json : ${{ secrets.GCP_SERVICE_ACCOUNT }}
370
381
371
382
- uses : google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a # v2.1.4
372
383
373
384
- name : Gradle updateJson
385
+ id : update-json
374
386
run : |
375
387
set -euo pipefail
376
388
set -x
@@ -392,15 +404,19 @@ jobs:
392
404
393
405
if diff DataConnectExecutableVersions.before.json DataConnectExecutableVersions.after.json ; then
394
406
echo "${json_file} is up-to-date"
407
+ echo "diff_result=same" >> "$GITHUB_OUTPUT"
395
408
else
396
409
echo "${json_file} is NOT up-to-date"
397
410
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"
402
412
fi
403
413
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
+
404
420
# The "send-notifications" job adds a comment to GitHub Issue
405
421
# https://github.com/firebase/firebase-android-sdk/issues/6857 with the results of the scheduled
406
422
# nightly runs. Interested parties can then subscribe to that issue to be aprised of the outcome
0 commit comments