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 9
9
- id : check-yaml
10
10
- id : check-toml
11
11
- id : requirements-txt-fixer
12
- - repo : https://github.com/asottile/pyupgrade
13
- rev : v3.20.0
14
- hooks :
15
- - id : pyupgrade
16
12
- repo : https://github.com/astral-sh/ruff-pre-commit
17
13
rev : v0.12.11
18
14
hooks :
Original file line number Diff line number Diff line change 13
13
- Target files: testing/main.c (or adjust as needed)
14
14
"""
15
15
16
+ import os
16
17
import subprocess
17
18
import time
18
19
import statistics
@@ -131,6 +132,17 @@ def report(results):
131
132
f .write (line + "\n " )
132
133
print (f"\n Results saved to { RESULTS_FILE } " )
133
134
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
+
134
146
135
147
def main ():
136
148
git_clone ()
You can’t perform that action at this time.
0 commit comments