-
Notifications
You must be signed in to change notification settings - Fork 8
150 lines (126 loc) · 3.77 KB
/
load-tests.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: load-tests
on:
push:
branches: [main]
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
paths-ignore:
- "**/README.md"
pull_request:
branches: [main]
workflow_dispatch:
jobs:
setup-environment:
timeout-minutes: 30
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "~1.22.6"
check-latest: true
cache: false
- name: Cache Go
id: go-cache
timeout-minutes: 5
uses: actions/cache@v4
with:
path: |
~/go/bin
~/go/pkg/mod
~/.cache/go-build
key: loadtest-go-${{ hashFiles('**/go.sum') }}
- name: Install Dependencies
run: make gomoddownload
- name: Install Tools
run: make install-tools
- run: make oteltestbedcol
- name: Upload Testbed Binaries
uses: actions/upload-artifact@v4
with:
name: testbed-binaries
path: ./bin/*
loadtest:
runs-on: ubuntu-22.04
needs: [setup-environment]
strategy:
fail-fast: false
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "~1.22.6"
check-latest: true
cache: false
- name: Cache Go
id: go-cache
timeout-minutes: 5
uses: actions/cache@v4
with:
path: |
~/go/bin
~/go/pkg/mod
~/.cache/go-build
key: loadtest-go-${{ hashFiles('**/go.sum') }}
- name: Install Dependencies
run: make gomoddownload
- name: Install Tools
run: make install-tools
- name: Create results folder
run: mkdir -p results && touch results/TESTRESULTS.md
- name: Download Testbed Binaries
uses: actions/download-artifact@v4
with:
name: testbed-binaries
path: bin/
- name: Make Testbed Binaries executable
run: chmod +x bin/*
- name: Loadtest
run: make run-load-tests
- name: Create Test Result Archive
if: ${{ failure() || success() }}
continue-on-error: true
run: tar -cvf test_results_load-tests.tar internal/testbed/load/tests/results
- name: Upload Test Results
if: ${{ failure() || success() }}
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: test-result-archive-load-tests
path: ./*.tar
- name: Copy Benchmarks
run: cp internal/testbed/load/tests/results/benchmarks.json internal/testbed/load/tests/results/load-tests.json
- name: Upload benchmarks.json
uses: actions/upload-artifact@v4
with:
name: benchmark-results-load-tests
path: internal/testbed/load/tests/results/load-tests.json
update-benchmarks:
runs-on: ubuntu-22.04
needs: [loadtest]
if: github.event_name != 'pull_request'
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Download Benchmark results
uses: actions/download-artifact@v4
with:
pattern: benchmark-results-*
merge-multiple: true
path: results
- name: Normalize results
run: jq -s 'map(.[])' results/*.json > output.json
- name: Benchmark
uses: benchmark-action/github-action-benchmark@v1
with:
tool: "customSmallerIsBetter"
output-file-path: output.json
gh-pages-branch: benchmarks
max-items-in-chart: 100
github-token: ${{ secrets.GITHUB_TOKEN }}
benchmark-data-dir-path: "docs/benchmarks/loadtests"
auto-push: true