-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (77 loc) · 2.21 KB
/
bench.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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Run Benchmarks
on:
workflow_call:
inputs:
name:
required: true
type: string
org:
required: false
type: string
default: "moov-io"
branch:
required: false
type: string
default: "master"
command:
required: true
type: string
setup_ssh_key:
required: false
type: boolean
default: false
secrets:
ssh_key:
required: false
permissions:
deployments: write
contents: write
jobs:
run:
name: Run
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: webfactory/[email protected]
if: ${{ inputs.setup_ssh_key }}
with:
ssh-private-key: ${{ secrets.ssh_key }}
- name: Configure git to use SSH key
if: ${{ inputs.setup_ssh_key }}
run: 'git config --global url."ssh://[email protected]/".insteadOf "https://github.com/"'
- uses: actions/checkout@v4
with:
repository: 'moov-io/benchmarks'
- uses: actions/checkout@v4
with:
repository: "${{inputs.org}}/${{inputs.name}}"
ref: "${{inputs.branch}}"
path: "./${{inputs.name}}/"
- uses: actions/setup-go@v5
with:
go-version: "stable"
- name: Running Benchmarks
run: |
cd ./${{inputs.name}}/
${{inputs.command}}
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: "${{inputs.org}}/${{inputs.name}} Benchmarks"
tool: 'go'
output-file-path: "./${{inputs.name}}/output.txt"
github-token: ${{ secrets.GITHUB_TOKEN }}
skip-fetch-gh-pages: true
auto-push: true
# Show alert with commit comment on detecting possible performance regression
alert-threshold: '120%'
comment-on-alert: true
fail-on-alert: true
alert-comment-cc-users: '@adamdecaf'
# Update files on master branch
gh-pages-branch: master
benchmark-data-dir-path: "docs/bench/${{inputs.name}}/"
- name: Logs
if: ${{ failure() }}
run: |
cat ./${{inputs.name}}/output.txt