-
Notifications
You must be signed in to change notification settings - Fork 373
70 lines (62 loc) · 2.51 KB
/
benchmark.yaml
File metadata and controls
70 lines (62 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
---
name: "Main"
on: # yamllint disable-line rule:truthy
# NOTE! Do NOT add any other "on", because this workflow has permission to write to the repo!
push:
branches:
- "main"
concurrency:
group: "spicedb-benchmark-${{ github.event.pull_request.number }}"
cancel-in-progress: true
permissions:
# permission to update benchmark contents in gh-pages branch
contents: "write"
jobs:
benchmarks:
name: "Run Go benchmarks on Main"
runs-on: "depot-ubuntu-24.04-arm-8" # same as build-test.yaml
timeout-minutes: 15
steps:
- uses: "actions/checkout@v6"
with:
fetch-depth: 0
- uses: "authzed/actions/setup-go@main"
with:
go-version-file: "./go.mod"
cache-dependency-path: "./go.sum"
check-latest: true
- name: "Run benchmark on Main"
run: |
set -o pipefail
go run mage.go benchmark:all | tee bench_output.txt
- name: "Get JSON for benchmark"
uses: "benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073" # v1.21.0
with:
# What benchmark tool the output.txt came from
tool: "go"
# Where the output from the benchmark tool is stored
output-file-path: "bench_output.txt"
# Updates the file content instead of generating a Git commit in GitHub Pages branch
external-data-json-path: "./cache/benchmark-data.json"
# Workflow will fail when an alert happens
fail-on-alert: true
github-token: "${{ secrets.GITHUB_TOKEN }}"
comment-on-alert: true
- name: "Publish to gh-pages. See https://authzed.github.io/spicedb/dev/bench/"
uses: "benchmark-action/github-action-benchmark@a7bc2366eda11037936ea57d811a43b3418d3073" # v1.21.0
with:
# What benchmark tool the output.txt came from
tool: "go"
# Where the output from the benchmark tool is stored
output-file-path: "bench_output.txt"
gh-pages-branch: "gh-pages"
auto-push: "true"
# auto-push requires token
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Save benchmark JSON"
uses: "actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306" # v5.0.3
with:
path: "./cache/benchmark-data.json"
# Save with commit hash to avoid "cache already exists"
key: "${{ github.sha }}-${{ runner.os }}-go-benchmark"