Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add benchmark workflow #294

Merged
merged 2 commits into from
Sep 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
on:
push:
branches:
- master
- main
paths:
- "**"
- "!**.md"
pull_request:
paths:
- "**"
- "!**.md"

permissions:
deployments: write
contents: write

name: Benchmark
jobs:
Compare:
runs-on: ubuntu-latest
steps:
- name: Fetch Repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v4
with:
# NOTE: Keep this in sync with the version from go.mod
go-version: "1.20.x"

- name: Run Benchmarks
run: |
set -o pipefail
for d in */ ; do
cd "$d"
go test ./... -benchmem -run=^$ -bench . | tee -a ../output.txt
cd ..
done
shell: bash

- name: Get Previous Benchmark Results
uses: actions/cache@v3
with:
path: ./cache
key: ${{ runner.os }}-benchmark

- name: Save Benchmark Results
uses: benchmark-action/[email protected]
gaby marked this conversation as resolved.
Show resolved Hide resolved
with:
tool: "go"
output-file-path: output.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
benchmark-data-dir-path: "benchmarks"
fail-on-alert: true
comment-on-alert: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
#summary-always: ${{ github.event_name != 'push' && github.event_name != 'workflow_dispatch' }}
auto-push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
save-data-file: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
Loading