Skip to content

Commit

Permalink
Workflow fail summary - artifact creation (#28737)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
kliao-csa authored and pull[bot] committed Nov 29, 2023
1 parent b5173a2 commit a3ab0a6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/recent_fail_summary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,18 @@ jobs:
uses: actions/checkout@v3
- name: Setup
run: |
gh run list -b master -s failure --json displayTitle,workflowName > runlist.json
gh run list -R project-chip/connectedhomeip -b master -s failure --json displayTitle,workflowName > run_list.json
pip install pandas
env:
GH_TOKEN: ${{ github.token }}
- name: Run Summarization Script
run: python scripts/tools/summarize_fail.py
- name: Upload Logs
uses: actions/upload-artifact@v3
with:
name: workflow-fail-summary
path: |
recent_fails.csv
recent_fails_frequency.csv
retention-days: 5

11 changes: 8 additions & 3 deletions scripts/tools/summarize_fail.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import pandas as pd

df = pd.read_json("runlist.json")
df = pd.read_json("run_list.json")
df.columns = ["Pull Request", "Workflow"]
print("Recent Failures:")
print(df)
print(df.to_string(index=False))
df.to_csv("recent_fails.csv", index=False)
print()
print("Percentage Frequency:")
print(df["workflowName"].value_counts(normalize=True) * 100)
frequency = df["Workflow"].value_counts(normalize=True).mul(100).astype(str) + "%"
print(frequency.to_string())
frequency.to_csv("recent_fails_frequency.csv")

0 comments on commit a3ab0a6

Please sign in to comment.