-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.github: add workflow for benchmarks
- Loading branch information
1 parent
4210e69
commit 3f02d1a
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
name: "Benchmarks" | ||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "*" | ||
merge_group: | ||
types: | ||
- "checks_requested" | ||
env: | ||
GO_VERSION: "~1.20.5" | ||
jobs: | ||
go-bench: | ||
name: "Go Benchmark" | ||
runs-on: ["self-hosted", "benchmarks"] | ||
needs: "unit" | ||
steps: | ||
- uses: "actions/checkout@v3" | ||
- uses: "authzed/actions/setup-go@main" | ||
with: | ||
go-version: "${{ env.GO_VERSION }}" | ||
- name: "Benchmark" | ||
run: "go run mage.go test:bench | tee benchmarks.txt" | ||
- name: "Download previous benchmark data" | ||
uses: "actions/cache@v1" | ||
with: | ||
path: "./cache" | ||
key: "${{ runner.os }}-benchmark" | ||
- uses: "benchmark-action/github-action-benchmark@v1" | ||
with: | ||
tool: "go" | ||
output-file-path: "benchmarks.txt" | ||
save-data-file: "${{ github.ref_name == 'main' }}" | ||
external-data-json-path: "./cache/benchmark-data.json" | ||
github-token: "${{ github.token }}" | ||
auto-push: false | ||
comment-on-alert: true | ||
summary-always: true |