Skip to content

Commit

Permalink
ci: add benchmark workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
efectn committed Sep 12, 2023
1 parent bf36183 commit 2734dc2
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/gobenchdata-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
checks:
- name: My Check
description: |-
Define a check here - in this example, we caculate % difference for NsPerOp in the diff function.
diff is a function where you receive two parameters, current and base, and in general this function
should return a negative value for an improvement and a positive value for a regression.
package: .
benchmarks: []
diff: (current.NsPerOp - base.NsPerOp) / base.NsPerOp * 100
thresholds:
max: 10
35 changes: 35 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
on:
push:
branches:
- master
- main
paths:
- "**"
- "!**.md"
pull_request:
paths:
- "**"
- "!**.md"

name: Run Benchmarks
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "1.21.x"
- name: Publish Benchmarks
run: go run github.com/efectn-forks/gobenchdata@latest action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_PRUNE_COUNT: 30
INPUT_GO_TEST_FLAGS: -cpu 1,2
INPUT_PUBLISH: true
INPUT_CHECKS: true
INPUT_CHECKS_CONFIG: .github/gobenchdata-checks.yml
INPUT_SUBDIRECTORY: ace amber django handlebars html jet mustache pug slim
INPUT_PUBLISH_BRANCH: gh-pages

0 comments on commit 2734dc2

Please sign in to comment.