Skip to content

Use WithRequestLimit with 0 to skip rate limit #21

Use WithRequestLimit with 0 to skip rate limit

Use WithRequestLimit with 0 to skip rate limit #21

Workflow file for this run

name: Bechmark
on:
pull_request:
jobs:
benchmark:
name: Benchmark
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ^1.17
- name: Git clone (master)
uses: actions/checkout@v4
with:
ref: master
- name: Run benchmark (master)
run: go test -bench=. -count=10 -benchmem | tee /tmp/master.txt
- name: Git clone (PR)
uses: actions/checkout@v4
- name: Run benchmark (PR)
run: go test -bench=. -count=10 -benchmem | tee /tmp/pr.txt
- name: Install benchstat
run: go install golang.org/x/perf/cmd/benchstat@latest
- name: Run benchstat
run: cd /tmp && benchstat master.txt pr.txt | tee /tmp/result.txt
- name: Comment on PR with benchmark results
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const results = fs.readFileSync('/tmp/result.txt', 'utf8');
const issue_number = context.payload.pull_request.number;
const { owner, repo } = context.repo;
await github.rest.issues.createComment({
owner,
repo,
issue_number,
body: `### Benchmark Results\n\n\`\`\`\n${results}\n\`\`\``
});