File tree Expand file tree Collapse file tree 3 files changed +24
-11
lines changed Expand file tree Collapse file tree 3 files changed +24
-11
lines changed Original file line number Diff line number Diff line change 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
3135jobs :
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 }}
Original file line number Diff line number Diff line change 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
7373concurrency :
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
7777jobs :
7878 prepare :
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
Original file line number Diff line number Diff line change 11name : ' Dispatch PR events'
22
33on :
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+
1420concurrency :
1521 group : ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
1622 cancel-in-progress : true
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 }}'
You can’t perform that action at this time.
0 commit comments