File tree Expand file tree Collapse file tree 3 files changed +37
-4
lines changed Expand file tree Collapse file tree 3 files changed +37
-4
lines changed Original file line number Diff line number Diff line change 1+ name : Benchmark Hooks
2+
3+ on :
4+ workflow_dispatch :
5+
6+ jobs :
7+ benchmark :
8+ runs-on : ubuntu-latest
9+ steps :
10+ - name : Checkout code
11+ uses : actions/checkout@v2
12+
13+ - name : Set up Python
14+ uses : actions/setup-python@v2
15+ with :
16+ python-version : ' 3.8'
17+
18+ - name : Install dependencies
19+ run : |
20+ python -m pip install --upgrade pip
21+ pip install pre-commit
22+
23+ - name : Run benchmarks
24+ run : |
25+ python testing/benchmark_hooks.py
Original file line number Diff line number Diff line change 99 - id : check-yaml
1010 - id : check-toml
1111 - id : requirements-txt-fixer
12- - repo : https://github.com/asottile/pyupgrade
13- rev : v3.20.0
14- hooks :
15- - id : pyupgrade
1612 - repo : https://github.com/astral-sh/ruff-pre-commit
1713 rev : v0.12.11
1814 hooks :
Original file line number Diff line number Diff line change 1313- Target files: testing/main.c (or adjust as needed)
1414"""
1515
16+ import os
1617import subprocess
1718import time
1819import statistics
@@ -131,6 +132,17 @@ def report(results):
131132 f .write (line + "\n " )
132133 print (f"\n Results saved to { RESULTS_FILE } " )
133134
135+ # Write to GitHub Actions summary if available
136+ summary_path = os .environ .get ("GITHUB_STEP_SUMMARY" )
137+ if summary_path :
138+ with open (summary_path , "a" ) as f :
139+ f .write ("## Benchmark Results\n \n " )
140+ f .write (header_row + "\n " )
141+ f .write ("-+-" .join ("-" * w for w in col_widths ) + "\n " )
142+ for line in lines :
143+ f .write (line + "\n " )
144+ f .write ("\n " )
145+
134146
135147def main ():
136148 git_clone ()
You can’t perform that action at this time.
0 commit comments