File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,11 +72,28 @@ jobs:
7272 python benches/run_benches.py
7373
7474 - name : Commit benchmark results
75+ if : startsWith(github.ref, 'refs/tags/')
7576 uses : stefanzweifel/git-auto-commit-action@v4
7677 with :
7778 commit_message : " docs(benchmarks): update benchmark results"
7879 file_pattern : BENCHMARKS.md
7980
81+ - name : Post benchmark results to PR
82+ if : github.event_name == 'pull_request'
83+ uses : actions/github-script@v6
84+ with :
85+ github-token : ${{ secrets.GITHUB_TOKEN }}
86+ script : |
87+ const fs = require('fs');
88+ const benchmarks = fs.readFileSync('BENCHMARKS.md', 'utf8');
89+ const body = `## Benchmark Results\n\n${benchmarks}`;
90+ github.rest.issues.createComment({
91+ issue_number: context.issue.number,
92+ owner: context.repo.owner,
93+ repo: context.repo.repo,
94+ body: body
95+ });
96+
8097 test :
8198 name : Test on ${{ matrix.os }} / ${{ matrix.rust }}
8299 runs-on : ${{ matrix.os }}
You can’t perform that action at this time.
0 commit comments