Skip to content

Commit 3378710

Browse files
kliao-csapull[bot]
authored andcommitted
Workflow fail summary - artifact creation (#28737)
* Update recent_fail_summary.yaml * Update recent_fail_summary.yaml * Update recent_fail_summary.yaml * Update recent_fail_summary.yaml * Update summarize_fail.py * Update summarize_fail.py * Update summarize_fail.py * Update summarize_fail.py * Update summarize_fail.py * Update recent_fail_summary.yaml * Update summarize_fail.py * Update summarize_fail.py * Update summarize_fail.py
1 parent 274fa9e commit 3378710

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

.github/workflows/recent_fail_summary.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,18 @@ jobs:
3030
uses: actions/checkout@v3
3131
- name: Setup
3232
run: |
33-
gh run list -b master -s failure --json displayTitle,workflowName > runlist.json
33+
gh run list -R project-chip/connectedhomeip -b master -s failure --json displayTitle,workflowName > run_list.json
3434
pip install pandas
3535
env:
3636
GH_TOKEN: ${{ github.token }}
3737
- name: Run Summarization Script
3838
run: python scripts/tools/summarize_fail.py
39+
- name: Upload Logs
40+
uses: actions/upload-artifact@v3
41+
with:
42+
name: workflow-fail-summary
43+
path: |
44+
recent_fails.csv
45+
recent_fails_frequency.csv
46+
retention-days: 5
3947

scripts/tools/summarize_fail.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import pandas as pd
22

3-
df = pd.read_json("runlist.json")
3+
df = pd.read_json("run_list.json")
4+
df.columns = ["Pull Request", "Workflow"]
45
print("Recent Failures:")
5-
print(df)
6+
print(df.to_string(index=False))
7+
df.to_csv("recent_fails.csv", index=False)
8+
print()
69
print("Percentage Frequency:")
7-
print(df["workflowName"].value_counts(normalize=True) * 100)
10+
frequency = df["Workflow"].value_counts(normalize=True).mul(100).astype(str) + "%"
11+
print(frequency.to_string())
12+
frequency.to_csv("recent_fails_frequency.csv")

0 commit comments

Comments
 (0)