Skip to content

Commit f9ae3e9

Browse files
committed
replace update_issue_comment with dedicated workflow steps
1 parent 90be961 commit f9ae3e9

5 files changed

Lines changed: 24 additions & 209 deletions

File tree

.github/workflows/torch_mlir_coverage.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,17 @@ jobs:
4444
name: failure-logs
4545
path: scripts/torch_ci/failure_logs/
4646

47-
- name: Update Issue Comment
48-
env:
49-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50-
run: |
51-
python scripts/torch_ci/update_issue_comment.py coverage_table.md
47+
- name: Find Coverage Comment
48+
id: fc
49+
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad
50+
with:
51+
issue-number: 2923
52+
body-includes: '<!-- TORCH_COVERAGE_TABLE -->'
53+
54+
- name: Create or Update Coverage Comment
55+
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9
56+
with:
57+
comment-id: ${{ steps.fc.outputs.comment-id }}
58+
issue-number: 2923
59+
body-path: coverage_table.md
60+
edit-mode: replace

scripts/torch_ci/BUILD

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,3 @@ py_test(
1818
":entrypoint_lib",
1919
],
2020
)
21-
22-
py_library(
23-
name = "update_issue_comment_lib",
24-
srcs = ["update_issue_comment.py"],
25-
)
26-
27-
py_test(
28-
name = "test_update_issue_comment",
29-
srcs = ["test_update_issue_comment.py"],
30-
deps = [
31-
":update_issue_comment_lib",
32-
],
33-
)

scripts/torch_ci/entrypoint.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def run_all(self):
6868
models = self.find_models()
6969
results = {}
7070
for model in sorted(models):
71-
print(f"Running coverage for {model}...")
71+
print(f"Running coverage for {model}...", file=sys.stderr)
7272
export_result = self.run_export(model)
7373
if export_result.returncode != 0:
7474
results[model] = ("FAIL (Export)", export_result.stderr)
@@ -77,7 +77,13 @@ def run_all(self):
7777

7878
heir_opt_result = self.run_heir_opt(model)
7979
if heir_opt_result is None:
80-
results[model] = ("FAIL (No MLIR)", "model.mlir not found")
80+
results[model] = (
81+
"FAIL (No MLIR)",
82+
"torch-mlir failed to produce model.mlir",
83+
)
84+
self.save_failure_log(
85+
model, "heir-opt", "torch-mlir failed to produce model.mlir"
86+
)
8187
continue
8288

8389
if heir_opt_result.returncode != 0:
@@ -96,7 +102,8 @@ def save_failure_log(self, model_name, stage, content):
96102
f.write(content)
97103

98104
def format_results_table(self, results):
99-
table = "| Operator | Status | Details |\n"
105+
table = "<!-- TORCH_COVERAGE_TABLE -->\n\n"
106+
table += "| Operator | Status | Details |\n"
100107
table += "| --- | --- | --- |\n"
101108
for model, (status, details) in results.items():
102109
details_str = details.replace("\n", " ")[:100] if details else ""

scripts/torch_ci/test_update_issue_comment.py

Lines changed: 0 additions & 78 deletions
This file was deleted.

scripts/torch_ci/update_issue_comment.py

Lines changed: 0 additions & 110 deletions
This file was deleted.

0 commit comments

Comments
 (0)