Skip to content

Commit 9deca78

Browse files
committed
update
1 parent 13fab09 commit 9deca78

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: '_pytorch_pr_comment'
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
repository:
7+
required: false
8+
type: string
9+
default: 'pytorch/pytorch'
10+
description: 'The full name of the repository containing the pull request'
11+
pr-number:
12+
required: true
13+
type: number
14+
description: 'The number of the pull request'
15+
pr-comment-author:
16+
required: true
17+
type: string
18+
description: 'The author of the pull request comment'
19+
secrets:
20+
pr-token:
21+
required: true
22+
description: 'A token used to create or update a pull request comment'
23+
24+
jobs:
25+
comment:
26+
name: Create or update the pull request comment
27+
runs-on: ubuntu-latest
28+
steps:
29+
# Find the first comment containing the specified string
30+
# and by the specified author.
31+
# See: https://github.com/peter-evans/find-comment
32+
- name: Find comment
33+
uses: peter-evans/find-comment@v3
34+
id: fc
35+
with:
36+
token: ${{ secrets.pr-token }}
37+
repository: ${{ inputs.repository }}
38+
issue-number: ${{ inputs.pr-number }}
39+
comment-author: ${{ inputs.pr-comment-author }}
40+
body-includes: '<!-- ACCELERATOR TESTINFRA START -->'
41+
direction: first
42+
43+
- name: Show comment info
44+
run: |
45+
echo "comment id: ${{ steps.fc.outputs.comment-id }}"
46+
echo "comment node id: ${{ steps.fc.outputs.comment-node-id }}"
47+
echo "comment body: ${{ steps.fc.outputs.comment-body }}"
48+
echo "comment author: ${{ steps.fc.outputs.comment-author }}"
49+
echo "comment created at: ${{ steps.fc.outputs.comment-created-at }}"
50+
51+
# Create or update the comment just found.
52+
# See: https://github.com/peter-evans/create-or-update-comment
53+
- name: Create or update comment
54+
uses: peter-evans/create-or-update-comment@v4
55+
with:
56+
token: ${{ secrets.pr-token }}
57+
repository: ${{ inputs.repository }}
58+
issue-number: ${{ inputs.pr-number }}
59+
comment-id: ${{ steps.fc.outputs.comment-id }}
60+
edit-mode: replace
61+
# TODO: use body-path instead
62+
body: |
63+
<!-- ACCELERATOR TESTINFRA START -->
64+
65+
## Report
66+
67+
- something
68+
- something else
69+
70+
<!-- ACCELERATOR TESTINFRA START -->

.github/workflows/ascend_npu_test.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ jobs:
105105
needs:
106106
- prepare
107107
- build
108+
if: ${{ github.event_name == 'repository_dispatch' }}
108109
uses: ./.github/workflows/_ascend_npu_ut.yml
109110
with:
110111
runner: ${{ needs.prepare.outputs.runner }}
@@ -118,6 +119,7 @@ jobs:
118119
- prepare
119120
- build
120121
- test
122+
if: ${{ github.event_name == 'repository_dispatch' }}
121123
uses: ./.github/workflows/_ascend_npu_benchmark.yml
122124
with:
123125
runner: ${{ needs.prepare.outputs.runner }}
@@ -126,3 +128,16 @@ jobs:
126128
artifact_name: ${{ needs.build.outputs.artifact_name }}
127129
secrets:
128130
pr-token: ${{ secrets.COSDT_BOT_TOKEN }}
131+
132+
pr-comment:
133+
name: Run benchmarks
134+
needs:
135+
- prepare
136+
# if: ${{ github.event_name == 'repository_dispatch' }}
137+
uses: ./.github/workflows/_pytorch_pr_comment.yml
138+
with:
139+
repository: cosdt/pytorch-upstream
140+
pr-number: 1
141+
pr-comment-author: cosdt
142+
secrets:
143+
pr-token: ${{ secrets.COSDT_BOT_TOKEN }}

0 commit comments

Comments
 (0)