Skip to content

Commit 4204c35

Browse files
authored
Improve workflows (#37)
1 parent e8f423a commit 4204c35

File tree

6 files changed

+28
-13
lines changed

6 files changed

+28
-13
lines changed

.github/workflows/_ascend_npu_benchmark.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ jobs:
165165
--output ascend_npu_benchmark.json
166166
167167
- name: Upload the benchmark report file
168-
id: upload-output
168+
id: upload-report
169169
uses: actions/upload-artifact@v4
170170
with:
171171
name: ascend_npu_benchmark.json
@@ -179,7 +179,7 @@ jobs:
179179
python .ci/benchmark.py --write-gh-job-summary --path benchmark/ascend_npu_benchmark.json
180180
181181
- name: Update README.md
182-
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
182+
if: ${{ contains(fromJSON('["push", "schedule", "workflow_dispatch"]'), github.event_name) }}
183183
id: update-readme
184184
run: |
185185
python .ci/benchmark.py --update-readme --path benchmark/ascend_npu_benchmark.json
@@ -207,5 +207,13 @@ jobs:
207207
body: |
208208
The torchbenchmark results running on Ascend NPU have changed, I'm updating the report in README.md.
209209
210+
Please check out the following resources for more information:
211+
212+
- [Workflow run][1]
213+
- [Torchbenchmark report (click to download)][2]
214+
215+
[1]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
216+
[2]: ${{ steps.upload-report.outputs.artifact-url }}
217+
210218
cc: @Yikun @hipudding @FFFrog @Zhenbin-8 @zeshengzong @wjunLu @MengqingCao @shink
211219
reviewers: shink

.github/workflows/_ascend_npu_build_torch.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ jobs:
9898
9999
- name: Upload distribution artifact
100100
id: upload-dist
101-
continue-on-error: true
102101
uses: actions/upload-artifact@v4
103102
with:
104103
name: ${{ steps.list-dist.outputs.dist-name }}

.github/workflows/_ascend_npu_build_torch_npu.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ jobs:
119119
120120
- name: Upload distribution artifact
121121
id: upload-dist
122-
continue-on-error: true
123122
uses: actions/upload-artifact@v4
124123
with:
125124
name: ${{ steps.list-dist.outputs.dist-name }}

.github/workflows/ascend_npu_test.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ on:
7070
description: 'The device selected to run on'
7171

7272
# Only cancel the previous runs when triggered by a pull_request event
73+
#
74+
# TODO: As the doc says, there can be at most one running and one pending job
75+
# in a concurrency group at any time. But we want all workflows to be
76+
# queued, not cancelled. This is a shortcomings of GitHub Actions.
77+
#
78+
# Doc: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#concurrency
79+
# Discussion: https://github.com/orgs/community/discussions/5435
7380
concurrency:
7481
group: ${{ github.workflow }}
7582
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
@@ -130,7 +137,9 @@ jobs:
130137
- prepare
131138
- build-torch
132139
- build
133-
if: ${{ !cancelled() && (success() || (needs.build-torch.result == 'skipped' && needs.build.result == 'success')) }}
140+
if: |
141+
!cancelled() && github.event_name != 'repository_dispatch' &&
142+
(success() || (needs.build-torch.result == 'skipped' && needs.build.result == 'success'))
134143
uses: ./.github/workflows/_ascend_npu_ut.yml
135144
with:
136145
runner: ${{ needs.prepare.outputs.runner }}
@@ -146,7 +155,9 @@ jobs:
146155
- build-torch
147156
- build
148157
- test
149-
if: ${{ !cancelled() && (success() || (needs.build-torch.result == 'skipped' && needs.build.result == 'success')) }}
158+
if: |
159+
!cancelled() && github.event_name != 'repository_dispatch' &&
160+
(success() || (needs.build-torch.result == 'skipped' && needs.build.result == 'success'))
150161
uses: ./.github/workflows/_ascend_npu_benchmark.yml
151162
with:
152163
runner: ${{ needs.prepare.outputs.runner }}

.github/workflows/dispatch-event.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ jobs:
5959
fail-fast: false
6060
max-parallel: 1
6161
matrix:
62-
data: ${{ fromJson(needs.list-pr.outputs.prs) }}
62+
data: ${{ fromJSON(needs.list-pr.outputs.prs) }}
6363
steps:
6464
- name: Dispatch PR events to be out-of-tree test infra
6565
uses: peter-evans/repository-dispatch@v3
6666
with:
6767
token: ${{ secrets.COSDT_BOT_TOKEN }}
6868
repository: cosdt/pytorch-integration-tests
6969
event-type: pytorch-pr-event
70-
client-payload: ${{ toJson(matrix.data) }}
70+
client-payload: ${{ toJSON(matrix.data) }}

.github/workflows/redispatch-event.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,14 @@ jobs:
1313
uses: actions/checkout@v4
1414

1515
- name: Print PR event payload
16+
continue-on-error: true
1617
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) }}"
18+
printf "payload: ${{ toJSON(github.event.client_payload) }}"
2119
2220
- name: Redispatch PyTorch event
2321
uses: peter-evans/repository-dispatch@v3
2422
with:
2523
token: ${{ secrets.COSDT_BOT_TOKEN }}
2624
repository: ${{ github.repository }}
2725
event-type: pytorch-pr-event-redispatch
28-
client-payload: ${{ toJson(github.event.client_payload) }}
26+
client-payload: ${{ toJSON(github.event.client_payload) }}

0 commit comments

Comments
 (0)