Skip to content

Commit a18af72

Browse files
committed
dataconnect.yml: use the composite action
1 parent 7f73aaf commit a18af72

File tree

2 files changed

+41
-60
lines changed

2 files changed

+41
-60
lines changed

.github/workflows/dataconnect.yml

Lines changed: 31 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,15 @@ jobs:
327327
working-directory: firebase-dataconnect/ci
328328
run: pyright --warnings --stats
329329

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.
330339
send-notifications:
331340
needs:
332341
- 'integration-test'
@@ -343,65 +352,28 @@ jobs:
343352
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
344353
with:
345354
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/
374358
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
380361

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
386364
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

.github/workflows/dataconnect_demo_app.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,15 @@ jobs:
167167
${{ (inputs.gradleInfoLog && '--info') || '' }} \
168168
spotlessCheck
169169
170+
# The "send-notifications" job adds a comment to GitHub Issue
171+
# https://github.com/firebase/firebase-android-sdk/issues/6891 with the results of the scheduled
172+
# nightly runs. Interested parties can then subscribe to that issue to be aprised of the outcome
173+
# of the nightly runs.
174+
#
175+
# When testing the comment-adding logic itself, you can add the line
176+
# trksmnkncd_notification_issue=6863
177+
# into the PR's description to instead post a comment to issue #6863, an issue specifically
178+
# created for testing, avoiding spamming the main issue to which others are subscribed.
170179
send-notifications:
171180
needs:
172181
- 'test'
@@ -181,7 +190,7 @@ jobs:
181190
show-progress: false
182191
sparse-checkout: |
183192
firebase-dataconnect/ci/
184-
.github/actions/dataconnect-send-notifications/
193+
.github/
185194
186195
- name: gh auth login
187196
run: echo '${{ secrets.GITHUB_TOKEN }}' | gh auth login --with-token

0 commit comments

Comments
 (0)