File tree Expand file tree Collapse file tree 1 file changed +0
-31
lines changed
Expand file tree Collapse file tree 1 file changed +0
-31
lines changed Original file line number Diff line number Diff line change 4747 github-token : ${{ secrets.GITHUB_TOKEN }}
4848 summary-always : true
4949 skip-fetch-gh-pages : true
50-
51- - name : Append benchmark table to summary
52- if : always()
53- run : |
54- if [ -f output.json ]; then
55- echo '## Pytest Benchmark Results' >> "$GITHUB_STEP_SUMMARY"
56- echo '' >> "$GITHUB_STEP_SUMMARY"
57- jq -r '
58- def fmt_ns(v):
59- if v >= 1e9 then
60- (100 * (v / 1e9) | round / 100 | tostring) + " s"
61- elif v >= 1e6 then
62- (100 * (v / 1e6) | round / 100 | tostring) + " ms"
63- elif v >= 1e3 then
64- (100 * (v / 1e3) | round / 100 | tostring) + " µs"
65- else
66- (100 * v | round / 100 | tostring) + " ns"
67- end;
68-
69- .benchmarks
70- | ("| Benchmark | Mean | Min | Max | Rounds | Iterations |", "|---|---:|---:|---:|---:|---:|") ,
71- (.[] | "| " + .name +
72- " | " + fmt_ns(.stats.mean * 1e9) +
73- " | " + fmt_ns(.stats.min * 1e9) +
74- " | " + fmt_ns(.stats.max * 1e9) +
75- " | " + (.stats.rounds | tostring) +
76- " | " + (.stats.iterations | tostring) + " |")
77- ' output.json >> "$GITHUB_STEP_SUMMARY"
78- else
79- echo 'No benchmark output.json found.' >> "$GITHUB_STEP_SUMMARY"
80- fi
You can’t perform that action at this time.
0 commit comments