Skip to content

Commit 9d3aaf1

Browse files
committed
fix
1 parent 5a0393a commit 9d3aaf1

2 files changed

Lines changed: 35 additions & 11 deletions

File tree

.github/workflows/check_failed_tests.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ on:
3333
required: false
3434
type: string
3535
default: ''
36-
end_sha:
37-
description: "END_SHA to use for git bisect (bypasses automatic computation from PREV_WORKFLOW_RUN_ID)"
38-
required: false
39-
type: string
40-
default: ''
4136
only_process_job:
4237
description: "Skip find-commits jobs and only run the process job, fetching its artifacts from source_workflow_run_id"
4338
required: false
@@ -70,7 +65,26 @@ jobs:
7065
matrix: ${{ steps.set-matrix.outputs.matrix }}
7166
n_runners: ${{ steps.set-matrix.outputs.n_runners }}
7267
process: ${{ steps.set-matrix.outputs.process }}
68+
end_sha: ${{ steps.get-end-sha.outputs.end_sha }}
7369
steps:
70+
- uses: actions/download-artifact@v8
71+
continue-on-error: true
72+
with:
73+
name: end_sha_override
74+
path: end_sha_override
75+
github-token: ${{ github.token }}
76+
77+
- name: Get END_SHA from artifact
78+
id: get-end-sha
79+
run: |
80+
if [ -f end_sha_override/end_sha.txt ]; then
81+
end_sha=$(cat end_sha_override/end_sha.txt)
82+
echo "end_sha=$end_sha" >> $GITHUB_OUTPUT
83+
echo "Found END_SHA override: $end_sha"
84+
else
85+
echo "No END_SHA override found"
86+
fi
87+
7488
- uses: actions/download-artifact@v8
7589
continue-on-error: true
7690
with:
@@ -234,16 +248,16 @@ jobs:
234248
# (This is why we don't need to specify `workflow_id` which would be fetched automatically in the python script.)
235249
- name: Get `END_SHA` from previous CI runs of the same workflow
236250
working-directory: /transformers/utils
237-
if: ${{ inputs.pr_number == '' && inputs.end_sha == '' }}
251+
if: ${{ inputs.pr_number == '' && needs.setup_check_new_failures.outputs.end_sha == '' }}
238252
env:
239253
ACCESS_TOKEN: ${{ secrets.ACCESS_REPO_INFO_TOKEN }}
240254
WORKFLOW_ID: ${{ steps.get-workflow-id.outputs.workflow_id }}
241255
run: |
242256
echo "END_SHA=$(TOKEN="$ACCESS_TOKEN" python3 -c 'import os; from get_previous_daily_ci import get_last_daily_ci_run_commit; commit=get_last_daily_ci_run_commit(token=os.environ["TOKEN"], workflow_run_id=os.environ["PREV_WORKFLOW_RUN_ID"], workflow_id=os.environ["WORKFLOW_ID"]); print(commit)')" >> $GITHUB_ENV
243257
244-
- name: Set `END_SHA` from input
245-
if: ${{ inputs.end_sha != '' }}
246-
run: echo "END_SHA=${{ inputs.end_sha }}" >> $GITHUB_ENV
258+
- name: Set `END_SHA` from artifact override
259+
if: ${{ needs.setup_check_new_failures.outputs.end_sha != '' }}
260+
run: echo "END_SHA=${{ needs.setup_check_new_failures.outputs.end_sha }}" >> $GITHUB_ENV
247261

248262
# However, for workflow runs triggered by `issue_comment` (for pull requests), we want to check against the
249263
# parent commit (on `main`) of the `merge_commit` (dynamically created by GitHub). In this case, the goal is to

.github/workflows/post_trigger_check_new_failing_tests.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
outputs:
3636
source_workflow_run_id: ${{ steps.resolve.outputs.source_workflow_run_id }}
3737
only_process_job: ${{ steps.resolve.outputs.only_process_job }}
38-
end_sha: ${{ steps.fetch-end-sha.outputs.end_sha }}
3938
docker: ${{ steps.fetch-inputs.outputs.docker }}
4039
job: ${{ steps.fetch-inputs.outputs.job }}
4140
slack_report_channel: ${{ steps.fetch-inputs.outputs.slack_report_channel }}
@@ -203,6 +202,18 @@ jobs:
203202
core.warning('Could not find END_SHA in the "Check failed tests" step env block. END_SHA will be computed automatically.');
204203
}
205204
205+
- name: Upload END_SHA artifact
206+
if: ${{ steps.fetch-end-sha.outputs.end_sha != '' }}
207+
run: |
208+
mkdir end_sha_override
209+
echo "${{ steps.fetch-end-sha.outputs.end_sha }}" > end_sha_override/end_sha.txt
210+
211+
- uses: actions/upload-artifact@v4
212+
if: ${{ steps.fetch-end-sha.outputs.end_sha != '' }}
213+
with:
214+
name: end_sha_override
215+
path: end_sha_override/end_sha.txt
216+
206217
check_new_failures:
207218
name: Check new failures
208219
needs: prepare
@@ -217,6 +228,5 @@ jobs:
217228
pr_number: ${{ needs.prepare.outputs.pr_number }}
218229
max_num_runners: ${{ fromJSON(needs.prepare.outputs.max_num_runners) }}
219230
source_workflow_run_id: ${{ needs.prepare.outputs.source_workflow_run_id }}
220-
end_sha: ${{ needs.prepare.outputs.end_sha }}
221231
only_process_job: ${{ fromJSON(needs.prepare.outputs.only_process_job) }}
222232
secrets: inherit

0 commit comments

Comments
 (0)