-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (67 loc) · 2.2 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
name: Benchmark
on:
workflow_dispatch:
inputs:
hostd-version:
description: hostd commit hash or branch name to use
required: false
default: ''
renterd-version:
description: renterd commit hash or branch name to use
required: false
default: 'dev'
schedule:
- cron: '0 */3 * * *'
permissions:
contents: write
pull-requests: write
jobs:
benchmark:
runs-on: linux-benchmark
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: Prepare
env:
HOSTD_UPDATE_TARGET: ${{ github.event.inputs.hostd-version }}
RENTERD_UPDATE_TARGET: ${{ github.event.inputs.renterd-version || 'dev' }}
run: |
if [ -z "$HOSTD_UPDATE_TARGET" ]; then
HOSTD_UPDATE_TARGET=$(git ls-remote https://github.com/siafoundation/hostd -q nate/rhp4 | awk '{print $1}')
fi
go get go.sia.tech/hostd@$HOSTD_UPDATE_TARGET
go get go.sia.tech/renterd@$RENTERD_UPDATE_TARGET
go mod tidy
mkdir -p results
CGO_ENABLED=1 go build -o bin/ -trimpath -a ./cmd/benchmark
git reset --hard
- name: Run RHP2
run: ./bin/benchmark -rhp2 -output results
- name: Run RHP3
run: ./bin/benchmark -rhp3 -output results
- name: Run RHP4
run: ./bin/benchmark -rhp4 -output results
- name: Run e2e
run: ./bin/benchmark -e2e -output results
- name: Generate Charts
continue-on-error: true # chromedp is unreliable in CI
run: go run ./cmd/chart -dir results
- name: Add Results
uses: peter-evans/create-pull-request@v7
id: result
with:
delete-branch: true
commit-message: Add benchmark results
title: Add benchmark results
branch: benchmark-result
labels: |
benchmark
add-paths: |
results/*.csv
results/*.png
- name: Automerge
run: gh pr merge --merge --auto "${{ steps.result.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}