Skip to content

Commit d0b51a4

Browse files
Print benchmarks as markdown
1 parent 70d25cf commit d0b51a4

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

.github/scripts/csv_to_md.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import sys
2+
import csv
3+
import tabulate as tab
4+
5+
csv_filename = sys.argv[1]
6+
7+
with open(csv_filename) as csv_file:
8+
csv_reader = csv.reader(csv_file)
9+
header = next(csv_reader)
10+
table = [row for row in csv_reader]
11+
12+
print(tab.tabulate(table, header, tablefmt="github"))

.github/workflows/standalone-benchmark.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ jobs:
8787
${STANDALONE_DIR}/ca -e 50kHz -g --memSize 15000000000 --sync --runs 1 --debug 1 --PROCtimingCSV ${ARTIFACT_FILE}
8888
rm -rf ${STANDALONE_DIR}/events/50kHz ${STANDALONE_DIR}/build
8989
90+
- name: Display table on GitHub web
91+
run: |
92+
python3 ${GITHUB_WORKSPACE}/.github/scripts/csv_to_md.py ${ARTIFACT_FILE} >> ${GITHUB_STEP_SUMMARY}
93+
9094
- name: Upload Artifact
9195
uses: actions/upload-artifact@v4
9296
with:

0 commit comments

Comments
 (0)