@@ -47,7 +47,38 @@ concurrency:
4747 queue : max
4848
4949jobs :
50+ # The run owns its own status comment: it is the only party that knows when
51+ # execution starts, how long it takes, and how it ends. Announcing here
52+ # (rather than from the gateway's reply) also covers direct dispatches.
53+ announce-file-run :
54+ runs-on : ubuntu-latest
55+ timeout-minutes : 5
56+ outputs :
57+ comment_id : ${{ steps.announce.outputs.comment_id }}
58+ permissions :
59+ contents : read
60+ issues : write
61+ pull-requests : write
62+ steps :
63+ - name : Check out the trusted reporter
64+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
65+ with :
66+ persist-credentials : false
67+ sparse-checkout : .github/workflows/scripts/comment_ci_command.py
68+ sparse-checkout-cone-mode : false
69+
70+ - name : Announce the file run on its pull request
71+ id : announce
72+ env :
73+ CI_COMMAND_API_TOKEN : ${{ github.token }}
74+ CI_COMMAND_FILE_RUN_STATUS : announce
75+ FILE_RUN_PULL_NUMBER : ${{ inputs.pull_number }}
76+ FILE_RUN_TEST_FILE : ${{ inputs.test_file }}
77+ FILE_RUN_RUN_ID : ${{ github.run_id }}
78+ run : python3 .github/workflows/scripts/comment_ci_command.py
79+
5080 resolve-file-run :
81+ needs : announce-file-run
5182 runs-on : ubuntu-latest
5283 timeout-minutes : 10
5384 outputs :
@@ -134,3 +165,37 @@ jobs:
134165 pytest '${{ inputs.test_file }}' -v -x
135166 secrets :
136167 HF_TOKEN : ${{ needs.resolve-file-run.outputs.head_is_fork != 'true' && secrets.HF_TOKEN || '' }}
168+
169+ # No `if` beyond always(): a resolver failure, a cancelled run, and a failing
170+ # test must all reach the pull request, or a silent run reads as a pass.
171+ report-file-run :
172+ needs : [announce-file-run, resolve-file-run, run-cuda-file, run-cpu-file]
173+ if : always()
174+ permissions :
175+ actions : read
176+ contents : read
177+ issues : write
178+ pull-requests : write
179+ runs-on : ubuntu-latest
180+ timeout-minutes : 5
181+ steps :
182+ - name : Check out the trusted reporter
183+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
184+ with :
185+ persist-credentials : false
186+ sparse-checkout : .github/workflows/scripts/comment_ci_command.py
187+ sparse-checkout-cone-mode : false
188+
189+ - name : Report the file run's result on its pull request
190+ env :
191+ CI_COMMAND_API_TOKEN : ${{ github.token }}
192+ CI_COMMAND_FILE_RUN_STATUS : report
193+ FILE_RUN_COMMENT_ID : ${{ needs.announce-file-run.outputs.comment_id }}
194+ FILE_RUN_PULL_NUMBER : ${{ inputs.pull_number }}
195+ FILE_RUN_TEST_FILE : ${{ inputs.test_file }}
196+ FILE_RUN_RUN_ID : ${{ github.run_id }}
197+ FILE_RUN_SUITE : ${{ needs.resolve-file-run.outputs.suite }}
198+ FILE_RUN_RESOLVE_RESULT : ${{ needs.resolve-file-run.result }}
199+ FILE_RUN_CUDA_RESULT : ${{ needs.run-cuda-file.result }}
200+ FILE_RUN_CPU_RESULT : ${{ needs.run-cpu-file.result }}
201+ run : python3 .github/workflows/scripts/comment_ci_command.py
0 commit comments