@@ -327,6 +327,15 @@ jobs:
327
327
working-directory : firebase-dataconnect/ci
328
328
run : pyright --warnings --stats
329
329
330
+ # The "send-notifications" job adds a comment to GitHub Issue
331
+ # https://github.com/firebase/firebase-android-sdk/issues/6857 with the results of the scheduled
332
+ # nightly runs. Interested parties can then subscribe to that issue to be aprised of the outcome
333
+ # of the nightly runs.
334
+ #
335
+ # When testing the comment-adding logic itself, you can add the line
336
+ # trksmnkncd_notification_issue=6863
337
+ # into the PR's description to instead post a comment to issue #6863, an issue specifically
338
+ # created for testing, avoiding spamming the main issue to which others are subscribed.
330
339
send-notifications :
331
340
needs :
332
341
- ' integration-test'
@@ -343,65 +352,28 @@ jobs:
343
352
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
344
353
with :
345
354
show-progress : false
346
- sparse-checkout : ' firebase-dataconnect/ci/'
347
-
348
- - uses : actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
349
- with :
350
- python-version : ${{ env.FDC_PYTHON_VERSION }}
351
-
352
- - run : pip install -r requirements.txt
353
- working-directory : firebase-dataconnect/ci
354
-
355
- - id : issue-id
356
- name : Determine GitHub Issue For Commenting
357
- working-directory : firebase-dataconnect/ci
358
- env :
359
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
360
- run : |
361
- args=(
362
- python
363
- calculate_github_issue_for_commenting.py
364
- --issue-output-file=github_issue_number.txt
365
- --pr-output-file=github_pr_number.txt
366
- --github-repository='${{ github.repository }}'
367
- --github-ref='${{ github.ref }}'
368
- --github-event-name='${{ github.event_name }}'
369
- --pr-body-github-issue-key=trksmnkncd_notification_issue
370
- --github-issue-for-scheduled-run=6857 # https://github.com/firebase/firebase-android-sdk/issues/6857
371
- )
372
- echo "${args[*]}"
373
- "${args[@]}"
355
+ sparse-checkout : |
356
+ firebase-dataconnect/ci/
357
+ .github/
374
358
375
- set -xv
376
- issue="$(cat github_issue_number.txt)"
377
- echo "issue=$issue" >> "$GITHUB_OUTPUT"
378
- pr="$(cat github_pr_number.txt)"
379
- echo "pr=$pr" >> "$GITHUB_OUTPUT"
359
+ - name : gh auth login
360
+ run : echo '${{ secrets.GITHUB_TOKEN }}' | gh auth login --with-token
380
361
381
- - name : Post Comment on GitHub Issue
382
- if : steps.issue-id.outputs.issue != ''
383
- working-directory : firebase-dataconnect/ci
384
- env :
385
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
362
+ - name : Create Job Results File
363
+ id : create-job-results-file
386
364
run : |
387
- args=(
388
- python
389
- post_comment_for_job_results.py
390
- --github-issue='${{ steps.issue-id.outputs.issue }}'
391
- --github-workflow='${{ github.workflow }}'
392
- --github-repository='${{ github.repository }}'
393
- --github-sha='${{ github.sha }}'
394
- --github-repository-html-url='${{ github.event.repository.html_url }}'
395
- --github-run-id='${{ github.run_id }}'
396
- --github-run-number='${{ github.run_number }}'
397
- --github-run-attempt='${{ github.run_attempt }}'
398
- --triggering-pr='${{ steps.issue-id.outputs.pr }}'
399
- 'integration-test:${{ needs.integration-test.result }}'
400
- 'actionlint-dataconnect-yml:${{ needs.actionlint-dataconnect-yml.result }}'
401
- 'python-ci-unit-tests:${{ needs.python-ci-unit-tests.result }}'
402
- 'python-ci-lint:${{ needs.python-ci-lint.result }}'
403
- 'python-ci-format:${{ needs.python-ci-format.result }}'
404
- 'python-ci-type-check:${{ needs.python-ci-type-check.result }}'
405
- )
406
- echo "${args[*]}"
407
- exec "${args[@]}"
365
+ set -xveuo pipefail
366
+ cat >'${{ runner.temp }}/job_results.txt' <<EOF
367
+ integration-test:${{ needs.integration-test.result }}
368
+ actionlint-dataconnect-yml:${{ needs.actionlint-dataconnect-yml.result }}
369
+ python-ci-unit-tests:${{ needs.python-ci-unit-tests.result }}
370
+ python-ci-lint:${{ needs.python-ci-lint.result }}
371
+ python-ci-format:${{ needs.python-ci-format.result }}
372
+ python-ci-type-check:${{ needs.python-ci-type-check.result }}
373
+ EOF
374
+
375
+ - uses : ./.github/actions/dataconnect-send-notifications
376
+ with :
377
+ python-version : ${{ env.FDC_PYTHON_VERSION }}
378
+ github-issue-for-scheduled-runs : " 6857"
379
+ job-results-file : ${{ runner.temp }}/job_results.txt
0 commit comments