Skip to content

Commit 5dddd0f

Browse files
committed
update
1 parent f8dc3a8 commit 5dddd0f

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

.github/workflows/_ascend_npu_build_torch.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
required: true
1212
type: string
1313
description: 'The docker image which will be used to build'
14+
pr-number:
15+
required: false
16+
type: number
17+
description: 'The number of pull request'
1418
ref:
1519
required: false
1620
type: string
@@ -30,7 +34,7 @@ defaults:
3034

3135
jobs:
3236
build:
33-
name: build torch
37+
name: build torch for ${{ inputs.pr-number && format('#{0}', inputs.pr-numer) || inputs.ref }}
3438
runs-on: ${{ inputs.runner }}
3539
container:
3640
image: ${{ inputs.image }}

.github/workflows/ascend_npu_test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ on:
6969
default: '/dev/davinci5'
7070
description: 'The device selected to run on'
7171

72-
# Only cancel the previous runs when triggered by a pull_request event or a repository_dispatch event
72+
# Only cancel the previous runs when triggered by a pull_request event
7373
concurrency:
7474
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
75-
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'repository_dispatch' }}
75+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
7676

7777
jobs:
7878
prepare:
@@ -96,6 +96,7 @@ jobs:
9696
id: list-ref
9797
if: ${{ github.event_name == 'repository_dispatch' }}
9898
run: |
99+
echo "pr_number=${{ github.event.client_payload.pull_request.number }}" >> $GITHUB_OUTPUT
99100
echo "ref=refs/pull/${{ github.event.client_payload.pull_request.number }}/merge" >> $GITHUB_OUTPUT
100101
101102
build-torch:
@@ -108,6 +109,7 @@ jobs:
108109
runner: ${{ needs.prepare.outputs.runner }}
109110
image: ${{ needs.prepare.outputs.image }}
110111
ref: ${{ needs.prepare.outputs.ref }}
112+
pr-number: ${{ needs.prepare.outputs.pr-number }}
111113

112114
build:
113115
name: Build torch_npu

.github/workflows/dispatch-event.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
name: 'Dispatch PR events'
22

33
on:
4-
pull_request:
5-
branches:
6-
- 'main'
7-
paths:
8-
- '.github/workflows/per-pr.yml'
9-
- '.github/actions/list-pr/**'
10-
- '!**/*.md'
114
schedule:
125
- cron: '0 12 * * *'
136

7+
workflow_dispatch:
8+
inputs:
9+
labels:
10+
required: false
11+
type: string
12+
default: ''
13+
description: 'The labels on pull requests'
14+
hours:
15+
required: false
16+
type: number
17+
default: 24
18+
description: 'Pull requests created within this many hours will be listed'
19+
1420
concurrency:
1521
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
1622
cancel-in-progress: true
@@ -33,7 +39,8 @@ jobs:
3339
token: ${{ secrets.COSDT_BOT_TOKEN }}
3440
owner: pytorch
3541
repository: pytorch
36-
hours: 24
42+
labels: ${{ github.event.inputs.labels || '' }}
43+
hours: ${{ github.event.inputs.hours || '24' }}
3744

3845
dispatch-pr:
3946
name: 'Dispatch PR event - #${{ matrix.data.pull_request.number }}'

0 commit comments

Comments
 (0)