-
Notifications
You must be signed in to change notification settings - Fork 107
72 lines (66 loc) · 2.5 KB
/
benchmark-action.yaml
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
71
72
name: benchmarks
on:
push:
branches:
- develop
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write
# see https://github.com/benchmark-action/github-action-benchmark
jobs:
benchmark:
name: Performance regression check
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-go@v4 # default version of go is 1.10
with:
go-version: 1.20.7
- name: Install Carvel Tools
run: ./hack/install-deps.sh
# Run benchmark with `go test -bench` and stores the output to a file
- name: Setup k8s and Run benchmark
run: |
set -e -x
minikube start --driver=docker
eval $(minikube docker-env --shell=bash)
./hack/deploy-test.sh
go test ./test/bench/... -bench=. | tee output.txt
# Download previous benchmark result from cache (if exists)
- name: Download previous benchmark data
uses: actions/cache@v3
with:
path: ./cache
key: ${{ runner.os }}-benchmark
# Run `github-action-benchmark` action
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@29e55772d85cc51b2a291bde13f33ef9014d2d1f
if: github.ref == 'refs/heads/develop'
with:
# What benchmark tool the output.txt came from
tool: 'go'
# Where the output from the benchmark tool is stored
output-file-path: output.txt
# Where the previous data file is stored
external-data-json-path: ./cache/benchmark-data.json
alert-threshold: '125%'
fail-on-alert: true
# GitHub API token to make a commit comment
github-token: ${{ secrets.GITHUB_TOKEN }}
# Enable alert commit comment
comment-on-alert: true
# I don't fully understand but the two storage options are mutually exclusive if they're in the same block
- name: Store Result into Github Pages
uses: benchmark-action/github-action-benchmark@29e55772d85cc51b2a291bde13f33ef9014d2d1f
if: github.ref == 'refs/heads/develop'
with:
tool: 'go'
output-file-path: output.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
# Push and deploy GitHub pages branch automatically
auto-push: true