Skip to content

Commit 9962218

Browse files
authored
Add CI trigger (#15)
1 parent adcf6a7 commit 9962218

File tree

3 files changed

+43
-13
lines changed

3 files changed

+43
-13
lines changed

.github/workflows/_ascend_npu_benchmark.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,18 @@ jobs:
6868
6969
- name: Install system dependencies
7070
run: |
71-
apt update
72-
apt install --no-install-recommends -y \
71+
apt-get update
72+
apt-get install -y \
7373
git gcc g++ make cmake ninja-build curl \
7474
libgl1 libglib2.0-0 libsndfile1
7575
7676
- name: Checkout
7777
uses: actions/checkout@v4
7878

79-
# TODO(shink): Update once PR merged
80-
# https://github.com/pytorch/benchmark/pull/2550
8179
- name: Checkout benchmark
8280
uses: actions/checkout@v4
8381
with:
84-
repository: shink/benchmark
85-
ref: feat/test_bench/continue_on_error
82+
repository: pytorch/benchmark
8683
path: benchmark
8784

8885
- name: Download ${{ inputs.artifact_name }}
@@ -144,19 +141,22 @@ jobs:
144141
id: update-readme
145142
run: |
146143
python .ci/benchmark.py --update-readme --path benchmark/ascend_npu_benchmark.json
147-
if git diff --quiet README.md; then
148-
echo "changed=false" >> $GITHUB_OUTPUT
149-
else
150-
echo "changed=true" >> $GITHUB_OUTPUT
151-
fi
152144
145+
# https://github.com/peter-evans/create-pull-request
153146
- name: Create a pull request for changes to README.md
154147
if: ${{ steps.update-readme.outputs.changed == 'true' }}
155148
uses: peter-evans/create-pull-request@v7
156149
with:
157150
token: ${{ secrets.pr-token }}
151+
base: ${{ github.head_ref }}
152+
committer: 'cosdt-bot <[email protected]>'
153+
author: 'cosdt-bot <[email protected]>'
154+
commit-message: 'Update torchbenchmark report in README.md'
158155
add-paths: README.md
159156
branch: ascend-npu/benchmark
160-
title: "[Ascend NPU] Update torchbenchmark report in README.md"
161-
commit-message: "Update README.md"
157+
title: '[Ascend NPU] Update torchbenchmark report in README.md'
158+
body: |
159+
The torchbenchmark results running on Ascend NPU have changed, I'm updating the report in README.md.
160+
161+
cc: @Yikun @hipudding @FFFrog @Zhenbin-8 @zeshengzong @wjunLu @MengqingCao @shink
162162
reviewers: shink

.github/workflows/ascend_npu_test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ on:
3232
- 'published'
3333
schedule:
3434
- cron: '0 12 * * *'
35+
repository_dispatch:
36+
types: [pytorch-pr-event-redispatch]
3537
workflow_dispatch:
3638
inputs:
3739
runner:
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Handle events from PyTorch
2+
3+
on:
4+
repository_dispatch:
5+
types: [pytorch-pr-event]
6+
7+
jobs:
8+
redispatch-pr-event:
9+
name: Redispatch PyTorch event
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Print PR event payload
16+
run: |
17+
echo "owner: ${{ github.event.client_payload.owner }}"
18+
echo "repo: ${{ github.event.client_payload.repo }}"
19+
echo "event_name: ${{ github.event.client_payload.event_name }}"
20+
echo "pull_request: ${{ toJson(github.event.client_payload.pull_request) }}"
21+
22+
- name: Redispatch PyTorch event
23+
uses: peter-evans/repository-dispatch@v3
24+
with:
25+
token: ${{ secrets.COSDT_BOT_TOKEN }}
26+
repository: ${{ github.repository }}
27+
event-type: pytorch-pr-event-redispatch
28+
client-payload: ${{ toJson(github.event.client_payload) }}

0 commit comments

Comments
 (0)