@@ -145,6 +145,8 @@ jobs:
145
145
needs : [model-tests]
146
146
if : ${{ github.event_name == 'workflow_dispatch' && inputs.commit_report != 'None'}}
147
147
runs-on : ["in-service"]
148
+ outputs :
149
+ pull-request-branch : ${{ steps.push-op-tests.outputs.pull-request-branch }}
148
150
container :
149
151
image : ${{ inputs.docker_tag }}
150
152
credentials :
@@ -154,6 +156,7 @@ jobs:
154
156
--rm -v /dev/hugepages-1G:/dev/hugepages-1G --device /dev/tenstorrent
155
157
-v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }}
156
158
env :
159
+ BRANCH_NAME : ${{ github.head_ref || github.ref_name }}
157
160
PYTHONPATH : ${{ github.workspace }}
158
161
steps :
159
162
- uses : actions/checkout@v4
@@ -166,31 +169,37 @@ jobs:
166
169
merge-multiple : true
167
170
path : metrics/
168
171
169
- - name : Push Autogen Op Tests
172
+ - name : Generate Op Tests
173
+ id : generate-op-tests
170
174
run : |
171
- git config user.name "GitHub Actions"
172
- git config user.email "[email protected] "
173
- git pull
174
-
175
175
rm -rf tests/autogen_op/ # Remove old tests
176
176
python3 tools/generate_input_variation_test_from_models.py
177
177
python3 tools/generate_input_variation_test_from_models.py --merge=True
178
178
if [ "${{ inputs.commit_report }}" == "All" ]; then
179
- git add --all
179
+ echo "commit-glob=." >> $GITHUB_OUTPUT
180
180
elif [ "${{ inputs.commit_report }}" == "Tests" ]; then
181
- git add tests/
181
+ echo "commit-glob= tests/*" >> $GITHUB_OUTPUT
182
182
else
183
+ echo "commit-glob=nothing" >> $GITHUB_OUTPUT
183
184
echo "No files will be committed"
184
- exit 0
185
- fi
186
- if git diff --cached --quiet; then
187
- echo "No changes to commit"
188
- exit 0
189
- else
190
- git commit -m '[auto][on-merge-queue] Update input variations tests'
191
- git push
192
185
fi
193
186
187
+ - name : Push Autogen Op Tests
188
+ uses : peter-evans/create-pull-request@v7
189
+ id : push-op-tests
190
+ if : ${{ steps.generate-op-tests.outputs.commit-glob != 'nothing' }}
191
+ with :
192
+ branch : ${{ env.BRANCH_NAME }}
193
+ committer : github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
194
+ author : ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
195
+ base : main
196
+ commit-message : " [auto][on-merge-queue] Update input variations tests"
197
+ title : " Update PT2.0 Documentation"
198
+ body : " This PR updates Documentation by rerunning autogenerated tests"
199
+ delete-branch : true
200
+ token : ${{ secrets.GH_TOKEN }}
201
+ add-paths : ${{ steps.generate-op-tests.outputs.commit-glob }}
202
+
194
203
model-autogen-op-tests :
195
204
needs : [push-autogen-op-tests, count-test-files]
196
205
if : ${{ github.event_name == 'workflow_dispatch' && inputs.commit_report != 'None'}}
@@ -216,7 +225,6 @@ jobs:
216
225
- name : Run Model Input Variations Tests
217
226
run : |
218
227
set +e
219
- git pull
220
228
rm -rf tests/autogen_op/ALL
221
229
python3 -m pytest --github-report tests/autogen_op --splits ${{ needs.count-test-files.outputs.num_files }} --group ${{ matrix.group }} -s
222
230
exit_code=$? # Capture the exit code, but ignore any errors for now.
@@ -277,7 +285,7 @@ jobs:
277
285
path : metrics-autogen-op/
278
286
279
287
collect-metrics :
280
- needs : [model-autogen-op-tests]
288
+ needs : [model-autogen-op-tests, push-autogen-op-tests ]
281
289
if : ${{ github.event_name == 'workflow_dispatch' && inputs.commit_report != 'None'}}
282
290
runs-on : ["in-service"]
283
291
container :
@@ -289,6 +297,7 @@ jobs:
289
297
--rm -v /dev/hugepages-1G:/dev/hugepages-1G --device /dev/tenstorrent
290
298
-v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }}
291
299
env :
300
+ BRANCH_NAME : ${{ github.head_ref || github.ref_name }}
292
301
PYTHONPATH : ${{ github.workspace }}
293
302
steps :
294
303
- uses : actions/checkout@v4
@@ -321,30 +330,38 @@ jobs:
321
330
# done
322
331
323
332
- name : Collect Metrics Report
333
+ id : collect-metrics
324
334
run : |
325
335
python3 tools/collect_metrics.py
326
- git config user.name "GitHub Actions"
327
- git config user.email "[email protected] "
328
- git pull
329
336
330
- if [ "${{ inputs.commit_report }}" == "All" ]; then
331
- git add --all
332
- elif [ "${{ inputs.commit_report }}" == "Docs" ]; then
333
- git add README.md
334
- git add docs/
337
+ if [ "${{ inputs.commit_report }}" = "All" ]; then
338
+ echo "commit-glob=." >> $GITHUB_OUTPUT
339
+ elif [ "${{ inputs.commit_report }}" = "Docs" ]; then
340
+ echo "commit-glob=README.md,docs/*" >> $GITHUB_OUTPUT
335
341
else
342
+ echo "commit-glob=nothing" >> $GITHUB_OUTPUT
336
343
echo "No files will be committed"
337
344
exit 0
338
345
fi
339
346
340
- if git diff --cached --quiet; then
341
- echo "No changes to commit"
342
- exit 0
343
- else
344
- git commit -m '[auto][on-merge-queue] Update metrics report in README.md'
345
- git push
346
- fi
347
-
347
+ - name : Push Metrics Report
348
+ uses : peter-evans/create-pull-request@v7
349
+ id : push-metrics-report
350
+ if : ${{ steps.collect-metrics.outputs.commit-glob != 'nothing' }}
351
+ with :
352
+ branch : ${{ env.BRANCH_NAME }}
353
+ committer : github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
354
+ author : ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
355
+ base : main
356
+ commit-message : " [auto][on-merge-queue] Update metrics report in README.md"
357
+ title : " Update PT2.0 Documentation"
358
+ body : " This PR updates Documentation by rerunning autogenerated tests"
359
+ delete-branch : true
360
+ token : ${{ secrets.GH_TOKEN }}
361
+ add-paths : ${{ steps.collect-metrics.outputs.commit-glob }}
362
+
363
+ - name : Send To Data Team
364
+ run : |
348
365
python3 tools/send_to_data_team.py \
349
366
--github_workflow_id ${{ github.run_id }} \
350
367
--sftp_host ${{ secrets.SFTP_OPTEST_HOST }} \
0 commit comments