-
Notifications
You must be signed in to change notification settings - Fork 8
/
benchtest.yml
37 lines (37 loc) · 1.07 KB
/
benchtest.yml
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
description: "Run go benchmarks and fail on regressions."
parameters:
tolerance:
description: "Tolerable slowdown (%)."
type: integer
default: 25
baseline:
description: "Baseline branch to which to compare (if any)."
type: string
default: ""
cmd:
description: "Benchmark command."
type: string
default: go test -run=NONE -bench=. ./...
steps:
- benchmark:
cmd: << parameters.cmd >>
branch: master
output: /tmp/benchmark-before.txt
- benchmark:
cmd: << parameters.cmd >>
output: /tmp/benchmark-after.txt
- benchcmp:
before: /tmp/benchmark-before.txt
after: /tmp/benchmark-after.txt
tolerance: << parameters.tolerance >>
- when:
condition: << parameters.baseline >>
steps:
- benchmark:
cmd: << parameters.cmd >>
branch: << parameters.baseline >>
output: /tmp/benchmark-baseline.txt
- benchcmp:
before: /tmp/benchmark-baseline.txt
after: /tmp/benchmark-after.txt
tolerance: << parameters.tolerance >>