Skip to content

Commit 05c8de6

Browse files
committed
feat(ci): Moved benchmarks results to PR comments
1 parent 8fc7b97 commit 05c8de6

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/CI.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff 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 }}

0 commit comments

Comments
 (0)