Skip to content

Commit

Permalink
implement bencher
Browse files Browse the repository at this point in the history
  • Loading branch information
mikenye committed Dec 30, 2024
1 parent 8227893 commit 3374714
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 52 deletions.
52 changes: 0 additions & 52 deletions .github/workflows/bencher.yaml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/bencher_pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Bencher

on:
pull_request:
types: [opened, reopened, edited, synchronize]

jobs:
benchmark_pr_branch:
name: Continuous Benchmarking PRs with Bencher
# DO NOT REMOVE: For handling Fork PRs see Pull Requests from Forks
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bencherdev/bencher@main
- name: Track PR Benchmarks with Bencher
run: |
bencher run \
--project geom2d \
--token '${{ secrets.BENCHER_TOKEN }}' \
--branch "$GITHUB_HEAD_REF" \
--start-point "$GITHUB_BASE_REF" \
--start-point-hash '${{ github.event.pull_request.base.sha }}' \
--start-point-clone-thresholds \
--start-point-reset \
--testbed ubuntu-latest \
--err \
--adapter go_bench "go test -bench ." \
--github-actions '${{ secrets.GITHUB_TOKEN }}' \
44 changes: 44 additions & 0 deletions .github/workflows/bencher_push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Bencher (on push to main)

on:
push:
branches: [main]

jobs:
benchmark_base_branch:
name: Bencher (on push to main)
permissions:
checks: write
runs-on: ubuntu-latest
steps:

# Checkout repo
- name: Checkout repository
uses: actions/checkout@v4

# Setup Go with caching
- name: Set up Go
uses: actions/setup-go@v5
with:
cache: 'true'
cache-dependency-path: ./go.sum
check-latest: 'true'
go-version-file: ./go.mod

# Install bencher
- uses: bencherdev/bencher@main
- name: Track base branch benchmarks with Bencher
run: |
bencher run \
--project geom2d \
--token '${{ secrets.BENCHER_TOKEN }}' \
--branch main \
--testbed ubuntu-latest \
--threshold-measure latency \
--threshold-test t_test \
--threshold-max-sample-size 64 \
--threshold-upper-boundary 0.99 \
--thresholds-reset \
--err \
--adapter go_bench "go test -bench ." \
--github-actions '${{ secrets.GITHUB_TOKEN }}'

0 comments on commit 3374714

Please sign in to comment.